From 3ebea4d7155f03bb8a3949ca2c1673596042461b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 15 Jun 2009 16:01:45 +0000 Subject: [PATCH] FSCORE-382 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13774 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/mod_sofia.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index ca7154cfde..3f3877b875 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -1395,10 +1395,14 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi sofia_set_flag_locked(tech_pvt, TFLAG_BYE); } } else if (code == 302 && !switch_strlen_zero(msg->string_arg)) { - char * p = strchr(msg->string_arg, ' '); - *p++ = '\0'; + char *p; + + if ((p = strchr(msg->string_arg, ' '))) { + *p = '\0'; + msg->string_arg = p; + } + msg->message_id = SWITCH_MESSAGE_INDICATE_REDIRECT; - msg->string_arg = p; switch_core_session_receive_message(session, msg); goto end_lock; } else {