Merge pull request #214 in FS/freeswitch from ~ARTURZ/freeswitch:FS-7344-ack-invite-3pcc-race to master

* commit '8ea99bfccfa85ef94b13693db6489aec3dca2c88':
  FS-7344: Fix race condition for INVITE right after ACK in 3PCC mode.
This commit is contained in:
Mike Jerris 2015-09-09 12:51:22 -05:00
commit bd1fad2e2c
3 changed files with 14 additions and 6 deletions

View File

@ -122,6 +122,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_
SWITCH_DECLARE(switch_status_t) switch_ivr_parse_next_event(switch_core_session_t *session); SWITCH_DECLARE(switch_status_t) switch_ivr_parse_next_event(switch_core_session_t *session);
SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_messages(switch_core_session_t *session); SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_messages(switch_core_session_t *session);
SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_signal_data(switch_core_session_t *session); SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_signal_data(switch_core_session_t *session);
SWITCH_DECLARE(switch_status_t) switch_ivr_parse_next_signal_data(switch_core_session_t *session);
SWITCH_DECLARE(switch_status_t) switch_ivr_process_indications(switch_core_session_t *session, switch_core_session_message_t *message); SWITCH_DECLARE(switch_status_t) switch_ivr_process_indications(switch_core_session_t *session, switch_core_session_message_t *message);
/*! /*!

View File

@ -2100,10 +2100,8 @@ SWITCH_DECLARE(int) switch_channel_state_change_pending(switch_channel_t *channe
SWITCH_DECLARE(int) switch_channel_check_signal(switch_channel_t *channel, switch_bool_t in_thread_only) SWITCH_DECLARE(int) switch_channel_check_signal(switch_channel_t *channel, switch_bool_t in_thread_only)
{ {
if (!in_thread_only || switch_core_session_in_thread(channel->session)) { (void)in_thread_only;
switch_ivr_parse_all_signal_data(channel->session); switch_ivr_parse_next_signal_data(channel->session);
}
return 0; return 0;
} }

View File

@ -820,7 +820,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_messages(switch_core_sessio
} }
SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_signal_data(switch_core_session_t *session) static switch_status_t switch_ivr_parse_signal_data(switch_core_session_t *session, switch_bool_t all)
{ {
void *data; void *data;
switch_core_session_message_t msg = { 0 }; switch_core_session_message_t msg = { 0 };
@ -847,7 +847,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_signal_data(switch_core_ses
switch_core_session_receive_message(session, &msg); switch_core_session_receive_message(session, &msg);
data = NULL; data = NULL;
if (!all)
break;
} }
switch_channel_clear_flag(channel, CF_SIGNAL_DATA); switch_channel_clear_flag(channel, CF_SIGNAL_DATA);
@ -855,6 +856,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_signal_data(switch_core_ses
return i ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; return i ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
} }
SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_signal_data(switch_core_session_t *session) {
return switch_ivr_parse_signal_data(session, SWITCH_TRUE);
}
SWITCH_DECLARE(switch_status_t) switch_ivr_parse_next_signal_data(switch_core_session_t *session) {
return switch_ivr_parse_signal_data(session, SWITCH_FALSE);
}
SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_t *session) SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_t *session)
{ {
int x = 0; int x = 0;