tsip_dialog_invite.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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.h
  23. * @brief SIP dialog INVITE.
  24. *
  25. * @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
  26. *
  27. */
  28. #ifndef TINYSIP_DIALOG_INVITE_H
  29. #define TINYSIP_DIALOG_INVITE_H
  30. #include "tinysip_config.h"
  31. #include "tinysip/dialogs/tsip_dialog.h"
  32. #include "tinymedia/tmedia_session.h"
  33. TSIP_BEGIN_DECLS
  34. #define TSIP_DIALOG_INVITE(self) ((tsip_dialog_invite_t*)(self))
  35. typedef struct tsip_dialog_invite {
  36. TSIP_DECLARE_DIALOG;
  37. tsk_bool_t support_update; /**< Indicates whether the remote party support UPDATE */
  38. tsk_bool_t is_client;
  39. tsk_bool_t is_transf;
  40. tsk_bool_t refersub;
  41. tsk_bool_t use_rtcp;
  42. tsk_bool_t use_rtcpmux;
  43. tsk_bool_t is_initial_iack_pending; // we're waiting for the initial incoming ACK (for the 200 OK) to ensure the session
  44. tsk_bool_t is_cancelling; // whether we're cancelling the outgoing INVITE
  45. tsk_bool_t is_conditional_ringing_enabled; // whether to ask end-user before sending 18x ringing message
  46. uint32_t rseq;
  47. uint32_t cseq_out_media_update; // CSeq for the last media update request (INVITE or UPDATE).
  48. uint64_t last_out_fastupdate_time;
  49. tsip_timer_t timershutdown;
  50. tsip_timer_t timer100rel;
  51. tsip_response_t* last_o1xxrel;
  52. tsip_request_t* last_iInvite;
  53. tsip_request_t* last_oInvite;
  54. tsip_request_t* last_iRefer;
  55. tmedia_session_mgr_t* msession_mgr; /**< Media session Manager */
  56. struct tsip_ssession_s* ss_transf;
  57. /* ICE */
  58. struct {
  59. tmedia_type_t media_type;
  60. tsk_bool_t is_jingle;
  61. tsk_bool_t start_smgr;
  62. struct tnet_ice_ctx_s *ctx_audio;
  63. struct tnet_ice_ctx_s *ctx_video;
  64. tsk_fsm_action_id last_action_id;
  65. tsip_action_t* last_action;
  66. tsip_message_t* last_message;
  67. int32_t last_sdp_ro_ver;
  68. } ice;
  69. /* Session Timers */
  70. struct {
  71. tsip_timer_t timer;
  72. char* refresher;
  73. uint64_t minse;
  74. tsk_bool_t is_refresher;
  75. } stimers;
  76. /* QoS (Preconditions) */
  77. struct {
  78. tsip_timer_t timer;
  79. enum tmedia_qos_stype_e type;
  80. enum tmedia_qos_strength_e strength;
  81. } qos;
  82. /* Hold/Resume */
  83. struct {
  84. unsigned remote:1;
  85. unsigned local:1;
  86. } hold;
  87. struct {
  88. unsigned _100rel:1;
  89. unsigned precondition:1;
  90. unsigned timer:1;
  91. unsigned norefersub:1;
  92. unsigned ice:1;
  93. } supported;
  94. struct {
  95. unsigned _100rel:1;
  96. unsigned precondition:1;
  97. unsigned timer:1;
  98. unsigned norefersub;
  99. unsigned ice:1;
  100. } required;
  101. }
  102. tsip_dialog_invite_t;
  103. tsip_dialog_invite_t* tsip_dialog_invite_create(const tsip_ssession_handle_t* ss, const char* call_id);
  104. int tsip_dialog_invite_start(tsip_dialog_invite_t *self);
  105. TINYSIP_GEXTERN const tsk_object_def_t *tsip_dialog_invite_def_t;
  106. TSIP_END_DECLS
  107. #endif /* TINYSIP_DIALOG_INVITE_H */