]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3686
authorAnthony Minessale <anthm@freeswitch.org>
Sat, 19 Nov 2011 23:28:32 +0000 (17:28 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Sat, 19 Nov 2011 23:28:32 +0000 (17:28 -0600)
src/mod/endpoints/mod_sofia/sofia.c

index 12d8c5b4778b0ab8cddf0d9f033a229e6ed273f8..752754ccc3df7f41b267a262a954233311df5c38 100644 (file)
@@ -183,10 +183,12 @@ static void extract_header_vars(sofia_profile_t *profile, sip_t const *sip,
                        }
                }
 
-               if (sip->sip_contact) {
-                       char *c = sip_header_as_string(nh->nh_home, (void *) sip->sip_contact);
-                       switch_channel_set_variable(channel, "sip_recover_contact", c);
-                       su_free(nh->nh_home, c);
+               if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {
+                       if (sip->sip_contact) {
+                               char *c = sip_header_as_string(nh->nh_home, (void *) sip->sip_contact);
+                               switch_channel_set_variable(channel, "sip_recover_contact", c);
+                               su_free(nh->nh_home, c);
+                       }
                }
 
                if (sip->sip_record_route) {