Add support for incoming call pre-cheking

laforge/wip
System Administrator 4 years ago
parent 6f6c31222d
commit e2f0f6156c
  1. 0
      CMakeLists.txt
  2. 14
      bindings/_common/MediaSessionMgr.cxx
  3. 2
      bindings/_common/MediaSessionMgr.h
  4. 1
      bindings/_common/SipStack.i
  5. 0
      bindings/vs_android/tinyWRAP.sln
  6. 0
      bindings/vs_android/tinyWRAP.vcxproj
  7. 0
      bindings/vs_android/tinyWRAP.vcxproj.filters
  8. 0
      tinyBFCP/vs_android/tinyBFCP.vcxproj
  9. 0
      tinyBFCP/vs_android/tinyBFCP.vcxproj.filters
  10. 0
      tinyDAV/vs_android/tinyDAV.vcxproj
  11. 0
      tinyDAV/vs_android/tinyDAV.vcxproj.filters
  12. 0
      tinyHTTP/vs_android/tinyHTTP.vcxproj
  13. 0
      tinyHTTP/vs_android/tinyHTTP.vcxproj.filters
  14. 0
      tinyIPSec/vs_android/tinyIPSec.vcxproj
  15. 0
      tinyIPSec/vs_android/tinyIPSec.vcxproj.filters
  16. 2
      tinyMEDIA/include/tinymedia/tmedia_defaults.h
  17. 11
      tinyMEDIA/src/tmedia_defaults.c
  18. 0
      tinyMEDIA/vs_android/tinyMEDIA.vcxproj
  19. 0
      tinyMEDIA/vs_android/tinyMEDIA.vcxproj.filters
  20. 0
      tinyMSRP/vs_android/tinyMSRP.vcxproj
  21. 0
      tinyMSRP/vs_android/tinyMSRP.vcxproj.filters
  22. 0
      tinyNET/vs_android/tinyNET.vcxproj
  23. 0
      tinyNET/vs_android/tinyNET.vcxproj.filters
  24. 0
      tinyRTP/vs_android/tinyRTP.vcxproj
  25. 0
      tinyRTP/vs_android/tinyRTP.vcxproj.filters
  26. 0
      tinySAK/vs_android/tinySAK.vcxproj
  27. 0
      tinySAK/vs_android/tinySAK.vcxproj.filters
  28. 0
      tinySDP/vs_android/tinySDP.vcxproj
  29. 0
      tinySDP/vs_android/tinySDP.vcxproj.filters
  30. 0
      tinySIGCOMP/vs_android/tinySIGCOMP.vcxproj
  31. 0
      tinySIGCOMP/vs_android/tinySIGCOMP.vcxproj.filters
  32. 259
      tinySIP/include/tinysip/api/tsip_api_invite.h
  33. 241
      tinySIP/include/tinysip/dialogs/tsip_dialog_invite.common.h
  34. 255
      tinySIP/include/tinysip/dialogs/tsip_dialog_invite.h
  35. 336
      tinySIP/include/tinysip/tsip_action.h
  36. 223
      tinySIP/include/tinysip/tsip_event.h
  37. 597
      tinySIP/include/tinysip/tsip_ssession.h
  38. 3877
      tinySIP/src/dialogs/tsip_dialog_invite.c
  39. 1649
      tinySIP/src/dialogs/tsip_dialog_invite.server.c
  40. 1619
      tinySIP/src/tsip_ssession.c
  41. 0
      tinySIP/vs_android/tinySIP.vcxproj
  42. 0
      tinySIP/vs_android/tinySIP.vcxproj.filters
  43. 0
      tinySMS/vs_android/tinySMS.vcxproj
  44. 0
      tinySMS/vs_android/tinySMS.vcxproj.filters
  45. 0
      tinyXCAP/vs_android/tinyXCAP.vcxproj
  46. 0
      tinyXCAP/vs_android/tinyXCAP.vcxproj.filters

@ -473,6 +473,16 @@ int32_t MediaSessionMgr::defaultsGetNoiseSuppLevel()
return tmedia_defaults_get_noise_supp_level();
}
bool MediaSessionMgr::defaultsSetConditionalRingingEnabled(bool _cond_ringing_enabled)
{
return tmedia_defaults_set_conditional_ringing_enabled(_cond_ringing_enabled ? tsk_true : tsk_false) == 0;
}
bool MediaSessionMgr::defaultsGetConditionalRingingEnabled()
{
return !!tmedia_defaults_get_conditional_ringing_enabled();
}
bool MediaSessionMgr::defaultsSet100relEnabled(bool _100rel_enabled)
{
return tmedia_defaults_set_100rel_enabled(_100rel_enabled ? tsk_true : tsk_false) == 0;
@ -480,7 +490,7 @@ bool MediaSessionMgr::defaultsSet100relEnabled(bool _100rel_enabled)
bool MediaSessionMgr::defaultsGet100relEnabled()
{
return tmedia_defaults_get_100rel_enabled() == 0;
return !!tmedia_defaults_get_100rel_enabled();
}
bool MediaSessionMgr::defaultsSetScreenSize(int32_t sx, int32_t sy)
@ -662,4 +672,4 @@ bool MediaSessionMgr::defaultsSetOpusMaxPlaybackRate(uint32_t opus_maxplaybackra
bool MediaSessionMgr::defaultsSetMaxFds(int32_t max_fds)
{
return (tmedia_defaults_set_max_fds(max_fds) == 0);
}
}

@ -197,6 +197,8 @@ public:
static bool defaultsGetNoiseSuppEnabled();
static bool defaultsSetNoiseSuppLevel(int32_t noise_supp_level);
static int32_t defaultsGetNoiseSuppLevel();
static bool defaultsSetConditionalRingingEnabled(bool _cond_ringing_enabled);
static bool defaultsGetConditionalRingingEnabled();
static bool defaultsSet100relEnabled(bool _100rel_enabled);
static bool defaultsGet100relEnabled();
static bool defaultsSetScreenSize(int32_t sx, int32_t sy);

@ -103,6 +103,7 @@ tsip_event_type_t;
#define tsip_event_code_dialog_request_outgoing 802
#define tsip_event_code_dialog_request_cancelled 803
#define tsip_event_code_dialog_request_sent 804
#define tsip_event_code_dialog_request_prechecking 805
// 9xx ==> Informational
#define tsip_event_code_dialog_connecting 900

@ -69,6 +69,8 @@ TINYMEDIA_API int tmedia_defaults_set_noise_supp_enabled(tsk_bool_t noise_supp_e
TINYMEDIA_API tsk_bool_t tmedia_defaults_get_noise_supp_enabled();
TINYMEDIA_API int tmedia_defaults_set_noise_supp_level(int32_t noise_supp_level);
TINYMEDIA_API int32_t tmedia_defaults_get_noise_supp_level();
TINYMEDIA_API int tmedia_defaults_set_conditional_ringing_enabled(tsk_bool_t _cond_ringing_enabled);
TINYMEDIA_API tsk_bool_t tmedia_defaults_get_conditional_ringing_enabled();
TINYMEDIA_API int tmedia_defaults_set_100rel_enabled(tsk_bool_t _100rel_enabled);
TINYMEDIA_API tsk_bool_t tmedia_defaults_get_100rel_enabled();
TINYMEDIA_API int tmedia_defaults_set_screen_size(int32_t sx, int32_t sy);

@ -49,6 +49,7 @@ static float __agc_level = 8000.0f;
static tsk_bool_t __vad_enabled = tsk_false;
static tsk_bool_t __noise_supp_enabled = tsk_true;
static int32_t __noise_supp_level = -30;
static tsk_bool_t __cond_ringing_enabled = tsk_false; // Whether to let the user decide if sending ringing is needed or not -> If enabled then, the state machine will hang on "PreChecking" state until "accept" request is received from the end-user
static tsk_bool_t __100rel_enabled = tsk_true;
static int32_t __sx = -1;
static int32_t __sy = -1;
@ -333,6 +334,16 @@ int32_t tmedia_defaults_get_noise_supp_level()
return __noise_supp_level;
}
int tmedia_defaults_set_conditional_ringing_enabled(tsk_bool_t _cond_ringing_enabled)
{
__cond_ringing_enabled = _cond_ringing_enabled;
return 0;
}
tsk_bool_t tmedia_defaults_get_conditional_ringing_enabled()
{
return __cond_ringing_enabled;
}
int tmedia_defaults_set_100rel_enabled(tsk_bool_t _100rel_enabled)
{
__100rel_enabled = _100rel_enabled;

@ -1,129 +1,130 @@
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsip_api_invite.h
* @brief Public messaging (INVITE) functions.
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
*/
#ifndef TINYSIP_TSIP_INVITE_H
#define TINYSIP_TSIP_INVITE_H
#include "tinysip_config.h"
#include "tinysip/tsip_event.h"
#include "tinymedia/tmedia_common.h"
TSIP_BEGIN_DECLS
#define TSIP_INVITE_EVENT(self) ((tsip_invite_event_t*)(self))
//@tinyWRAP
typedef enum tsip_invite_event_type_e {
// ============================
// Sip Events
//
tsip_i_newcall,
//! in-dialog requests/reponses
tsip_i_request,
tsip_ao_request,
/* 3GPP TS 24.629: Explicit Call Transfer (ECT) */
tsip_o_ect_trying,
tsip_o_ect_accepted,
tsip_o_ect_completed,
tsip_o_ect_failed,
tsip_o_ect_notify,
tsip_i_ect_requested,
tsip_i_ect_newcall,
tsip_i_ect_completed,
tsip_i_ect_failed,
tsip_i_ect_notify,
// ============================
// Media Events
//
tsip_m_early_media,
tsip_m_updating, // Trying to update from Audio -> Video for example
tsip_m_updated, // succeed to update
/* 3GPP TS 24.610: Communication Hold */
tsip_m_local_hold_ok,
tsip_m_local_hold_nok,
tsip_m_local_resume_ok,
tsip_m_local_resume_nok,
tsip_m_remote_hold,
tsip_m_remote_resume,
}
tsip_invite_event_type_t;
typedef struct tsip_invite_event_e {
TSIP_DECLARE_EVENT;
tsip_invite_event_type_t type;
struct {
unsigned toto:1;
} av;
/*struct{
char* dir;
} msrp;*/
}
tsip_invite_event_t;
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);
TINYSIP_API int tsip_api_invite_send_invite(const tsip_ssession_handle_t *ss, tmedia_type_t type, ...);
TINYSIP_API int tsip_api_invite_send_info(const tsip_ssession_handle_t *ss, ...);
TINYSIP_API int tsip_api_invite_send_hold(const tsip_ssession_handle_t *ss, tmedia_type_t type, ...);
TINYSIP_API int tsip_api_invite_send_resume(const tsip_ssession_handle_t *ss, tmedia_type_t type, ...);
TINYSIP_API int tsip_api_invite_send_large_message(const tsip_ssession_handle_t *ss, ...);
TINYSIP_API int tsip_api_invite_send_ect(const tsip_ssession_handle_t *ss, const char* toUri, ...);
TINYSIP_API int tsip_api_invite_send_ect_accept(const tsip_ssession_handle_t *ss, ...);
TINYSIP_API int tsip_api_invite_send_ect_reject(const tsip_ssession_handle_t *ss, ...);
TINYSIP_API int tsip_api_invite_send_sos(const tsip_ssession_handle_t *ss, ...);
TINYSIP_API int tsip_api_invite_send_dtmf(const tsip_ssession_handle_t *ss, int event, ...);
TINYSIP_API int tsip_api_invite_send_bye(const tsip_ssession_handle_t *ss, ...);
TINYSIP_GEXTERN const tsk_object_def_t *tsip_invite_event_def_t;
#if 1 // Backward Compatibility
# define tsip_action_INVITE tsip_api_invite_send_invite
# define tsip_action_HOLD tsip_api_invite_send_hold
# define tsip_action_RESUME tsip_api_invite_send_resume
# define tsip_action_LARGE_MESSAGE tsip_api_invite_send_large_message
# define tsip_action_ECT tsip_api_invite_send_ect
# define tsip_action_SOS tsip_api_invite_send_sos
# define tsip_action_DTMF tsip_api_invite_send_dtmf
# define tsip_action_BYE tsip_api_invite_send_bye
#endif
TSIP_END_DECLS
#endif /* TINYSIP_TSIP_INVITE_H */
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsip_api_invite.h
* @brief Public messaging (INVITE) functions.
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
*/
#ifndef TINYSIP_TSIP_INVITE_H
#define TINYSIP_TSIP_INVITE_H
#include "tinysip_config.h"
#include "tinysip/tsip_event.h"
#include "tinymedia/tmedia_common.h"
TSIP_BEGIN_DECLS
#define TSIP_INVITE_EVENT(self) ((tsip_invite_event_t*)(self))
//@tinyWRAP
typedef enum tsip_invite_event_type_e {
// ============================
// Sip Events
//
tsip_i_newcall,
tsip_i_prechecking,
//! in-dialog requests/reponses
tsip_i_request,
tsip_ao_request,
/* 3GPP TS 24.629: Explicit Call Transfer (ECT) */
tsip_o_ect_trying,
tsip_o_ect_accepted,
tsip_o_ect_completed,
tsip_o_ect_failed,
tsip_o_ect_notify,
tsip_i_ect_requested,
tsip_i_ect_newcall,
tsip_i_ect_completed,
tsip_i_ect_failed,
tsip_i_ect_notify,
// ============================
// Media Events
//
tsip_m_early_media,
tsip_m_updating, // Trying to update from Audio -> Video for example
tsip_m_updated, // succeed to update
/* 3GPP TS 24.610: Communication Hold */
tsip_m_local_hold_ok,
tsip_m_local_hold_nok,
tsip_m_local_resume_ok,
tsip_m_local_resume_nok,
tsip_m_remote_hold,
tsip_m_remote_resume,
}
tsip_invite_event_type_t;
typedef struct tsip_invite_event_e {
TSIP_DECLARE_EVENT;
tsip_invite_event_type_t type;
struct {
unsigned toto:1;
} av;
/*struct{
char* dir;
} msrp;*/
}
tsip_invite_event_t;
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);
TINYSIP_API int tsip_api_invite_send_invite(const tsip_ssession_handle_t *ss, tmedia_type_t type, ...);
TINYSIP_API int tsip_api_invite_send_info(const tsip_ssession_handle_t *ss, ...);
TINYSIP_API int tsip_api_invite_send_hold(const tsip_ssession_handle_t *ss, tmedia_type_t type, ...);
TINYSIP_API int tsip_api_invite_send_resume(const tsip_ssession_handle_t *ss, tmedia_type_t type, ...);
TINYSIP_API int tsip_api_invite_send_large_message(const tsip_ssession_handle_t *ss, ...);
TINYSIP_API int tsip_api_invite_send_ect(const tsip_ssession_handle_t *ss, const char* toUri, ...);
TINYSIP_API int tsip_api_invite_send_ect_accept(const tsip_ssession_handle_t *ss, ...);
TINYSIP_API int tsip_api_invite_send_ect_reject(const tsip_ssession_handle_t *ss, ...);
TINYSIP_API int tsip_api_invite_send_sos(const tsip_ssession_handle_t *ss, ...);
TINYSIP_API int tsip_api_invite_send_dtmf(const tsip_ssession_handle_t *ss, int event, ...);
TINYSIP_API int tsip_api_invite_send_bye(const tsip_ssession_handle_t *ss, ...);
TINYSIP_GEXTERN const tsk_object_def_t *tsip_invite_event_def_t;
#if 1 // Backward Compatibility
# define tsip_action_INVITE tsip_api_invite_send_invite
# define tsip_action_HOLD tsip_api_invite_send_hold
# define tsip_action_RESUME tsip_api_invite_send_resume
# define tsip_action_LARGE_MESSAGE tsip_api_invite_send_large_message
# define tsip_action_ECT tsip_api_invite_send_ect
# define tsip_action_SOS tsip_api_invite_send_sos
# define tsip_action_DTMF tsip_api_invite_send_dtmf
# define tsip_action_BYE tsip_api_invite_send_bye
#endif
TSIP_END_DECLS
#endif /* TINYSIP_TSIP_INVITE_H */

@ -1,120 +1,121 @@
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsip_dialog_invite.common.h
* @brief SIP dialog INVITE (common variables).
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
*/
#ifndef TINYSIP_DIALOG_INVITE_COMMON_H
#define TINYSIP_DIALOG_INVITE_COMMON_H
#include "tinysip/api/tsip_api_invite.h"
#define DEBUG_STATE_MACHINE 1
#define TSIP_DIALOG_INVITE_SIGNAL(self, type, code, phrase, message) \
tsip_invite_event_signal(type, TSIP_DIALOG(self)->ss, code, phrase, message)
#define TSIP_DIALOG_INVITE_TIMER_SCHEDULE(TX) TSIP_DIALOG_TIMER_SCHEDULE(invite, TX)
#define TSIP_DIALOG_INVITE_ICE_CONNCHECK_TIMEOUT 16000
/* ======================== actions ======================== */
typedef enum _fsm_action_e {
_fsm_action_accept = tsip_atype_accept,
_fsm_action_reject = tsip_atype_hangup,
_fsm_action_dtmf_send = tsip_atype_dtmf_send,
_fsm_action_msrp_send_msg = tsip_atype_lmessage,
_fsm_action_oINVITE = tsip_atype_invite,
_fsm_action_oCANCEL = tsip_atype_cancel,
_fsm_action_oHold = tsip_atype_hold,
_fsm_action_oResume = tsip_atype_resume,
_fsm_action_oECT = tsip_atype_ect,
_fsm_action_iECT_ACCEPT = tsip_atype_ect_accept,
_fsm_action_iECT_REJECT = tsip_atype_ect_reject,
_fsm_action_iECT_lNOTIFY = tsip_atype_ect_lnotify,
_fsm_action_oINFO = tsip_atype_info_send,
_fsm_action_oBYE = tsip_atype_hangup,
_fsm_action_oShutdown = tsip_atype_shutdown,
_fsm_action_transporterror = tsip_atype_transport_error,
_fsm_action_iINVITE = 0xFF,
_fsm_action_oUPDATE,
_fsm_action_iUPDATE,
_fsm_action_iCANCEL,
_fsm_action_iPRACK,
_fsm_action_oPRACK,
_fsm_action_iACK,
_fsm_action_oACK,
_fsm_action_iOPTIONS,
_fsm_action_oOPTIONS,
_fsm_action_iBYE,
_fsm_action_iREFER,
_fsm_action_iINFO,
_fsm_action_iNOTIFY,
_fsm_action_timer100rel,
_fsm_action_timerRefresh,
_fsm_action_timerRSVP,
_fsm_action_i1xx,
_fsm_action_i2xx,
_fsm_action_i300_to_i699,
_fsm_action_i401_i407,
_fsm_action_i422,
_fsm_action_shutdown_timedout, /* Any -> Terminated */
_fsm_action_error,
}
_fsm_action_t;
/* ======================== states ======================== */
typedef enum _fsm_state_e {
_fsm_state_Started,
_fsm_state_Outgoing,
_fsm_state_Incoming,
_fsm_state_Trying,
_fsm_state_Ringing,
_fsm_state_Cancelling,
_fsm_state_InProgress,
_fsm_state_Holding,
_fsm_state_Resuming,
_fsm_state_oECTing,
_fsm_state_iECTing,
_fsm_state_iECTreq,
_fsm_state_Connected,
_fsm_state_Terminated
}
_fsm_state_t;
#define send_INVITE(self, force_sdp) send_INVITEorUPDATE(self, tsk_true, force_sdp)
#define send_UPDATE(self, force_sdp) send_INVITEorUPDATE(self, tsk_false, force_sdp)
#else
#error "This file must only be included in a source(.c or .cxx)"
#endif /* TINYSIP_DIALOG_INVITE_COMMON_H */
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsip_dialog_invite.common.h
* @brief SIP dialog INVITE (common variables).
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
*/
#ifndef TINYSIP_DIALOG_INVITE_COMMON_H
#define TINYSIP_DIALOG_INVITE_COMMON_H
#include "tinysip/api/tsip_api_invite.h"
#define DEBUG_STATE_MACHINE 1
#define TSIP_DIALOG_INVITE_SIGNAL(self, type, code, phrase, message) \
tsip_invite_event_signal(type, TSIP_DIALOG(self)->ss, code, phrase, message)
#define TSIP_DIALOG_INVITE_TIMER_SCHEDULE(TX) TSIP_DIALOG_TIMER_SCHEDULE(invite, TX)
#define TSIP_DIALOG_INVITE_ICE_CONNCHECK_TIMEOUT 16000
/* ======================== actions ======================== */
typedef enum _fsm_action_e {
_fsm_action_accept = tsip_atype_accept,
_fsm_action_reject = tsip_atype_hangup,
_fsm_action_dtmf_send = tsip_atype_dtmf_send,
_fsm_action_msrp_send_msg = tsip_atype_lmessage,
_fsm_action_oINVITE = tsip_atype_invite,
_fsm_action_oCANCEL = tsip_atype_cancel,
_fsm_action_oHold = tsip_atype_hold,
_fsm_action_oResume = tsip_atype_resume,
_fsm_action_oECT = tsip_atype_ect,
_fsm_action_iECT_ACCEPT = tsip_atype_ect_accept,
_fsm_action_iECT_REJECT = tsip_atype_ect_reject,
_fsm_action_iECT_lNOTIFY = tsip_atype_ect_lnotify,
_fsm_action_oINFO = tsip_atype_info_send,
_fsm_action_oBYE = tsip_atype_hangup,
_fsm_action_oShutdown = tsip_atype_shutdown,
_fsm_action_transporterror = tsip_atype_transport_error,
_fsm_action_iINVITE = 0xFF,
_fsm_action_oUPDATE,
_fsm_action_iUPDATE,
_fsm_action_iCANCEL,
_fsm_action_iPRACK,
_fsm_action_oPRACK,
_fsm_action_iACK,
_fsm_action_oACK,
_fsm_action_iOPTIONS,
_fsm_action_oOPTIONS,
_fsm_action_iBYE,
_fsm_action_iREFER,
_fsm_action_iINFO,
_fsm_action_iNOTIFY,
_fsm_action_timer100rel,
_fsm_action_timerRefresh,
_fsm_action_timerRSVP,
_fsm_action_i1xx,
_fsm_action_i2xx,
_fsm_action_i300_to_i699,
_fsm_action_i401_i407,
_fsm_action_i422,
_fsm_action_shutdown_timedout, /* Any -> Terminated */
_fsm_action_error,
}
_fsm_action_t;
/* ======================== states ======================== */
typedef enum _fsm_state_e {
_fsm_state_Started,
_fsm_state_Outgoing,
_fsm_state_Incoming,
_fsm_state_PreChecking,
_fsm_state_Trying,
_fsm_state_Ringing,
_fsm_state_Cancelling,
_fsm_state_InProgress,
_fsm_state_Holding,
_fsm_state_Resuming,
_fsm_state_oECTing,
_fsm_state_iECTing,
_fsm_state_iECTreq,
_fsm_state_Connected,
_fsm_state_Terminated
}
_fsm_state_t;
#define send_INVITE(self, force_sdp) send_INVITEorUPDATE(self, tsk_true, force_sdp)
#define send_UPDATE(self, force_sdp) send_INVITEorUPDATE(self, tsk_false, force_sdp)
#else
#error "This file must only be included in a source(.c or .cxx)"
#endif /* TINYSIP_DIALOG_INVITE_COMMON_H */

@ -1,127 +1,128 @@
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsip_dialog_invite.h
* @brief SIP dialog INVITE.
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
*/
#ifndef TINYSIP_DIALOG_INVITE_H
#define TINYSIP_DIALOG_INVITE_H
#include "tinysip_config.h"
#include "tinysip/dialogs/tsip_dialog.h"
#include "tinymedia/tmedia_session.h"
TSIP_BEGIN_DECLS
#define TSIP_DIALOG_INVITE(self) ((tsip_dialog_invite_t*)(self))
typedef struct tsip_dialog_invite {
TSIP_DECLARE_DIALOG;
tsk_bool_t support_update; /**< Indicates whether the remote party support UPDATE */
tsk_bool_t is_client;
tsk_bool_t is_transf;
tsk_bool_t refersub;
tsk_bool_t use_rtcp;
tsk_bool_t use_rtcpmux;
tsk_bool_t is_initial_iack_pending; // we're waiting for the initial incoming ACK (for the 200 OK) to ensure the session
tsk_bool_t is_cancelling; // whether we're cancelling the outgoing INVITE
uint32_t rseq;
uint32_t cseq_out_media_update; // CSeq for the last media update request (INVITE or UPDATE).
uint64_t last_out_fastupdate_time;
tsip_timer_t timershutdown;
tsip_timer_t timer100rel;
tsip_response_t* last_o1xxrel;
tsip_request_t* last_iInvite;
tsip_request_t* last_oInvite;
tsip_request_t* last_iRefer;
tmedia_session_mgr_t* msession_mgr; /**< Media session Manager */
struct tsip_ssession_s* ss_transf;
/* ICE */
struct {
tmedia_type_t media_type;
tsk_bool_t is_jingle;
tsk_bool_t start_smgr;
struct tnet_ice_ctx_s *ctx_audio;
struct tnet_ice_ctx_s *ctx_video;
tsk_fsm_action_id last_action_id;
tsip_action_t* last_action;
tsip_message_t* last_message;
int32_t last_sdp_ro_ver;
} ice;
/* Session Timers */
struct {
tsip_timer_t timer;
char* refresher;
uint64_t minse;
tsk_bool_t is_refresher;
} stimers;
/* QoS (Preconditions) */
struct {
tsip_timer_t timer;
enum tmedia_qos_stype_e type;
enum tmedia_qos_strength_e strength;
} qos;
/* Hold/Resume */
struct {
unsigned remote:1;
unsigned local:1;
} hold;
struct {
unsigned _100rel:1;
unsigned precondition:1;
unsigned timer:1;
unsigned norefersub:1;
unsigned ice:1;
} supported;
struct {
unsigned _100rel:1;
unsigned precondition:1;
unsigned timer:1;
unsigned norefersub;
unsigned ice:1;
} required;
}
tsip_dialog_invite_t;
tsip_dialog_invite_t* tsip_dialog_invite_create(const tsip_ssession_handle_t* ss, const char* call_id);
int tsip_dialog_invite_start(tsip_dialog_invite_t *self);
TINYSIP_GEXTERN const tsk_object_def_t *tsip_dialog_invite_def_t;
TSIP_END_DECLS
#endif /* TINYSIP_DIALOG_INVITE_H */
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsip_dialog_invite.h
* @brief SIP dialog INVITE.
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
*/
#ifndef TINYSIP_DIALOG_INVITE_H
#define TINYSIP_DIALOG_INVITE_H
#include "tinysip_config.h"
#include "tinysip/dialogs/tsip_dialog.h"
#include "tinymedia/tmedia_session.h"
TSIP_BEGIN_DECLS
#define TSIP_DIALOG_INVITE(self) ((tsip_dialog_invite_t*)(self))
typedef struct tsip_dialog_invite {
TSIP_DECLARE_DIALOG;
tsk_bool_t support_update; /**< Indicates whether the remote party support UPDATE */
tsk_bool_t is_client;
tsk_bool_t is_transf;
tsk_bool_t refersub;
tsk_bool_t use_rtcp;
tsk_bool_t use_rtcpmux;
tsk_bool_t is_initial_iack_pending; // we're waiting for the initial incoming ACK (for the 200 OK) to ensure the session
tsk_bool_t is_cancelling; // whether we're cancelling the outgoing INVITE
tsk_bool_t is_conditional_ringing_enabled; // whether to ask end-user before sending 18x ringing message
uint32_t rseq;
uint32_t cseq_out_media_update; // CSeq for the last media update request (INVITE or UPDATE).
uint64_t last_out_fastupdate_time;
tsip_timer_t timershutdown;
tsip_timer_t timer100rel;
tsip_response_t* last_o1xxrel;
tsip_request_t* last_iInvite;
tsip_request_t* last_oInvite;
tsip_request_t* last_iRefer;
tmedia_session_mgr_t* msession_mgr; /**< Media session Manager */
struct tsip_ssession_s* ss_transf;
/* ICE */
struct {
tmedia_type_t media_type;
tsk_bool_t is_jingle;
tsk_bool_t start_smgr;
struct tnet_ice_ctx_s *ctx_audio;
struct tnet_ice_ctx_s *ctx_video;
tsk_fsm_action_id last_action_id;
tsip_action_t* last_action;
tsip_message_t* last_message;
int32_t last_sdp_ro_ver;
} ice;
/* Session Timers */
struct {
tsip_timer_t timer;
char* refresher;
uint64_t minse;
tsk_bool_t is_refresher;
} stimers;
/* QoS (Preconditions) */
struct {
tsip_timer_t timer;
enum tmedia_qos_stype_e type;
enum tmedia_qos_strength_e strength;
} qos;
/* Hold/Resume */
struct {
unsigned remote:1;
unsigned local:1;
} hold;
struct {
unsigned _100rel:1;
unsigned precondition:1;
unsigned timer:1;
unsigned norefersub:1;
unsigned ice:1;
} supported;
struct {
unsigned _100rel:1;
unsigned precondition:1;
unsigned timer:1;
unsigned norefersub;
unsigned ice:1;
} required;
}
tsip_dialog_invite_t;
tsip_dialog_invite_t* tsip_dialog_invite_create(const tsip_ssession_handle_t* ss, const char* call_id);
int tsip_dialog_invite_start(tsip_dialog_invite_t *self);
TINYSIP_GEXTERN const tsk_object_def_t *tsip_dialog_invite_def_t;
TSIP_END_DECLS
#endif /* TINYSIP_DIALOG_INVITE_H */

@ -1,168 +1,168 @@
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsip_action.h
* @brief SIP action.
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
*/
#ifndef TSIP_ACTION_H
#define TSIP_ACTION_H
#include "tinysip_config.h"
#include "tsk_buffer.h"
#include "tsk_options.h"
#include "tsk_params.h"
#include "tinymedia/tmedia_common.h"
#include "tinymedia/tmedia_params.h"
TSIP_BEGIN_DECLS
typedef uint64_t tsip_action_id_t;
#define TSIP_ACTION_INVALID_ID 0
#define TSIP_ACTION_INVALID_HANDLE tsk_null
/** List of all supported actions */
typedef enum tsip_action_type_e {
//! Used as configuration action
tsip_atype_config,
tsip_atype_dtmf_send,
/* === REGISTER == */
tsip_atype_register, /**< Sends SIP REGISTER request */
//! Unregister by sending SIP REGISTER request with expires value equals to zero
#define tsip_atype_unregister tsip_atype_hangup
/* === SUBSCRIBE === */
tsip_atype_subscribe, /**< Sends SIP SUBSCRIBE request */
//! Unsubsribe by sending SIP SUBSCRIBE request with expires value equals to zero
#define tsip_atype_unsubscribe tsip_atype_hangup
/* === MESSAGE === */
tsip_atype_message_send, /**< Sends SIP MESSAGE request */
/* === INFO === */
tsip_atype_info_send, /**< Sends SIP INFO request */
/* === PUBLISH === */
tsip_atype_publish, /**< Sends SIP PUBLISH request */
//! Unpublish by sending SIP PUBLISH request with expires value equals to zero
#define tsip_atype_unpublish tsip_atype_hangup
/* === OPTIONS === */
tsip_atype_options_send, /**< Sends SIP OPTIONS request */
/* === INVITE === */
tsip_atype_invite, /**< Sends SIP INVITE/reINVITE request */
tsip_atype_hold, /**< Puts the session on hold state */
tsip_atype_resume, /**< Resumes a previously held session */
tsip_atype_ect, /**< Transfer the call */
tsip_atype_ect_accept, /**< Accept call transfer request */
tsip_atype_ect_reject, /**< Reject call transfer request */
tsip_atype_ect_lnotify, /**< Intra-Dialog notify. Never called by the end-user */
tsip_atype_lmessage, /**< Large message (MSRP). The session must be connected */
#define tsip_atype_bye tsip_atype_hangup
/* === common === */
//! Accept incoming call (INVITE) or message (SIP MESSAGE)
tsip_atype_accept,
//! Reject incoming call (INVITE) or message (SIP MESSAGE)
#define tsip_atype_reject tsip_atype_hangup
//! Cancel an outgoing request
tsip_atype_cancel,
//! Hangup any SIP dialog (BYE, unREGISTER, unSUBSCRIBE ...). If the dialog is in early state, then it will be canceled.
tsip_atype_hangup,
//! Shutdown a SIP dialog. Should only be called by the stack.
tsip_atype_shutdown,
//! Signal transport error. Should only be called by the stack.
tsip_atype_transport_error,
}
tsip_action_type_t;
/* internal enum used to pass parameters from the application layer to the stack */
typedef enum tsip_action_param_type_e {
aptype_null = 0,
aptype_header,
aptype_config,
aptype_payload,
aptype_resp_line,
aptype_media_type,
aptype_media,
}
tsip_action_param_type_t;
#define TSIP_ACTION_SET_HEADER(NAME_STR, VALUE_STR) aptype_header, (const char*)NAME_STR, (const char*)VALUE_STR
#define TSIP_ACTION_SET_PAYLOAD(PAY_PTR, PAY_SIZE) aptype_payload, (const void*)PAY_PTR, (tsk_size_t)PAY_SIZE
#define TSIP_ACTION_SET_RESP_LINE(CODE_INT, PHRASE_STR) aptype_resp_line, (int32_t)CODE_INT, (const char*)PHRASE_STR
#define TSIP_ACTION_SET_CONFIG(ACTION_CONFIG_HANDLE) aptype_config, (const tsip_action_handle_t*)ACTION_CONFIG_HANDLE
#define TSIP_ACTION_SET_MEDIA_TYPE(TYPE_ENUM) aptype_media_type, (enum tmedia_type_e)TYPE_ENUM
#define TSIP_ACTION_SET_MEDIA(...) aptype_media, ##__VA_ARGS__
#define TSIP_ACTION_SET_NULL() aptype_null
/* private action object. public api should use tsip_action_handle_t. */
typedef struct tsip_action_s {
TSK_DECLARE_OBJECT;
tsip_action_type_t type;
tsk_params_L_t *headers;
tsk_buffer_t* payload;
struct {
short code;
char* phrase;
} line_resp;
struct {
tmedia_type_t type;
tmedia_params_L_t *params;
} media;
struct {
int volume; // useless (manager will always use "10")
int event;
} dtmf;
struct {
char* to;
} ect;
}
tsip_action_t;
/**< Handle to SIP action */
typedef void tsip_action_handle_t;
TINYSIP_API tsip_action_handle_t* tsip_action_create(tsip_action_type_t type, ...);
TINYSIP_API int tsip_action_set(tsip_action_handle_t* self, ...);
typedef tsk_list_t tsip_actions_L_t; /**< List of @ref tsip_action_handle_t elements. */
TINYSIP_GEXTERN const tsk_object_def_t *tsip_action_def_t;
TSIP_END_DECLS
#endif /* TSIP_ACTION_H */
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsip_action.h
* @brief SIP action.
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
*/
#ifndef TSIP_ACTION_H
#define TSIP_ACTION_H
#include "tinysip_config.h"
#include "tsk_buffer.h"
#include "tsk_options.h"
#include "tsk_params.h"
#include "tinymedia/tmedia_common.h"
#include "tinymedia/tmedia_params.h"
TSIP_BEGIN_DECLS
typedef uint64_t tsip_action_id_t;
#define TSIP_ACTION_INVALID_ID 0
#define TSIP_ACTION_INVALID_HANDLE tsk_null
/** List of all supported actions */
typedef enum tsip_action_type_e {
//! Used as configuration action
tsip_atype_config,
tsip_atype_dtmf_send,
/* === REGISTER == */
tsip_atype_register, /**< Sends SIP REGISTER request */
//! Unregister by sending SIP REGISTER request with expires value equals to zero
#define tsip_atype_unregister tsip_atype_hangup
/* === SUBSCRIBE === */
tsip_atype_subscribe, /**< Sends SIP SUBSCRIBE request */
//! Unsubsribe by sending SIP SUBSCRIBE request with expires value equals to zero
#define tsip_atype_unsubscribe tsip_atype_hangup
/* === MESSAGE === */
tsip_atype_message_send, /**< Sends SIP MESSAGE request */
/* === INFO === */
tsip_atype_info_send, /**< Sends SIP INFO request */
/* === PUBLISH === */
tsip_atype_publish, /**< Sends SIP PUBLISH request */
//! Unpublish by sending SIP PUBLISH request with expires value equals to zero
#define tsip_atype_unpublish tsip_atype_hangup
/* === OPTIONS === */
tsip_atype_options_send, /**< Sends SIP OPTIONS request */
/* === INVITE === */
tsip_atype_invite, /**< Sends SIP INVITE/reINVITE request */
tsip_atype_hold, /**< Puts the session on hold state */
tsip_atype_resume, /**< Resumes a previously held session */
tsip_atype_ect, /**< Transfer the call */
tsip_atype_ect_accept, /**< Accept call transfer request */
tsip_atype_ect_reject, /**< Reject call transfer request */
tsip_atype_ect_lnotify, /**< Intra-Dialog notify. Never called by the end-user */
tsip_atype_lmessage, /**< Large message (MSRP). The session must be connected */
#define tsip_atype_bye tsip_atype_hangup
/* === common === */
//! Accept incoming call (INVITE) or message (SIP MESSAGE)
tsip_atype_accept,
//! Reject incoming call (INVITE) or message (SIP MESSAGE)
#define tsip_atype_reject tsip_atype_hangup
//! Cancel an outgoing request
tsip_atype_cancel,
//! Hangup any SIP dialog (BYE, unREGISTER, unSUBSCRIBE ...). If the dialog is in early state, then it will be canceled.
tsip_atype_hangup,
//! Shutdown a SIP dialog. Should only be called by the stack.
tsip_atype_shutdown,
//! Signal transport error. Should only be called by the stack.
tsip_atype_transport_error,
}
tsip_action_type_t;
/* internal enum used to pass parameters from the application layer to the stack */
typedef enum tsip_action_param_type_e {
aptype_null = 0,
aptype_header,
aptype_config,
aptype_payload,
aptype_resp_line,
aptype_media_type,
aptype_media,
}
tsip_action_param_type_t;
#define TSIP_ACTION_SET_HEADER(NAME_STR, VALUE_STR) aptype_header, (const char*)NAME_STR, (const char*)VALUE_STR
#define TSIP_ACTION_SET_PAYLOAD(PAY_PTR, PAY_SIZE) aptype_payload, (const void*)PAY_PTR, (tsk_size_t)PAY_SIZE
#define TSIP_ACTION_SET_RESP_LINE(CODE_INT, PHRASE_STR) aptype_resp_line, (int32_t)CODE_INT, (const char*)PHRASE_STR
#define TSIP_ACTION_SET_CONFIG(ACTION_CONFIG_HANDLE) aptype_config, (const tsip_action_handle_t*)ACTION_CONFIG_HANDLE
#define TSIP_ACTION_SET_MEDIA_TYPE(TYPE_ENUM) aptype_media_type, (enum tmedia_type_e)TYPE_ENUM
#define TSIP_ACTION_SET_MEDIA(...) aptype_media, ##__VA_ARGS__
#define TSIP_ACTION_SET_NULL() aptype_null
/* private action object. public api should use tsip_action_handle_t. */
typedef struct tsip_action_s {
TSK_DECLARE_OBJECT;
tsip_action_type_t type;
tsk_params_L_t *headers;
tsk_buffer_t* payload;
struct {
short code;
char* phrase;
} line_resp;
struct {
tmedia_type_t type;
tmedia_params_L_t *params;
} media;
struct {
int volume; // useless (manager will always use "10")
int event;
} dtmf;
struct {
char* to;
} ect;
}
tsip_action_t;
/**< Handle to SIP action */
typedef void tsip_action_handle_t;
TINYSIP_API tsip_action_handle_t* tsip_action_create(tsip_action_type_t type, ...);
TINYSIP_API int tsip_action_set(tsip_action_handle_t* self, ...);
typedef tsk_list_t tsip_actions_L_t; /**< List of @ref tsip_action_handle_t elements. */
TINYSIP_GEXTERN const tsk_object_def_t *tsip_action_def_t;
TSIP_END_DECLS
#endif /* TSIP_ACTION_H */

@ -1,111 +1,112 @@
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsip_event.h
* @brief SIP event.
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
*/
#ifndef TINYSIP_TSIP_EVENT_H
#define TINYSIP_TSIP_EVENT_H
#include "tinysip_config.h"
#include "tinysip/tsip_ssession.h"
TSIP_BEGIN_DECLS
#define TSIP_EVENT(self) ((tsip_event_t*)(self))
typedef enum tsip_event_type_e {
tsip_event_invite,
tsip_event_message,
tsip_event_info,
tsip_event_options,
tsip_event_publish,
tsip_event_register,
tsip_event_subscribe,
tsip_event_dialog,
tsip_event_stack,
}
tsip_event_type_t;
/* SIP codes associated to an internal event */
// 100-699 are reserved codes
// 7xx ==> errors @tinyWRAP
#define tsip_event_code_dialog_transport_error 702
#define tsip_event_code_dialog_global_error 703
#define tsip_event_code_dialog_message_error 704
// 8xx ==> success @tinyWRAP
#define tsip_event_code_dialog_request_incoming 800
#define tsip_event_code_dialog_request_outgoing 802
#define tsip_event_code_dialog_request_cancelled 803
#define tsip_event_code_dialog_request_sent 804
// 9xx ==> Informational @tinyWRAP
#define tsip_event_code_dialog_connecting 900
#define tsip_event_code_dialog_connected 901
#define tsip_event_code_dialog_terminating 902
#define tsip_event_code_dialog_terminated 903
#define tsip_event_code_stack_starting 950
#define tsip_event_code_stack_started 951
#define tsip_event_code_stack_stopping 952
#define tsip_event_code_stack_stopped 953
#define tsip_event_code_stack_failed_to_start 954
#define tsip_event_code_stack_failed_to_stop 955
#define tsip_event_code_stack_disconnected 956
typedef struct tsip_event_s {
TSK_DECLARE_OBJECT;
tsip_ssession_handle_t* ss;
short code;
char *phrase;
tsip_event_type_t type;
struct tsip_message_s *sipmessage;
//! copy of stack user data (needed by sessionless events)
const void* userdata;
}
tsip_event_t;
#define TSIP_DECLARE_EVENT tsip_event_t __sipevent__
TINYSIP_GEXTERN const tsk_object_def_t *tsip_event_def_t;
int tsip_event_init(tsip_event_t* self, tsip_ssession_t* ss, short code, const char *phrase, const struct tsip_message_s* sipmessage, tsip_event_type_t type);
int tsip_event_signal(tsip_event_type_t type, tsip_ssession_t* ss, short code, const char *phrase);
int tsip_event_signal_2(tsip_event_type_t type, tsip_ssession_t* ss, short code, const char *phrase, const struct tsip_message_s* sipmessage);
int tsip_event_deinit(tsip_event_t* self);
typedef int (*tsip_stack_callback_f)(const tsip_event_t *sipevent);
TSIP_END_DECLS
#endif /* TINYSIP_TSIP_EVENT_H */
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsip_event.h
* @brief SIP event.
*
* @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
*
*/
#ifndef TINYSIP_TSIP_EVENT_H
#define TINYSIP_TSIP_EVENT_H
#include "tinysip_config.h"
#include "tinysip/tsip_ssession.h"
TSIP_BEGIN_DECLS
#define TSIP_EVENT(self) ((tsip_event_t*)(self))
typedef enum tsip_event_type_e {
tsip_event_invite,
tsip_event_message,
tsip_event_info,
tsip_event_options,
tsip_event_publish,
tsip_event_register,
tsip_event_subscribe,