]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
produce sip_full_via var
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 2 Feb 2012 21:09:25 +0000 (15:09 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 2 Feb 2012 21:09:32 +0000 (15:09 -0600)
src/mod/endpoints/mod_sofia/sofia.c

index 4634f9f9bdbc970386d2ab9d7441b3c1907dea8f..28d6008a867234a64e452f183176096a001b138d 100644 (file)
@@ -239,21 +239,25 @@ static void extract_header_vars(sofia_profile_t *profile, sip_t const *sip,
                        switch_stream_handle_t stream = { 0 };
                        int x = 0;
 
-                       if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {
-                               SWITCH_STANDARD_STREAM(stream);
+                       SWITCH_STANDARD_STREAM(stream);
                                
-                               for(vp = sip->sip_via; vp; vp = vp->v_next) {
-                                       char *v = sip_header_as_string(nh->nh_home, (void *) vp);
-                                       
-                                       stream.write_function(&stream, x == 0 ? "%s" : ",%s", v);
-                                       su_free(nh->nh_home, v);
-                                       
-                                       x++;
-                               }
+                       for(vp = sip->sip_via; vp; vp = vp->v_next) {
+                               char *v = sip_header_as_string(nh->nh_home, (void *) vp);
+                               
+                               stream.write_function(&stream, x == 0 ? "%s" : ",%s", v);
+                               su_free(nh->nh_home, v);
                                
+                               x++;
+                       }
+                       
+                       switch_channel_set_variable(channel, "sip_full_via", (char *)stream.data);
+
+                       if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {
                                switch_channel_set_variable(channel, "sip_recover_via", (char *)stream.data);
-                               free(stream.data);
                        }
+
+                       free(stream.data);
+                       
                }
                
                if (sip->sip_from) {