mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-15 08:29:45 +00:00
only hangup inbound calls in progress if they have been answered
This commit is contained in:
parent
d4232e548f
commit
40f29b3886
@ -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))) {
|
if ((session = switch_core_session_force_locate(modem->uuid_str))) {
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
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);
|
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
|
||||||
set_state = 0;
|
set_state = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user