]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Sat, 5 Jan 2008 14:58:26 +0000 (14:58 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sat, 5 Jan 2008 14:58:26 +0000 (14:58 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7094 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_originate.c

index 59bf0b3ea3d0db89869bf89e160f353c14e6e8ad..4a2b098adcc8faae902302be68703e99f4cf5dc9 100644 (file)
@@ -549,7 +549,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
        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;
@@ -627,6 +627,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                        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")) {
@@ -708,6 +710,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                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);
@@ -1108,6 +1114,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                                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];