Set route header as a var on channel like Diversion header

This commit is contained in:
Brian West 2011-01-11 12:25:41 -06:00
parent a9eb0aa6ef
commit d41e6498f1
1 changed files with 9 additions and 1 deletions

View File

@ -7098,7 +7098,15 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
/* Loop thru unknown Headers Here so we can do something with them */
for (un = sip->sip_unknown; un; un = un->un_next) {
if (!strncasecmp(un->un_name, "Diversion", 9)) {
if (!strncasecmp(un->un_name, "Route", 5)) {
if (!zstr(un->un_value)) {
char *tmp_name;
if ((tmp_name = switch_mprintf("%s%s", SOFIA_SIP_HEADER_PREFIX, un->un_name))) {
switch_channel_set_variable(channel, tmp_name, un->un_value);
free(tmp_name);
}
}
} else if (!strncasecmp(un->un_name, "Diversion", 9)) {
/* Basic Diversion Support for Diversion Indication in SIP */
/* draft-levy-sip-diversion-08 */
if (!zstr(un->un_value)) {