make outbound invites put transport param in contact when it's tcp

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6025 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-10-23 03:00:15 +00:00
parent 4ff84e46a5
commit 31a81a8b75
1 changed files with 18 additions and 2 deletions

View File

@ -560,13 +560,29 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
url = tech_pvt->dest;
}
if (switch_strlen_zero(tech_pvt->invite_contact)) {
tech_pvt->invite_contact = tech_pvt->profile->url;
}
if (switch_stristr("port=tcp", url)) {
char *tmp;
if (strchr(tech_pvt->invite_contact, ';')) {
tmp = switch_core_session_sprintf(session, "<%s&transport=tcp>", tech_pvt->invite_contact);
} else {
tmp = switch_core_session_sprintf(session, "<%s;transport=tcp>", tech_pvt->invite_contact);
}
assert(tmp);
tech_pvt->invite_contact = tmp;
}
tech_pvt->nh = nua_handle(tech_pvt->profile->nua, NULL,
NUTAG_URL(url),
SIPTAG_TO_STR(tech_pvt->dest_to),
TAG_IF(tech_pvt->gateway_from_str, SIPTAG_FROM_STR(tech_pvt->gateway_from_str)),
TAG_IF(!tech_pvt->gateway_from_str, SIPTAG_FROM_STR(tech_pvt->from_str)),
TAG_IF(tech_pvt->invite_contact, SIPTAG_CONTACT_STR(tech_pvt->invite_contact)),
TAG_IF(!tech_pvt->invite_contact, SIPTAG_CONTACT_STR(tech_pvt->profile->url)),
SIPTAG_CONTACT_STR(tech_pvt->invite_contact),
TAG_END());
switch_safe_free(d_url);