mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-05 15:10:09 +00:00
patch for SFSIP-104
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10544 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
085771a4cc
commit
958671cfbe
@ -367,6 +367,8 @@ struct sofia_profile {
|
|||||||
char *bindurl;
|
char *bindurl;
|
||||||
char *tls_url;
|
char *tls_url;
|
||||||
char *tls_bindurl;
|
char *tls_bindurl;
|
||||||
|
char *tcp_contact;
|
||||||
|
char *tls_contact;
|
||||||
char *sipdomain;
|
char *sipdomain;
|
||||||
char *timer_name;
|
char *timer_name;
|
||||||
char *hold_music;
|
char *hold_music;
|
||||||
|
@ -2071,6 +2071,10 @@ switch_status_t config_sofia(int reload, char *profile_name)
|
|||||||
profile->bindurl = profile->url;
|
profile->bindurl = profile->url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
profile->tcp_contact = switch_core_sprintf(profile->pool, "%s;transport=tcp", profile->url);
|
||||||
|
profile->tls_contact = switch_core_sprintf(profile->pool, "%s;transport=tls", profile->url);
|
||||||
|
|
||||||
|
|
||||||
if (profile->bind_params) {
|
if (profile->bind_params) {
|
||||||
char *bindurl = profile->bindurl;
|
char *bindurl = profile->bindurl;
|
||||||
profile->bindurl = switch_core_sprintf(profile->pool, "%s;%s", bindurl, profile->bind_params);
|
profile->bindurl = switch_core_sprintf(profile->pool, "%s;%s", bindurl, profile->bind_params);
|
||||||
|
@ -1540,6 +1540,7 @@ void sofia_presence_handle_sip_i_subscribe(int status,
|
|||||||
|
|
||||||
if (status < 200) {
|
if (status < 200) {
|
||||||
char *sticky = NULL;
|
char *sticky = NULL;
|
||||||
|
char *contact_str = profile->url;
|
||||||
|
|
||||||
if (is_nat) {
|
if (is_nat) {
|
||||||
char params[128] = "";
|
char params[128] = "";
|
||||||
@ -1556,8 +1557,15 @@ void sofia_presence_handle_sip_i_subscribe(int status,
|
|||||||
params);
|
params);
|
||||||
}
|
}
|
||||||
|
|
||||||
nua_respond(nh, SIP_202_ACCEPTED, NUTAG_WITH_THIS(nua), SIPTAG_SUBSCRIPTION_STATE_STR(sstr), TAG_IF(sticky, NUTAG_PROXY(sticky)),
|
if (switch_stristr("port=tcp", contact->m_url->url_params)) {
|
||||||
TAG_END());
|
contact_str = profile->tcp_contact;
|
||||||
|
} else if (switch_stristr("port=tls", contact->m_url->url_params)) {
|
||||||
|
contact_str = profile->tls_contact;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
nua_respond(nh, SIP_202_ACCEPTED, SIPTAG_CONTACT_STR(contact_str), NUTAG_WITH_THIS(nua), SIPTAG_SUBSCRIPTION_STATE_STR(sstr),
|
||||||
|
TAG_IF(sticky, NUTAG_PROXY(sticky)), TAG_END());
|
||||||
|
|
||||||
switch_safe_free(sticky);
|
switch_safe_free(sticky);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user