[commit] r5814 - freeswitch/trunk/src/mod/endpoints/mod_sofia
Author: anthm Date: Fri Oct 5 11:47:48 2007 New Revision: 5814 Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Log: now support 3pcc Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h Fri Oct 5 11:47:48 2007 @@ -41,6 +41,7 @@ #define HAVE_APR #include <switch.h> +#include <switch_version.h> #ifdef SWITCH_HAVE_ODBC #include <switch_odbc.h> #endif @@ -64,7 +65,7 @@ #define MY_EVENT_EXPIRE "sofia::expire" #define MULTICAST_EVENT "multicast::event" #define SOFIA_REPLACES_HEADER "_sofia_replaces_" -#define SOFIA_USER_AGENT "FreeSWITCH(mod_sofia)" +#define SOFIA_USER_AGENT "FreeSWITCH-" SWITCH_VERSION_FULL "-mod_sofia" #define SOFIA_CHAT_PROTO "sip" #define SOFIA_SIP_HEADER_PREFIX "sip_h_" #define SOFIA_SIP_HEADER_PREFIX_T "~sip_h_" Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Fri Oct 5 11:47:48 2007 @@ -1199,10 +1199,9 @@ goto done; } else { switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "RECEIVED_NOSDP"); - switch_set_flag(tech_pvt, TFLAG_LATE_NEGOTIATION); sofia_glue_tech_choose_port(tech_pvt); sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); - + switch_channel_set_state(channel, CS_HIBERNATE); nua_respond(tech_pvt->nh, SIP_200_OK, SIPTAG_CONTACT_STR(tech_pvt->profile->url), SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), TAG_END()); @@ -1332,6 +1331,10 @@ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "RTP Error!\n"); switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); } + if (switch_channel_get_state(channel) == CS_HIBERNATE) { + switch_set_flag_locked(tech_pvt, TFLAG_READY); + switch_channel_set_state(channel, CS_INIT); + } goto done; } } Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Fri Oct 5 11:47:48 2007 @@ -1016,11 +1016,14 @@ switch_status_t sofia_glue_tech_media(private_object_t *tech_pvt, char *r_sdp) { - sdp_parser_t *parser = sdp_parse(NULL, r_sdp, (int) strlen(r_sdp), 0); + sdp_parser_t *parser = NULL; sdp_session_t *sdp; uint8_t match = 0; assert(tech_pvt != NULL); + assert(r_sdp != NULL); + + parser = sdp_parse(NULL, r_sdp, (int) strlen(r_sdp), 0); if (switch_strlen_zero(r_sdp)) { return SWITCH_STATUS_FALSE;
participants (1)
-
Freeswitch SVN