my preacious...
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4236 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
c40bed843a
commit
ebdbebc246
|
@ -2345,7 +2345,8 @@ static uint8_t check_channel_status(switch_channel_t **peer_channels,
|
||||||
uint32_t *hups,
|
uint32_t *hups,
|
||||||
char *file,
|
char *file,
|
||||||
char *key,
|
char *key,
|
||||||
uint8_t early_ok)
|
uint8_t early_ok,
|
||||||
|
uint8_t *ring_ready)
|
||||||
{
|
{
|
||||||
|
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
@ -2356,6 +2357,9 @@ static uint8_t check_channel_status(switch_channel_t **peer_channels,
|
||||||
if (!peer_channels[i]) {
|
if (!peer_channels[i]) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!*ring_ready && switch_channel_test_flag(peer_channels[i], CF_RING_READY)) {
|
||||||
|
*ring_ready = 1;
|
||||||
|
}
|
||||||
if (switch_channel_get_state(peer_channels[i]) >= CS_HANGUP) {
|
if (switch_channel_get_state(peer_channels[i]) >= CS_HANGUP) {
|
||||||
(*hups)++;
|
(*hups)++;
|
||||||
} else if ((switch_channel_test_flag(peer_channels[i], CF_ANSWERED) ||
|
} else if ((switch_channel_test_flag(peer_channels[i], CF_ANSWERED) ||
|
||||||
|
@ -2459,7 +2463,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
||||||
switch_core_session_message_t *message = NULL;
|
switch_core_session_message_t *message = NULL;
|
||||||
switch_event_t *var_event = NULL;
|
switch_event_t *var_event = NULL;
|
||||||
uint8_t fail_on_single_reject = 0;
|
uint8_t fail_on_single_reject = 0;
|
||||||
|
uint8_t ring_ready = 0;
|
||||||
write_frame.data = fdata;
|
write_frame.data = fdata;
|
||||||
|
|
||||||
*bleg = NULL;
|
*bleg = NULL;
|
||||||
|
@ -2853,7 +2857,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((!caller_channel || switch_channel_ready(caller_channel)) &&
|
while ((!caller_channel || switch_channel_ready(caller_channel)) &&
|
||||||
check_channel_status(peer_channels, peer_sessions, and_argc, &idx, &hups, file, key, early_ok)) {
|
check_channel_status(peer_channels, peer_sessions, and_argc, &idx, &hups, file, key, early_ok, &ring_ready)) {
|
||||||
|
|
||||||
// When the AND operator is being used, and fail_on_single_reject is set, a hangup indicates that the call should fail.
|
// When the AND operator is being used, and fail_on_single_reject is set, a hangup indicates that the call should fail.
|
||||||
if ((to = (uint8_t)((time(NULL) - start) >= (time_t)timelimit_sec)) || (fail_on_single_reject && hups)) {
|
if ((to = (uint8_t)((time(NULL) - start) >= (time_t)timelimit_sec)) || (fail_on_single_reject && hups)) {
|
||||||
|
@ -2881,9 +2885,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
||||||
if (!SWITCH_READ_ACCEPTABLE(status)) {
|
if (!SWITCH_READ_ACCEPTABLE(status)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_channel_test_flag(caller_channel, CF_RING_READY) &&
|
if (ring_ready && read_frame && !pass && !switch_test_flag(read_frame, SFF_CNG) && read_frame->datalen > 1) {
|
||||||
read_frame && !pass && !switch_test_flag(read_frame, SFF_CNG) && read_frame->datalen > 1) {
|
|
||||||
if (ringback.fh) {
|
if (ringback.fh) {
|
||||||
uint8_t abuf[1024];
|
uint8_t abuf[1024];
|
||||||
switch_size_t mlen, olen;
|
switch_size_t mlen, olen;
|
||||||
|
|
Loading…
Reference in New Issue