]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3686
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 15 Nov 2011 21:38:09 +0000 (15:38 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 15 Nov 2011 21:38:09 +0000 (15:38 -0600)
src/mod/endpoints/mod_sofia/sofia_glue.c

index ea6e2855e4c82ba64ee96a55bf35b89d498e281a..85d47882887cb26ae45c68a63c2ef84355f51f7f 100644 (file)
@@ -5429,13 +5429,18 @@ static int recover_callback(void *pArg, int argc, char **argv, char **columnName
                switch_channel_set_variable(channel, "sip_handle_full_from", switch_channel_get_variable(channel, "sip_full_from"));
                switch_channel_set_variable(channel, "sip_handle_full_to", switch_channel_get_variable(channel, "sip_full_to"));
        } else {
+               const char *rr;
 
                tech_pvt->redirected = switch_core_session_sprintf(session, "sip:%s", switch_channel_get_variable(channel, "sip_contact_uri"));
 
-               switch_channel_set_variable_printf(channel, "sip_invite_route_uri", "<sip:%s@%s:%s;lr>",
-                                                                                  switch_channel_get_variable(channel, "sip_from_user"),
-                                                                                  switch_channel_get_variable(channel, "sip_network_ip"), switch_channel_get_variable(channel, "sip_network_port")
-                                                                                  );
+               if ((rr = switch_channel_get_variable(channel, "sip_invite_record_route"))) {
+                       switch_channel_set_variable(channel, "sip_invite_route_uri", rr);
+               } else {
+                       switch_channel_set_variable_printf(channel, "sip_invite_route_uri", "<sip:%s@%s:%s;lr>",
+                                                                                          switch_channel_get_variable(channel, "sip_from_user"),
+                                                                                          switch_channel_get_variable(channel, "sip_network_ip"), switch_channel_get_variable(channel, "sip_network_port")
+                                                                                          );
+               }
 
                tech_pvt->dest = switch_core_session_sprintf(session, "sip:%s", switch_channel_get_variable(channel, "sip_from_uri"));