char *var_val, *vars = NULL;
const char *ringback_data = NULL;
switch_codec_t *read_codec = NULL;
- uint8_t sent_ring = 0, early_ok = 1;
+ uint8_t sent_ring = 0, early_ok = 1, return_ring_ready = 0;
switch_core_session_message_t *message = NULL;
switch_event_t *var_event = NULL;
uint8_t fail_on_single_reject = 0;
ok = 1;
} else if (!strcasecmp((char *)hi->name, "ignore_early_media")) {
ok = 1;
+ } else if (!strcasecmp((char *)hi->name, "return_ring_ready")) {
+ ok = 1;
} else if (!strcasecmp((char *)hi->name, "originate_retries")) {
ok = 1;
} else if (!strcasecmp((char *)hi->name, "originate_retry_sleep_ms")) {
early_ok = 0;
}
+ if ((var_val = switch_event_get_header(var_event, "return_ring_ready")) && switch_true(var_val)) {
+ return_ring_ready = 1;
+ }
+
if ((var_val = switch_event_get_header(var_event, "originate_retries")) && switch_true(var_val)) {
int32_t tmp;
tmp = atoi(var_val);
break;
}
+ if (ring_ready && return_ring_ready) {
+ status = SWITCH_STATUS_SUCCESS;
+ goto done;
+ }
+
if (ring_ready && read_frame && !pass) {
if (ringback.fh) {
uint8_t abuf[1024];