]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Route is not an un-named header its named. Handled like full_via and full_from and...
authorBrian West <brian@freeswitch.org>
Tue, 11 Jan 2011 19:41:50 +0000 (13:41 -0600)
committerBrian West <brian@freeswitch.org>
Tue, 11 Jan 2011 19:41:50 +0000 (13:41 -0600)
src/mod/endpoints/mod_sofia/sofia.c

index 9145d2a2e71e95e544fa255480e40f4b5f191727..904f3ecb465575decac8c41a55e69d5e76263edf 100644 (file)
@@ -161,6 +161,15 @@ static void extract_header_vars(sofia_profile_t *profile, sip_t const *sip, swit
        char *full;
 
        if (sip) {
+               if (sip->sip_route) {
+                       if ((full = sip_header_as_string(profile->home, (void *) sip->sip_route))) {
+                               const char *v = switch_channel_get_variable(channel, "sip_full_route");
+                               if (!v) { 
+                                       switch_channel_set_variable(channel, "sip_full_route", full);
+                               }
+                               su_free(profile->home, full);
+                       }
+               }
                if (sip->sip_via) {
                        if ((full = sip_header_as_string(profile->home, (void *) sip->sip_via))) {
                                const char *v = switch_channel_get_variable(channel, "sip_full_via");
@@ -7098,15 +7107,7 @@ 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, "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)) {
+                       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)) {