don't parse signals in the set_running_state function to avoid livelock situation
This commit is contained in:
parent
6dd1264d08
commit
fba22dc7e9
|
@ -87,6 +87,10 @@ SWITCH_DECLARE(int) switch_channel_test_ready(switch_channel_t *channel, switch_
|
|||
|
||||
#define switch_channel_up(_channel) (switch_channel_check_signal(_channel, SWITCH_TRUE) || switch_channel_get_state(_channel) < CS_HANGUP)
|
||||
#define switch_channel_down(_channel) (switch_channel_check_signal(_channel, SWITCH_TRUE) || switch_channel_get_state(_channel) >= CS_HANGUP)
|
||||
|
||||
#define switch_channel_up_nosig(_channel) switch_channel_get_state(_channel) < CS_HANGUP
|
||||
#define switch_channel_down_nosig(_channel) switch_channel_get_state(_channel) >= CS_HANGUP
|
||||
|
||||
#define switch_channel_media_ack(_channel) (!switch_channel_test_cap(_channel, CC_MEDIA_ACK) || switch_channel_test_flag(_channel, CF_MEDIA_ACK))
|
||||
|
||||
SWITCH_DECLARE(void) switch_channel_wait_for_state(switch_channel_t *channel, switch_channel_t *other_channel, switch_channel_state_t want_state);
|
||||
|
|
|
@ -1860,7 +1860,7 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_running_state(
|
|||
switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND ||
|
||||
switch_channel_test_flag(channel, CF_DIALPLAN) ? "true" : "false");
|
||||
|
||||
if (switch_channel_down(channel)) {
|
||||
if (switch_channel_down_nosig(channel)) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Answer-State", "hangup");
|
||||
} else if (switch_channel_test_flag(channel, CF_ANSWERED)) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Answer-State", "answered");
|
||||
|
@ -2150,7 +2150,7 @@ SWITCH_DECLARE(void) switch_channel_event_set_basic_data(switch_channel_t *chann
|
|||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Call-UUID", switch_core_session_get_uuid(channel->session));
|
||||
}
|
||||
|
||||
if (switch_channel_down(channel)) {
|
||||
if (switch_channel_down_nosig(channel)) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Answer-State", "hangup");
|
||||
} else if (switch_channel_test_flag(channel, CF_ANSWERED)) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Answer-State", "answered");
|
||||
|
|
Loading…
Reference in New Issue