From 7d8bd7ba89204d285bee546eff36847d063120ff Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Wed, 5 Mar 2008 22:39:22 +0000 Subject: [PATCH] tweak sdp handling git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7799 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c | 7 ++----- src/mod/endpoints/mod_sofia/mod_sofia.c | 8 ++++++++ src/mod/endpoints/mod_sofia/sofia.c | 4 ++++ src/mod/endpoints/mod_sofia/sofia_glue.c | 4 ++++ 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 61175beba3..85a1937479 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Fri Feb 15 10:57:26 EST 2008 +Wed Mar 5 17:21:10 EST 2008 diff --git a/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c b/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c index 22dc11a258..8f949661bd 100644 --- a/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c +++ b/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c @@ -565,7 +565,6 @@ static void print_media(sdp_printer_t *p, { char const *media, *proto; sdp_rtpmap_t *rm; - int print_rejected = 0; sdp_mode_t session_mode = sdp_sendrecv; @@ -594,13 +593,11 @@ static void print_media(sdp_printer_t *p, default: proto = m->m_proto_name; break; } - if (print_rejected || m->m_rtpmaps || m->m_format) { if (m->m_number_of_ports <= 1) sdp_printf(p, "m=%s %u %s", media, m->m_port, proto); else sdp_printf(p, "m=%s %u/%u %s", media, m->m_port, m->m_number_of_ports, proto); - } if (m->m_rtpmaps) { for (rm = m->m_rtpmaps; rm; rm = rm->rm_next) { @@ -615,13 +612,13 @@ static void print_media(sdp_printer_t *p, for (; l; l = l->l_next) sdp_printf(p, " %s", l->l_text); } - else if (print_rejected) { + else { sdp_printf(p, " 19"); /* SDP syntax requires at least one format. 19 is used by nobody, right?. */ } - if (print_rejected || m->m_rtpmaps || m->m_format) sdp_printf(p, CRLF); + sdp_printf(p, CRLF); if (m->m_information) print_information(p, m->m_information); diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index c75d4d2613..ed9b18ae31 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -394,6 +394,8 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session) NUTAG_SESSION_TIMER(session_timeout), SIPTAG_CONTACT_STR(tech_pvt->reply_contact), SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), + SOATAG_REUSE_REJECTED(1), + SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), TAG_END()); @@ -750,6 +752,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi nua_respond(tech_pvt->nh, SIP_200_OK, SIPTAG_CONTACT_STR(tech_pvt->reply_contact), SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), + SOATAG_REUSE_REJECTED(1), + SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), TAG_END()); @@ -990,6 +994,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi } nua_respond(tech_pvt->nh, code, reason, SIPTAG_CONTACT_STR(tech_pvt->reply_contact), SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), + SOATAG_REUSE_REJECTED(1), + SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), TAG_END()); @@ -1066,6 +1072,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi SIP_183_SESSION_PROGRESS, NUTAG_AUTOANSWER(0), SIPTAG_CONTACT_STR(tech_pvt->reply_contact), + SOATAG_REUSE_REJECTED(1), + SOATAG_ORDERED_USER(1), SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_AUDIO_AUX("cn telephone-event"), TAG_END()); } } diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index a496cb0404..aacda49019 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1735,6 +1735,8 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, 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_REUSE_REJECTED(1), + SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), TAG_END()); @@ -1802,6 +1804,8 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, nua_respond(tech_pvt->nh, SIP_200_OK, SIPTAG_CONTACT_STR(tech_pvt->reply_contact), SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), + SOATAG_REUSE_REJECTED(1), + SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), TAG_END()); diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index bd0062fa9a..770fa47c86 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -1072,6 +1072,8 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)), TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)), SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), + SOATAG_REUSE_REJECTED(1), + SOATAG_ORDERED_USER(1), SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE), SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL), TAG_IF(rep, SIPTAG_REPLACES_STR(rep)), SOATAG_HOLD(holdstr), TAG_END()); @@ -1108,6 +1110,8 @@ void sofia_glue_do_xfer_invite(switch_core_session_t *session) nua_invite(tech_pvt->nh2, SIPTAG_CONTACT_STR(tech_pvt->profile->url), SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), + SOATAG_REUSE_REJECTED(1), + SOATAG_ORDERED_USER(1), SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE), SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL), TAG_IF(rep, SIPTAG_REPLACES_STR(rep)), TAG_END()); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");