diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 47336a800a..35ca619cbd 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -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 diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index d5430cf1df..db259412b0 100755 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -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; diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index c3da16f072..1962fc0cff 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -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;