tsip_api_invite.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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_api_invite.h
  23. * @brief Public messaging (INVITE) functions.
  24. *
  25. * @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
  26. *
  27. */
  28. #ifndef TINYSIP_TSIP_INVITE_H
  29. #define TINYSIP_TSIP_INVITE_H
  30. #include "tinysip_config.h"
  31. #include "tinysip/tsip_event.h"
  32. #include "tinymedia/tmedia_common.h"
  33. TSIP_BEGIN_DECLS
  34. #define TSIP_INVITE_EVENT(self) ((tsip_invite_event_t*)(self))
  35. //@tinyWRAP
  36. typedef enum tsip_invite_event_type_e {
  37. // ============================
  38. // Sip Events
  39. //
  40. tsip_i_newcall,
  41. tsip_i_prechecking,
  42. //! in-dialog requests/reponses
  43. tsip_i_request,
  44. tsip_ao_request,
  45. /* 3GPP TS 24.629: Explicit Call Transfer (ECT) */
  46. tsip_o_ect_trying,
  47. tsip_o_ect_accepted,
  48. tsip_o_ect_completed,
  49. tsip_o_ect_failed,
  50. tsip_o_ect_notify,
  51. tsip_i_ect_requested,
  52. tsip_i_ect_newcall,
  53. tsip_i_ect_completed,
  54. tsip_i_ect_failed,
  55. tsip_i_ect_notify,
  56. // ============================
  57. // Media Events
  58. //
  59. tsip_m_early_media,
  60. tsip_m_updating, // Trying to update from Audio -> Video for example
  61. tsip_m_updated, // succeed to update
  62. /* 3GPP TS 24.610: Communication Hold */
  63. tsip_m_local_hold_ok,
  64. tsip_m_local_hold_nok,
  65. tsip_m_local_resume_ok,
  66. tsip_m_local_resume_nok,
  67. tsip_m_remote_hold,
  68. tsip_m_remote_resume,
  69. }
  70. tsip_invite_event_type_t;
  71. typedef struct tsip_invite_event_e {
  72. TSIP_DECLARE_EVENT;
  73. tsip_invite_event_type_t type;
  74. struct {
  75. unsigned toto:1;
  76. } av;
  77. /*struct{
  78. char* dir;
  79. } msrp;*/
  80. }
  81. tsip_invite_event_t;
  82. int tsip_invite_event_signal(tsip_invite_event_type_t type, tsip_ssession_handle_t* ss, short status_code, const char *phrase, const struct tsip_message_s* sipmessage);
  83. TINYSIP_API int tsip_api_invite_send_invite(const tsip_ssession_handle_t *ss, tmedia_type_t type, ...);
  84. TINYSIP_API int tsip_api_invite_send_info(const tsip_ssession_handle_t *ss, ...);
  85. TINYSIP_API int tsip_api_invite_send_hold(const tsip_ssession_handle_t *ss, tmedia_type_t type, ...);
  86. TINYSIP_API int tsip_api_invite_send_resume(const tsip_ssession_handle_t *ss, tmedia_type_t type, ...);
  87. TINYSIP_API int tsip_api_invite_send_large_message(const tsip_ssession_handle_t *ss, ...);
  88. TINYSIP_API int tsip_api_invite_send_ect(const tsip_ssession_handle_t *ss, const char* toUri, ...);
  89. TINYSIP_API int tsip_api_invite_send_ect_accept(const tsip_ssession_handle_t *ss, ...);
  90. TINYSIP_API int tsip_api_invite_send_ect_reject(const tsip_ssession_handle_t *ss, ...);
  91. TINYSIP_API int tsip_api_invite_send_sos(const tsip_ssession_handle_t *ss, ...);
  92. TINYSIP_API int tsip_api_invite_send_dtmf(const tsip_ssession_handle_t *ss, int event, ...);
  93. TINYSIP_API int tsip_api_invite_send_bye(const tsip_ssession_handle_t *ss, ...);
  94. TINYSIP_GEXTERN const tsk_object_def_t *tsip_invite_event_def_t;
  95. #if 1 // Backward Compatibility
  96. # define tsip_action_INVITE tsip_api_invite_send_invite
  97. # define tsip_action_HOLD tsip_api_invite_send_hold
  98. # define tsip_action_RESUME tsip_api_invite_send_resume
  99. # define tsip_action_LARGE_MESSAGE tsip_api_invite_send_large_message
  100. # define tsip_action_ECT tsip_api_invite_send_ect
  101. # define tsip_action_SOS tsip_api_invite_send_sos
  102. # define tsip_action_DTMF tsip_api_invite_send_dtmf
  103. # define tsip_action_BYE tsip_api_invite_send_bye
  104. #endif
  105. TSIP_END_DECLS
  106. #endif /* TINYSIP_TSIP_INVITE_H */