]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
set SFLAG_SENT_FINAL_MSG when going down in loop mode
authorMoises Silva <moy@sangoma.com>
Fri, 19 Feb 2010 22:43:29 +0000 (22:43 +0000)
committerMoises Silva <moy@sangoma.com>
Fri, 19 Feb 2010 22:43:29 +0000 (22:43 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@1039 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c

index ffecef279db998a02e01bb5d5c9756a151aafc15..b0953f2b4d699ac6c53d1d12fcda53fc7be1170e 100644 (file)
@@ -793,7 +793,6 @@ static void handle_call_loop_start(zap_span_t *span, sangomabc_connection_t *mco
        if (res != ZAP_SUCCESS) {
                zap_log(ZAP_LOG_CRIT, "yay, could not set the state of the channel to IN_LOOP, loop will fail\n");
                zap_channel_done(zchan);
-               /* FIXME: do we need to send an error? */
                return;
        }
        zap_channel_command(zchan, ZAP_COMMAND_ENABLE_LOOP, NULL);
@@ -809,10 +808,11 @@ static void handle_call_loop_stop(zap_span_t *span, sangomabc_connection_t *mcon
        }
        if (zchan->state != ZAP_CHANNEL_STATE_IN_LOOP) {
                zap_log(ZAP_LOG_ERROR, "Got stop loop request in a channel that is not in loop, ignoring ...\n");
-               /* FIXME: do we need to send an error? */
                return;
        }
        zap_channel_command(zchan, ZAP_COMMAND_DISABLE_LOOP, NULL);
+       /* even when we did not sent a msg we set this flag to avoid sending call stop in the DOWN state handler */
+       zap_set_flag(zchan, SFLAG_SENT_FINAL_MSG);
        zap_set_state_r(zchan, ZAP_CHANNEL_STATE_DOWN, 0, res);
 }