]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6141 --resolve mod_rayo - fixed X-headers on redirect and updated to satisfy recen...
authorChris Rienzo <chris@rienzo.com>
Wed, 29 Jan 2014 01:58:01 +0000 (20:58 -0500)
committerChris Rienzo <chris@rienzo.com>
Wed, 29 Jan 2014 01:58:01 +0000 (20:58 -0500)
src/mod/event_handlers/mod_rayo/mod_rayo.c

index 98331aac632cfa5b486d8004270151997365cb48..201ba267cdc2cc305dd986543ea12f0121d02f85 100644 (file)
@@ -1822,9 +1822,6 @@ static iks *on_rayo_redirect(struct rayo_actor *call, struct rayo_message *msg,
        if (zstr(redirect_to)) {
                response = iks_new_error_detailed(node, STANZA_ERROR_BAD_REQUEST, "Missing redirect to attrib");
        } else if (switch_channel_test_flag(channel, CF_ANSWERED)) {
-               /* rayo spec says this is not allowed */
-               response = iks_new_error_detailed(node, STANZA_ERROR_NOT_ALLOWED, "Answered call cannot be redirected");
-#if 0
                /* call is answered- must deflect */
                switch_core_session_message_t msg = { 0 };
                add_signaling_headers(session, redirect, RAYO_SIP_REQUEST_HEADER);
@@ -1833,7 +1830,6 @@ static iks *on_rayo_redirect(struct rayo_actor *call, struct rayo_message *msg,
                msg.message_id = SWITCH_MESSAGE_INDICATE_DEFLECT;
                switch_core_session_receive_message(session, &msg);
                response = iks_new_iq_result(node);
-#endif
        } else if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND) {
                /* Inbound call not answered - redirect */
                switch_core_session_message_t msg = { 0 };
@@ -1844,7 +1840,7 @@ static iks *on_rayo_redirect(struct rayo_actor *call, struct rayo_message *msg,
                switch_core_session_receive_message(session, &msg);
                response = iks_new_iq_result(node);
        } else {
-               response = iks_new_error_detailed(node, STANZA_ERROR_NOT_ALLOWED, "Outbound call cannot be redirected");
+               response = iks_new_error_detailed(node, STANZA_ERROR_UNEXPECTED_REQUEST, "Call must be answered");
        }
        return response;
 }