mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-08 08:51:50 +00:00
fix originate timeout issue
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8120 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
486fa9eb02
commit
eaf6abfb78
@ -68,6 +68,7 @@ static const switch_state_handler_table_t originate_state_handlers = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
IDX_TIMEOUT = -3,
|
||||||
IDX_CANCEL = -2,
|
IDX_CANCEL = -2,
|
||||||
IDX_NADA = -1
|
IDX_NADA = -1
|
||||||
} abort_t;
|
} abort_t;
|
||||||
@ -919,7 +920,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||||||
|
|
||||||
if ((switch_timestamp(NULL) - start) > (time_t) timelimit_sec) {
|
if ((switch_timestamp(NULL) - start) > (time_t) timelimit_sec) {
|
||||||
to++;
|
to++;
|
||||||
idx = IDX_CANCEL;
|
idx = IDX_TIMEOUT;
|
||||||
goto notready;
|
goto notready;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1039,7 +1040,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||||||
// 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) ((switch_timestamp(NULL) - start) >= (time_t) timelimit_sec))
|
if ((to = (uint8_t) ((switch_timestamp(NULL) - start) >= (time_t) timelimit_sec))
|
||||||
|| (fail_on_single_reject && hups)) {
|
|| (fail_on_single_reject && hups)) {
|
||||||
idx = IDX_CANCEL;
|
idx = IDX_TIMEOUT;
|
||||||
goto notready;
|
goto notready;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1136,19 +1137,17 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||||||
if (i != idx) {
|
if (i != idx) {
|
||||||
const char *holding = NULL;
|
const char *holding = NULL;
|
||||||
|
|
||||||
if (idx == IDX_CANCEL) {
|
if (idx == IDX_TIMEOUT || to) {
|
||||||
if (to) {
|
reason = SWITCH_CAUSE_NO_ANSWER;
|
||||||
reason = SWITCH_CAUSE_NO_ANSWER;
|
|
||||||
} else {
|
|
||||||
reason = SWITCH_CAUSE_ORIGINATOR_CANCEL;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (to) {
|
if (idx == IDX_CANCEL) {
|
||||||
reason = SWITCH_CAUSE_NO_ANSWER;
|
reason = SWITCH_CAUSE_ORIGINATOR_CANCEL;
|
||||||
} else if (and_argc > 1) {
|
|
||||||
reason = SWITCH_CAUSE_LOSE_RACE;
|
|
||||||
} else {
|
} else {
|
||||||
reason = SWITCH_CAUSE_NO_ANSWER;
|
if (and_argc > 1) {
|
||||||
|
reason = SWITCH_CAUSE_LOSE_RACE;
|
||||||
|
} else {
|
||||||
|
reason = SWITCH_CAUSE_NO_ANSWER;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user