]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4191 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 7 May 2012 13:17:41 +0000 (08:17 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 7 May 2012 13:17:41 +0000 (08:17 -0500)
src/include/switch_types.h
src/mod/applications/mod_dptools/mod_dptools.c
src/switch_ivr_originate.c

index 47336a800a2ce896b0cf6a2bcc6918ea55ac73cd..35ca619cbd47ec610403c724999b68c46fe3645a 100644 (file)
@@ -1212,6 +1212,7 @@ typedef enum {
        CF_ZRTP_HASH,
        CF_ZRTP_PASS,
        CF_CHANNEL_SWAP,
+       CF_PICKUP,
        /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
        /* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */
        CF_FLAG_MAX
index d5430cf1dfe4a6f8cca449c782ff79cd3a94da31..db259412b0b593794782f4cfcc84da9630f658a2 100755 (executable)
@@ -3490,6 +3490,7 @@ static switch_call_cause_t pickup_outgoing_channel(switch_core_session_t *sessio
        switch_channel_set_name(nchannel, name);
        switch_channel_set_variable(nchannel, "process_cdr", "false");
        pickup_add_session(nsession, pickup);
+       switch_channel_set_flag(nchannel, CF_PICKUP);
        
        goto done;
 
index c3da16f07237b27e17bc716c333fbda7f9c2f026..1962fc0cffce31450499c03abe101610809c26c5 100644 (file)
@@ -429,6 +429,7 @@ static uint8_t check_channel_status(originate_global_t *oglobals, originate_stat
        char bug_key[256] = "";
        int send_ringback = 0;
        uint8_t ring_ready_val = 0;
+       int pickups = 0;
 
        oglobals->hups = 0;
        oglobals->idx = IDX_NADA;
@@ -462,6 +463,11 @@ static uint8_t check_channel_status(originate_global_t *oglobals, originate_stat
                        }
                }
 
+
+               if (originate_status[i].peer_channel && switch_channel_test_flag(originate_status[i].peer_channel, CF_PICKUP)) {
+                       pickups++;
+               }
+
                if (!(originate_status[i].peer_channel && originate_status[i].peer_session)) {
                        oglobals->hups++;
                        continue;
@@ -719,7 +725,7 @@ static uint8_t check_channel_status(originate_global_t *oglobals, originate_stat
                }
        }
 
-       if (oglobals->hups == len) {
+       if (oglobals->hups + pickups == len) {
                rval = 0;
        } else {
                rval = 1;