add {instant_ringback=true} to make ringback not wait for indication to generate ringback

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11740 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-02-11 00:22:41 +00:00
parent a425e283ae
commit bcb20f7ab5
1 changed files with 8 additions and 1 deletions

View File

@ -97,6 +97,7 @@ typedef struct {
char key[80]; char key[80];
uint8_t early_ok; uint8_t early_ok;
uint8_t ring_ready; uint8_t ring_ready;
uint8_t instant_ringback;
uint8_t sent_ring; uint8_t sent_ring;
uint8_t progress; uint8_t progress;
uint8_t return_ring_ready; uint8_t return_ring_ready;
@ -1024,6 +1025,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
ok = 1; ok = 1;
} else if (!strcasecmp((char *) hi->name, "ring_ready")) { } else if (!strcasecmp((char *) hi->name, "ring_ready")) {
ok = 1; ok = 1;
} else if (!strcasecmp((char *) hi->name, "instant_ringback")) {
ok = 1;
} else if (!strcasecmp((char *) hi->name, "originate_retries")) { } else if (!strcasecmp((char *) hi->name, "originate_retries")) {
ok = 1; ok = 1;
} else if (!strcasecmp((char *) hi->name, "originate_timeout")) { } else if (!strcasecmp((char *) hi->name, "originate_timeout")) {
@ -1155,6 +1158,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
oglobals.ring_ready = 1; oglobals.ring_ready = 1;
} }
if ((var_val = switch_event_get_header(var_event, "instant_ringback")) && switch_true(var_val)) {
oglobals.instant_ringback = 1;
}
if ((var_val = switch_event_get_header(var_event, "originate_timeout"))) { if ((var_val = switch_event_get_header(var_event, "originate_timeout"))) {
int tmp = atoi(var_val); int tmp = atoi(var_val);
if (tmp > 0) { if (tmp > 0) {
@ -1762,7 +1769,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
read_frame = NULL; read_frame = NULL;
} }
if (oglobals.ring_ready && read_frame && !pass) { if ((oglobals.ring_ready || oglobals.instant_ringback) && read_frame && !pass) {
if (ringback.fh) { if (ringback.fh) {
switch_size_t mlen, olen; switch_size_t mlen, olen;
unsigned int pos = 0; unsigned int pos = 0;