forked from Mirrors/freeswitch
tweak sdp handling
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7799 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
f4c94d962c
commit
7d8bd7ba89
@ -1 +1 @@
|
||||
Fri Feb 15 10:57:26 EST 2008
|
||||
Wed Mar 5 17:21:10 EST 2008
|
||||
|
@ -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);
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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());
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user