From 8877d1d36d82fdc05acd3b45fe939ee16fa621ce Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 15 Nov 2011 15:38:09 -0600 Subject: [PATCH] FS-3686 --- src/mod/endpoints/mod_sofia/sofia_glue.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index ea6e2855e4..85d4788288 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -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", "", - 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", "", + 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"));