FS-9809: [mod_sofia] url encode caller id number before sticking it in the from header in case we have non url safe chars in the cid number in the caller profile

This commit is contained in:
Mike Jerris
2017-01-06 16:16:16 -06:00
parent c0423c5877
commit ad183fdea4
3 changed files with 61 additions and 1 deletions
+2 -1
View File
@@ -860,6 +860,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
if (!tech_pvt->from_str) {
const char *sipip;
const char *format;
char *use_cid_num = switch_core_session_url_encode(tech_pvt->session, cid_num);
sipip = tech_pvt->profile->sipip;
@@ -873,7 +874,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
format = strchr(sipip, ':') ? "\"%s\" <sip:%s%s[%s]>" : "\"%s\" <sip:%s%s%s>";
tech_pvt->from_str = switch_core_session_sprintf(tech_pvt->session, format, cid_name, cid_num, !zstr(cid_num) ? "@" : "", sipip);
tech_pvt->from_str = switch_core_session_sprintf(tech_pvt->session, format, cid_name, use_cid_num, !zstr(cid_num) ? "@" : "", sipip);
}
if (from_var) {