tsip_dialog_invite.common.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * Copyright (C) 2010-2011 Mamadou Diop.
  3. *
  4. * Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
  5. *
  6. * This file is part of Open Source Doubango Framework.
  7. *
  8. * DOUBANGO is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * DOUBANGO is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with DOUBANGO.
  20. *
  21. */
  22. /**@file tsip_dialog_invite.common.h
  23. * @brief SIP dialog INVITE (common variables).
  24. *
  25. * @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
  26. *
  27. */
  28. #ifndef TINYSIP_DIALOG_INVITE_COMMON_H
  29. #define TINYSIP_DIALOG_INVITE_COMMON_H
  30. #include "tinysip/api/tsip_api_invite.h"
  31. #define DEBUG_STATE_MACHINE 1
  32. #define TSIP_DIALOG_INVITE_SIGNAL(self, type, code, phrase, message) \
  33. tsip_invite_event_signal(type, TSIP_DIALOG(self)->ss, code, phrase, message)
  34. #define TSIP_DIALOG_INVITE_TIMER_SCHEDULE(TX) TSIP_DIALOG_TIMER_SCHEDULE(invite, TX)
  35. #define TSIP_DIALOG_INVITE_ICE_CONNCHECK_TIMEOUT 16000
  36. /* ======================== actions ======================== */
  37. typedef enum _fsm_action_e {
  38. _fsm_action_accept = tsip_atype_accept,
  39. _fsm_action_reject = tsip_atype_hangup,
  40. _fsm_action_dtmf_send = tsip_atype_dtmf_send,
  41. _fsm_action_msrp_send_msg = tsip_atype_lmessage,
  42. _fsm_action_oINVITE = tsip_atype_invite,
  43. _fsm_action_oCANCEL = tsip_atype_cancel,
  44. _fsm_action_oHold = tsip_atype_hold,
  45. _fsm_action_oResume = tsip_atype_resume,
  46. _fsm_action_oECT = tsip_atype_ect,
  47. _fsm_action_iECT_ACCEPT = tsip_atype_ect_accept,
  48. _fsm_action_iECT_REJECT = tsip_atype_ect_reject,
  49. _fsm_action_iECT_lNOTIFY = tsip_atype_ect_lnotify,
  50. _fsm_action_oINFO = tsip_atype_info_send,
  51. _fsm_action_oBYE = tsip_atype_hangup,
  52. _fsm_action_oShutdown = tsip_atype_shutdown,
  53. _fsm_action_transporterror = tsip_atype_transport_error,
  54. _fsm_action_iINVITE = 0xFF,
  55. _fsm_action_oUPDATE,
  56. _fsm_action_iUPDATE,
  57. _fsm_action_iCANCEL,
  58. _fsm_action_iPRACK,
  59. _fsm_action_oPRACK,
  60. _fsm_action_iACK,
  61. _fsm_action_oACK,
  62. _fsm_action_iOPTIONS,
  63. _fsm_action_oOPTIONS,
  64. _fsm_action_iBYE,
  65. _fsm_action_iREFER,
  66. _fsm_action_iINFO,
  67. _fsm_action_iNOTIFY,
  68. _fsm_action_timer100rel,
  69. _fsm_action_timerRefresh,
  70. _fsm_action_timerRSVP,
  71. _fsm_action_i1xx,
  72. _fsm_action_i2xx,
  73. _fsm_action_i300_to_i699,
  74. _fsm_action_i401_i407,
  75. _fsm_action_i422,
  76. _fsm_action_shutdown_timedout, /* Any -> Terminated */
  77. _fsm_action_error,
  78. }
  79. _fsm_action_t;
  80. /* ======================== states ======================== */
  81. typedef enum _fsm_state_e {
  82. _fsm_state_Started,
  83. _fsm_state_Outgoing,
  84. _fsm_state_Incoming,
  85. _fsm_state_PreChecking,
  86. _fsm_state_Trying,
  87. _fsm_state_Ringing,
  88. _fsm_state_Cancelling,
  89. _fsm_state_InProgress,
  90. _fsm_state_Holding,
  91. _fsm_state_Resuming,
  92. _fsm_state_oECTing,
  93. _fsm_state_iECTing,
  94. _fsm_state_iECTreq,
  95. _fsm_state_Connected,
  96. _fsm_state_Terminated
  97. }
  98. _fsm_state_t;
  99. #define send_INVITE(self, force_sdp) send_INVITEorUPDATE(self, tsk_true, force_sdp)
  100. #define send_UPDATE(self, force_sdp) send_INVITEorUPDATE(self, tsk_false, force_sdp)
  101. #else
  102. #error "This file must only be included in a source(.c or .cxx)"
  103. #endif /* TINYSIP_DIALOG_INVITE_COMMON_H */