]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
only hangup inbound calls in progress if they have been answered
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 13 Dec 2011 19:37:06 +0000 (13:37 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 13 Dec 2011 19:37:11 +0000 (13:37 -0600)
src/mod/applications/mod_spandsp/mod_spandsp_modem.c

index e8d6320631a247f0b01ffc67a44b334897835f17..97c27cd48efb3c1a1dcae7c87721a96a6099ac5b 100644 (file)
@@ -1068,7 +1068,8 @@ static int control_handler(modem_t *modem, const char *num, int op)
                                if ((session = switch_core_session_force_locate(modem->uuid_str))) {
                                        switch_channel_t *channel = switch_core_session_get_channel(session);
 
-                                       if (switch_channel_up(channel)) {
+                                       if (switch_channel_up(channel) && 
+                                               (switch_channel_test_flag(channel, CF_ANSWERED) || switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND)) {
                                                switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
                                                set_state = 0;
                                        }