]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fail the call with 502 bad gateway if the outbound leg returns a redirect with an...
authorWilliam King <william.king@quentustech.com>
Wed, 25 Mar 2015 19:44:40 +0000 (12:44 -0700)
committerWilliam King <william.king@quentustech.com>
Wed, 25 Mar 2015 19:46:59 +0000 (12:46 -0700)
FS-7385 #resolve

src/mod/endpoints/mod_sofia/sofia.c

index 7428a2d24200b236e4d46f7065a65b907d4f1221..f8ccbd6f675397b7a95866d889a0ea1e4671cca9 100644 (file)
@@ -6111,6 +6111,10 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
                                                        switch_ivr_session_transfer(a_session, p_contact->m_url->url_user, sip_redirect_dialplan, sip_redirect_context);
                                                }
                                                switch_channel_hangup(channel, SWITCH_CAUSE_REDIRECTION_TO_NEW_DESTINATION);
+                                       } else if( !p_contact->m_url->url_host ) {
+                                               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Received redirect with invalid URI\n");
+                                               switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "REDIRECT_ERROR");
+                                               switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
                                        } else if ((!strcmp(profile->sipip, p_contact->m_url->url_host))
                                                           || (profile->extsipip && !strcmp(profile->extsipip, p_contact->m_url->url_host))
                                                           || (switch_xml_locate_domain(p_contact->m_url->url_host, NULL, &root, &domain) == SWITCH_STATUS_SUCCESS)) {