rt_SipStack.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
  2. *
  3. * This file is part of Open Source Doubango Framework.
  4. *
  5. * DOUBANGO is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * DOUBANGO is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with DOUBANGO.
  17. */
  18. #pragma once
  19. #include <mutex>
  20. class SipStack;
  21. namespace doubango_rt
  22. {
  23. namespace BackEnd
  24. {
  25. ref class rtSipCallback;
  26. interface class rtISipCallback;
  27. ref class rtDDebugCallback;
  28. interface class rtIDDebugCallback;
  29. enum class rt_tdav_codec_id_t;
  30. public ref class rtDnsResult sealed
  31. {
  32. internal:
  33. rtDnsResult(uint16 port, Platform::String^ address):_port(port), _address(address) {}
  34. public:
  35. property uint16 Port { uint16 get() {
  36. return _port;
  37. };
  38. }
  39. property Platform::String^ Address { Platform::String^ get() {
  40. return _address;
  41. };
  42. }
  43. private:
  44. uint16 _port;
  45. Platform::String^ _address;
  46. };
  47. public ref class rtSipStack sealed
  48. {
  49. public:
  50. virtual ~rtSipStack();
  51. internal:
  52. rtSipStack(rtISipCallback^ callback, Platform::String^ realmUri, Platform::String^ impiString, Platform::String^ impuUri);
  53. const SipStack* getWrappedStack() {
  54. return m_pSipStack;
  55. }
  56. public:
  57. bool start();
  58. bool setDebugCallback(rtIDDebugCallback^ pCallback);
  59. bool setDisplayName(Platform::String^ display_name);
  60. bool setRealm(Platform::String^ realm_uri);
  61. bool setIMPI(Platform::String^ impi);
  62. bool setIMPU(Platform::String^ impu_uri);
  63. bool setPassword(Platform::String^ password);
  64. bool setAMF(Platform::String^ amf);
  65. bool setOperatorId(Platform::String^ opid);
  66. bool setProxyCSCF(Platform::String^ fqdn, unsigned short port, Platform::String^ transport, Platform::String^ ipversion);
  67. bool setLocalIP(Platform::String^ ip, Platform::String^ transport);
  68. bool setLocalIP(Platform::String^ ip);
  69. bool setLocalPort(unsigned short port, Platform::String^ transport);
  70. bool setLocalPort(unsigned short port);
  71. bool setEarlyIMS(bool enabled);
  72. bool addHeader(Platform::String^ name, Platform::String^ value);
  73. bool removeHeader(Platform::String^ name);
  74. bool addDnsServer(Platform::String^ ip);
  75. bool setDnsDiscovery(bool enabled);
  76. bool setAoR(Platform::String^ ip, int port);
  77. bool setSigCompParams(unsigned dms, unsigned sms, unsigned cpb, bool enablePresDict);
  78. bool addSigCompCompartment(Platform::String^ compId);
  79. bool removeSigCompCompartment(Platform::String^ compId);
  80. bool setSTUNServer(Platform::String^ ip, unsigned short port);
  81. bool setSTUNCred(Platform::String^ login, Platform::String^ password);
  82. bool setTLSSecAgree(bool enabled);
  83. bool setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey, bool verify);
  84. bool setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey);
  85. bool setIPSecSecAgree(bool enabled);
  86. bool setIPSecParameters(Platform::String^ algo, Platform::String^ ealgo, Platform::String^ mode, Platform::String^ proto);
  87. Platform::String^ dnsENUM(Platform::String^ service, Platform::String^ e164num, Platform::String^ domain);
  88. #if COM_VISIBLE
  89. rtDnsResult^ dnsNaptrSrv(Platform::String^ domain, Platform::String^ service);
  90. rtDnsResult^ dnsSrv(Platform::String^ service);
  91. Platform::String^ getLocalIP(Platform::String^ protocol);
  92. uint16 getLocalPort(Platform::String^ protocol);
  93. #else
  94. Platform::String^ dnsNaptrSrv(Platform::String^ domain, Platform::String^ service, Platform::IntPtr port);
  95. Platform::String^ dnsSrv(Platform::String^ service, Platform::IntPtr port);
  96. Platform::String^ getLocalIPnPort(Platform::String^ protocol, Platform::IntPtr port);
  97. #endif
  98. Platform::String^ getPreferredIdentity();
  99. bool isValid();
  100. bool stop();
  101. static bool initialize();
  102. static bool deInitialize();
  103. static void setCodecs(enum class rt_tdav_codec_id_t codecs);
  104. static bool setCodecPriority(enum class rt_tdav_codec_id_t codec_id, int priority);
  105. static bool isCodecSupported(enum class rt_tdav_codec_id_t codec_id);
  106. private:
  107. SipStack* m_pSipStack;
  108. rtSipCallback^ m_pSipCallback;
  109. rtDDebugCallback^ m_pDebugCallback;
  110. std::recursive_mutex mLock;
  111. };
  112. }
  113. }