]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add {instant_ringback=true} to make ringback not wait for indication to generate...
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 11 Feb 2009 00:22:41 +0000 (00:22 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 11 Feb 2009 00:22:41 +0000 (00:22 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11740 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_originate.c

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