Enact the 'No device left behind' act. All stupid sip params that only help broken things *MUST* be prefixed with NDLB-

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5228 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-05-29 14:59:03 +00:00
parent f0b58efbac
commit db5ab42c12
4 changed files with 20 additions and 3 deletions
+10
View File
@@ -789,6 +789,10 @@ switch_status_t config_sofia(int reload, char *profile_name)
if (switch_true(val)) {
profile->pflags |= PFLAG_PRESENCE;
}
} else if (!strcasecmp(var, "NDLB-to-in-200-contact")) {
if (switch_true(val)) {
profile->ndlb |= PFLAG_NDLB_TO_IN_200_CONTACT;
}
} else if (!strcasecmp(var, "pass-rfc2833")) {
if (switch_true(val)) {
profile->pflags |= PFLAG_PASS_RFC2833;
@@ -1837,8 +1841,14 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
url_set_chanvars(session, sip->sip_to->a_url, sip_to);
if ((val = switch_channel_get_variable(channel, "sip_to_uri"))) {
tech_pvt->to_uri = switch_core_session_sprintf(session, "sip:%s", val);
if (profile->ndlb & PFLAG_NDLB_TO_IN_200_CONTACT) {
tech_pvt->reply_contact = tech_pvt->to_uri;
} else {
tech_pvt->reply_contact = tech_pvt->profile->url;
}
} else {
tech_pvt->to_uri = tech_pvt->profile->url;
tech_pvt->reply_contact = tech_pvt->profile->url;
}
}