SipStack.i 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. %{
  2. #include "ActionConfig.h"
  3. #include "MediaSessionMgr.h"
  4. #include "MediaContent.h"
  5. #include "SipUri.h"
  6. #include "SipMessage.h"
  7. #include "SipEvent.h"
  8. #include "SipSession.h"
  9. #include "ProxyPluginMgr.h"
  10. #include "ProxyConsumer.h"
  11. #include "ProxyProducer.h"
  12. #include "SipCallback.h"
  13. #include "SafeObject.h"
  14. #include "SipStack.h"
  15. %}
  16. /* Callbacks */
  17. %feature("director") SipCallback;
  18. %feature("director") ProxyPluginMgrCallback;
  19. %feature("director") ProxyAudioConsumerCallback;
  20. %feature("director") ProxyVideoConsumerCallback;
  21. %feature("director") ProxyAudioProducerCallback;
  22. %feature("director") ProxyVideoProducerCallback;
  23. %feature("director") T140Callback;
  24. %nodefaultctor;
  25. %include "ActionConfig.h"
  26. %include "MediaSessionMgr.h"
  27. %include "MediaContent.h"
  28. %include "SipUri.h"
  29. %include "SipMessage.h"
  30. %include "SipEvent.h"
  31. %include "SipSession.h"
  32. %include "ProxyPluginMgr.h"
  33. %include "ProxyConsumer.h"
  34. %include "ProxyProducer.h"
  35. %include "SipCallback.h"
  36. %include "SafeObject.h"
  37. %include "SipStack.h"
  38. %clearnodefaultctor;
  39. /* ====== From "tinySIP\include\tsip.h" ====== */
  40. typedef enum tsip_stack_mode_e
  41. {
  42. tsip_stack_mode_ua,
  43. tsip_stack_mode_p2p,
  44. tsip_stack_mode_mediaproxy,
  45. tsip_stack_mode_mcu
  46. }
  47. tsip_stack_mode_t;
  48. /* ====== From "tinySIP\include\tinysip\tsip_messag_common.h" ====== */
  49. typedef enum tsip_request_type_e
  50. {
  51. tsip_NONE = 0,
  52. tsip_ACK,
  53. tsip_BYE,
  54. tsip_CANCEL,
  55. tsip_INVITE,
  56. tsip_OPTIONS,
  57. tsip_REGISTER,
  58. tsip_SUBSCRIBE,
  59. tsip_NOTIFY,
  60. tsip_REFER,
  61. tsip_INFO,
  62. tsip_UPDATE,
  63. tsip_MESSAGE,
  64. tsip_PUBLISH,
  65. tsip_PRACK
  66. }
  67. tsip_request_type_t;
  68. /* ====== From "tinySIP\include\tinysip\tsip_event.h" ====== */
  69. typedef enum tsip_event_type_e
  70. {
  71. tsip_event_invite,
  72. tsip_event_message,
  73. tsip_event_info,
  74. tsip_event_options,
  75. tsip_event_publish,
  76. tsip_event_register,
  77. tsip_event_subscribe,
  78. tsip_event_dialog
  79. }
  80. tsip_event_type_t;
  81. // 7xx ==> errors
  82. #define tsip_event_code_dialog_transport_error 702
  83. #define tsip_event_code_dialog_global_error 703
  84. #define tsip_event_code_dialog_message_error 704
  85. // 8xx ==> success
  86. #define tsip_event_code_dialog_request_incoming 800
  87. #define tsip_event_code_dialog_request_outgoing 802
  88. #define tsip_event_code_dialog_request_cancelled 803
  89. #define tsip_event_code_dialog_request_sent 804
  90. #define tsip_event_code_dialog_request_prechecking 805
  91. // 9xx ==> Informational
  92. #define tsip_event_code_dialog_connecting 900
  93. #define tsip_event_code_dialog_connected 901
  94. #define tsip_event_code_dialog_terminating 902
  95. #define tsip_event_code_dialog_terminated 903
  96. #define tsip_event_code_stack_starting 950
  97. #define tsip_event_code_stack_started 951
  98. #define tsip_event_code_stack_stopping 952
  99. #define tsip_event_code_stack_stopped 953
  100. #define tsip_event_code_stack_failed_to_start 954
  101. #define tsip_event_code_stack_failed_to_stop 955
  102. #define tsip_event_code_stack_disconnected 956
  103. /* ====== From "tinySIP\include\tinysip\tsip_api_register.h" ====== */
  104. typedef enum tsip_register_event_type_e
  105. {
  106. tsip_i_newreg,
  107. tsip_i_register, // refresh
  108. tsip_ao_register,
  109. tsip_i_unregister,
  110. tsip_ao_unregister,
  111. }
  112. tsip_register_event_type_t;
  113. /* ====== From "tinySIP\include\tinysip\tsip_api_subscribe.h" ====== */
  114. typedef enum tsip_subscribe_event_type_e
  115. {
  116. tsip_i_subscribe,
  117. tsip_ao_subscribe,
  118. tsip_i_unsubscribe,
  119. tsip_ao_unsubscribe,
  120. tsip_i_notify,
  121. tsip_ao_notify
  122. }
  123. tsip_subscribe_event_type_t;
  124. /* ====== From "tinySIP\include\tinysip\tsip_api_publish.h" ====== */
  125. typedef enum tsip_publish_event_type_e
  126. {
  127. tsip_i_publish,
  128. tsip_ao_publish,
  129. tsip_i_unpublish,
  130. tsip_ao_unpublish
  131. }
  132. tsip_publish_event_type_t;
  133. /* ====== From "tinySIP\include\tinysip\tsip_api_message.h" ====== */
  134. typedef enum tsip_message_event_type_e
  135. {
  136. tsip_i_message,
  137. tsip_ao_message,
  138. }
  139. tsip_message_event_type_t;
  140. /* ====== From "tinySIP\include\tinysip\tsip_api_info.h" ====== */
  141. typedef enum tsip_info_event_type_e
  142. {
  143. tsip_i_info,
  144. tsip_ao_info,
  145. }
  146. tsip_info_event_type_t;
  147. /* ====== From "tinySIP\include\tinysip\tsip_api_options.h" ====== */
  148. typedef enum tsip_options_event_type_e
  149. {
  150. tsip_i_options,
  151. tsip_ao_options,
  152. }
  153. tsip_options_event_type_t;
  154. /* ====== From "tinySIP\include\tinysip\tsip_api_invite.h" ====== */
  155. typedef enum tsip_invite_event_type_e
  156. {
  157. // ============================
  158. // Sip Events
  159. //
  160. tsip_i_newcall,
  161. tsip_i_prechecking,
  162. //! in-dialog requests/reponses
  163. tsip_i_request,
  164. tsip_ao_request,
  165. /* 3GPP TS 24.629: Explicit Call Transfer (ECT) */
  166. tsip_o_ect_trying,
  167. tsip_o_ect_accepted,
  168. tsip_o_ect_completed,
  169. tsip_o_ect_failed,
  170. tsip_o_ect_notify,
  171. tsip_i_ect_requested,
  172. tsip_i_ect_newcall,
  173. tsip_i_ect_completed,
  174. tsip_i_ect_failed,
  175. tsip_i_ect_notify,
  176. // ============================
  177. // Media Events
  178. //
  179. tsip_m_early_media,
  180. tsip_m_updating, // Trying to update from Audio -> Video for example
  181. tsip_m_updated, // succeed to update
  182. /* 3GPP TS 24.610: Communication Hold */
  183. tsip_m_local_hold_ok,
  184. tsip_m_local_hold_nok,
  185. tsip_m_local_resume_ok,
  186. tsip_m_local_resume_nok,
  187. tsip_m_remote_hold,
  188. tsip_m_remote_resume,
  189. }
  190. tsip_invite_event_type_t;
  191. /* ====== From "tinymedia/tmedia_qos.h" ====== */
  192. typedef enum tmedia_qos_stype_e
  193. {
  194. tmedia_qos_stype_none,/* not part of the RFC */
  195. tmedia_qos_stype_segmented,
  196. tmedia_qos_stype_e2e,
  197. }
  198. tmedia_qos_stype_t;
  199. /* ====== From "tinymedia/tmedia_qos.h" ====== */
  200. typedef enum tmedia_qos_strength_e
  201. {
  202. /* do no change the order (none -> optional -> manadatory) */
  203. tmedia_qos_strength_none,
  204. tmedia_qos_strength_failure,
  205. tmedia_qos_strength_unknown,
  206. tmedia_qos_strength_optional,
  207. tmedia_qos_strength_mandatory
  208. }
  209. tmedia_qos_strength_t;
  210. /* ====== From "tinymedia/tmedia_common.h" ====== */
  211. // used by tinyWRAP
  212. typedef enum tmedia_chroma_e
  213. {
  214. tmedia_chroma_none=0,
  215. tmedia_chroma_rgb24, // will be stored as bgr24 on x86 (little endians) machines; e.g. WindowsPhone7
  216. tmedia_chroma_bgr24, // used by windows consumer (DirectShow) -
  217. tmedia_chroma_rgb32, // used by iOS4 consumer (iPhone and iPod touch)
  218. tmedia_chroma_rgb565le, // (used by both android and wince consumers)
  219. tmedia_chroma_rgb565be,
  220. tmedia_chroma_nv12, // used by iOS4 producer (iPhone and iPod Touch 3GS and 4)
  221. tmedia_chroma_nv21, // Yuv420 SP (used by android producer)
  222. tmedia_chroma_yuv422p,
  223. tmedia_chroma_uyvy422, // used by iOS4 producer (iPhone and iPod Touch 3G)
  224. tmedia_chroma_yuv420p, // Default
  225. tmedia_chroma_mjpeg, // Compressed. e.g. used by VirtualBox (Windows as host and Ubuntu as guest)
  226. tmedia_chroma_yuyv422, // YUYV422 (V4L2 preferred format)
  227. }
  228. tmedia_chroma_t;
  229. /* ====== From "tinymedia/tmedia_common.h" ====== */
  230. typedef enum tmedia_mode_e
  231. {
  232. tmedia_mode_none,
  233. tmedia_mode_optional,
  234. tmedia_mode_mandatory
  235. }
  236. tmedia_mode_t;
  237. /* ====== From "tinymedia/tmedia_common.h" ====== */
  238. typedef enum tmedia_srtp_mode_e
  239. {
  240. tmedia_srtp_mode_none,
  241. tmedia_srtp_mode_optional,
  242. tmedia_srtp_mode_mandatory
  243. }
  244. tmedia_srtp_mode_t;
  245. /* ====== From "tinymedia/tmedia_common.h" ====== */
  246. typedef enum tmedia_srtp_type_e
  247. {
  248. tmedia_srtp_type_none = 0x00,
  249. tmedia_srtp_type_sdes = 0x01,
  250. tmedia_srtp_type_dtls = 0x02,
  251. tmedia_srtp_type_sdes_dtls = (0x01 | 0x02)
  252. }
  253. tmedia_srtp_type_t;
  254. /* ====== From "tinymedia/tmedia_common.h" ====== */
  255. typedef enum tmedia_t140_data_type_e
  256. {
  257. tmedia_t140_data_type_utf8,
  258. tmedia_t140_data_type_zero_width_no_break_space = 0xefbbbf,
  259. tmedia_t140_data_type_backspace = 0x08,
  260. tmedia_t140_data_type_esc = 0x1b,
  261. tmedia_t140_data_type_cr = 0x0d,
  262. tmedia_t140_data_type_lf = 0x0a,
  263. tmedia_t140_data_type_cr_lf = 0x0d0a,
  264. tmedia_t140_data_type_interrupt2 = 0x61,
  265. tmedia_t140_data_type_bell = 0x07,
  266. tmedia_t140_data_type_sos = 0x98,
  267. tmedia_t140_data_type_string_term = 0x9c,
  268. tmedia_t140_data_type_graphic_start = 0x9b,
  269. tmedia_t140_data_type_graphic_end = 0x6d,
  270. tmedia_t140_data_type_loss_char_char = 0xfffd,
  271. tmedia_t140_data_type_loss_utf8 = 0xefbfbd,
  272. }
  273. tmedia_t140_data_type_t;
  274. /* ====== From "tinymedia/tmedia_common.h" ====== */
  275. #typedef enum tmedia_rtcp_event_type_e
  276. #{
  277. # tmedia_rtcp_event_type_fir, // Full Intra Refresh
  278. #}
  279. #tmedia_rtcp_event_type_t;
  280. /* ====== From "tinymedia/tmedia_common.h" ====== */
  281. typedef enum tmedia_profile_e
  282. {
  283. tmedia_profile_default,
  284. tmedia_profile_rtcweb
  285. }
  286. tmedia_profile_t;
  287. /* ====== From "tinymedia/tmedia_common.h" ====== */
  288. // @deprecated
  289. typedef enum tmedia_bandwidth_level_e
  290. {
  291. tmedia_bl_low,
  292. tmedia_bl_medium,
  293. tmedia_bl_hight,
  294. tmedia_bl_unrestricted
  295. }
  296. tmedia_bandwidth_level_t;
  297. /* ====== From "tinymedia/tmedia_common.h" ====== */
  298. typedef enum tmedia_pref_video_size_s
  299. { /* must be sorted like this */
  300. tmedia_pref_video_size_sqcif, // 128 x 98
  301. tmedia_pref_video_size_qcif, // 176 x 144
  302. tmedia_pref_video_size_qvga, // 320 x 240
  303. tmedia_pref_video_size_cif, // 352 x 288
  304. tmedia_pref_video_size_hvga, // 480 x 320
  305. tmedia_pref_video_size_vga, // 640 x 480
  306. tmedia_pref_video_size_4cif, // 704 x 576
  307. tmedia_pref_video_size_wvga, // 800 x 480
  308. tmedia_pref_video_size_svga, // 800 x 600
  309. tmedia_pref_video_size_480p, // 852 x 480
  310. tmedia_pref_video_size_xga, // 1024 x 768
  311. tmedia_pref_video_size_720p, // 1280 x 720
  312. tmedia_pref_video_size_16cif, // 1408 x 1152
  313. tmedia_pref_video_size_1080p, // 1920 x 1080
  314. tmedia_pref_video_size_2160p, // 3840 x 2160
  315. }
  316. tmedia_pref_video_size_t;
  317. /* ====== From "tinymedia/tmedia_codec.h" ====== */
  318. typedef enum tmedia_codec_id_e
  319. {
  320. tmedia_codec_id_none = 0x00000000,
  321. tmedia_codec_id_amr_nb_oa = 0x00000001<<0,
  322. tmedia_codec_id_amr_nb_be = 0x00000001<<1,
  323. tmedia_codec_id_amr_wb_oa = 0x00000001<<2,
  324. tmedia_codec_id_amr_wb_be = 0x00000001<<3,
  325. tmedia_codec_id_gsm = 0x00000001<<4,
  326. tmedia_codec_id_pcma = 0x00000001<<5,
  327. tmedia_codec_id_pcmu = 0x00000001<<6,
  328. tmedia_codec_id_ilbc = 0x00000001<<7,
  329. tmedia_codec_id_speex_nb = 0x00000001<<8,
  330. tmedia_codec_id_speex_wb = 0x00000001<<9,
  331. tmedia_codec_id_speex_uwb = 0x00000001<<10,
  332. tmedia_codec_id_bv16 = 0x00000001<<11,
  333. tmedia_codec_id_bv32 = 0x00000001<<12,
  334. tmedia_codec_id_opus = 0x00000001<<13,
  335. tmedia_codec_id_g729ab = 0x00000001<<14,
  336. tmedia_codec_id_g722 = 0x00000001<<15,
  337. /* room for new Audio codecs */
  338. tmedia_codec_id_h261 = 0x00010000<<0,
  339. tmedia_codec_id_h263 = 0x00010000<<1,
  340. tmedia_codec_id_h263p = 0x00010000<<2,
  341. tmedia_codec_id_h263pp = 0x00010000<<3,
  342. tmedia_codec_id_h264_bp = 0x00010000<<4,
  343. tmedia_codec_id_h264_mp = 0x00010000<<5,
  344. tmedia_codec_id_h264_hp = 0x00010000<<6,
  345. tmedia_codec_id_h264_bp10 = tmedia_codec_id_h264_bp, // @deprecated
  346. tmedia_codec_id_h264_bp20 = tmedia_codec_id_h264_bp, // @deprecated
  347. tmedia_codec_id_h264_bp30 = tmedia_codec_id_h264_bp, // @deprecated
  348. tmedia_codec_id_h264_svc = 0x00010000<<7,
  349. tmedia_codec_id_theora = 0x00010000<<8,
  350. tmedia_codec_id_mp4ves_es = 0x00010000<<9,
  351. tmedia_codec_id_vp8 = 0x00010000<<10,
  352. /* room for new Video codecs */
  353. tmedia_codec_id_t140 = 0x00010000<<14,
  354. tmedia_codec_id_red = 0x00010000<<15,
  355. }
  356. tmedia_codec_id_t;
  357. /* ====== From "tinydav/tdav.h" ====== */
  358. // @deprecated: to be replaced by "tmedia_codec_id_t" in Doubango 3.0
  359. typedef enum tdav_codec_id_e
  360. {
  361. tdav_codec_id_none = 0x00000000,
  362. tdav_codec_id_amr_nb_oa = 0x00000001<<0,
  363. tdav_codec_id_amr_nb_be = 0x00000001<<1,
  364. tdav_codec_id_amr_wb_oa = 0x00000001<<2,
  365. tdav_codec_id_amr_wb_be = 0x00000001<<3,
  366. tdav_codec_id_gsm = 0x00000001<<4,
  367. tdav_codec_id_pcma = 0x00000001<<5,
  368. tdav_codec_id_pcmu = 0x00000001<<6,
  369. tdav_codec_id_ilbc = 0x00000001<<7,
  370. tdav_codec_id_speex_nb = 0x00000001<<8,
  371. tdav_codec_id_speex_wb = 0x00000001<<9,
  372. tdav_codec_id_speex_uwb = 0x00000001<<10,
  373. tdav_codec_id_bv16 = 0x00000001<<11,
  374. tdav_codec_id_bv32 = 0x00000001<<12,
  375. tdav_codec_id_opus = 0x00000001<<13,
  376. tdav_codec_id_g729ab = 0x00000001<<14,
  377. tdav_codec_id_g722 = 0x00000001<<15,
  378. /* room for new Audio codecs */
  379. tdav_codec_id_h261 = 0x00010000<<0,
  380. tdav_codec_id_h263 = 0x00010000<<1,
  381. tdav_codec_id_h263p = 0x00010000<<2,
  382. tdav_codec_id_h263pp = 0x00010000<<3,
  383. tdav_codec_id_h264_bp = 0x00010000<<4,
  384. tdav_codec_id_h264_mp = 0x00010000<<5,
  385. tdav_codec_id_h264_hp = 0x00010000<<6,
  386. tdav_codec_id_h264_bp10 = tdav_codec_id_h264_bp, // @deprecated
  387. tdav_codec_id_h264_bp20 = tdav_codec_id_h264_bp, // @deprecated
  388. tdav_codec_id_h264_bp30 = tdav_codec_id_h264_bp, // @deprecated
  389. tdav_codec_id_h264_svc = 0x00010000<<7,
  390. tdav_codec_id_theora = 0x00010000<<8,
  391. tdav_codec_id_mp4ves_es = 0x00010000<<9,
  392. tdav_codec_id_vp8 = 0x00010000<<10,
  393. /* room for new Video codecs */
  394. tdav_codec_id_t140 = 0x00010000<<14,
  395. tdav_codec_id_red = 0x00010000<<15,
  396. }
  397. tdav_codec_id_t;