]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
don't put casue from unanswered pickups as result of originate
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 12 Sep 2012 15:22:03 +0000 (10:22 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 12 Sep 2012 15:22:03 +0000 (10:22 -0500)
src/include/switch_types.h
src/switch_ivr_originate.c

index db9cf5cb0e92c1dc510814d51a312fa703c7d472..088050f86a65c3f5f34b624b1c634287794fa54f 100644 (file)
@@ -1747,7 +1747,8 @@ typedef enum {
        SWITCH_CAUSE_INVALID_GATEWAY = 608,
        SWITCH_CAUSE_GATEWAY_DOWN = 609,
        SWITCH_CAUSE_INVALID_URL = 610,
-       SWITCH_CAUSE_INVALID_PROFILE = 611
+       SWITCH_CAUSE_INVALID_PROFILE = 611,
+       SWITCH_CAUSE_NO_PICKUP = 612
 } switch_call_cause_t;
 
 typedef enum {
index ed2506a4f61064e74ab1344d79b310bc661bcf00..23e4f857a21e614e3b436e827c20cb1ca8975aeb 100644 (file)
@@ -781,11 +781,10 @@ static uint8_t check_channel_status(originate_global_t *oglobals, originate_stat
   end:
 
        if (rval == 0 && pickups) {
-               *force_reason = SWITCH_CAUSE_NO_ANSWER;
                for (i = 0; i < len; i++) {
                        if (originate_status[i].peer_channel && switch_channel_test_flag(originate_status[i].peer_channel, CF_PICKUP) && 
                                switch_channel_up(originate_status[i].peer_channel)) {
-                               switch_channel_hangup(originate_status[i].peer_channel, SWITCH_CAUSE_NO_ANSWER);
+                               switch_channel_hangup(originate_status[i].peer_channel, SWITCH_CAUSE_NO_PICKUP);
                        }
                }
        }
@@ -1632,7 +1631,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_enterprise_originate(switch_core_sess
                }
                switch_mutex_unlock(handles[i].mutex);
 
-               if (getcause && *cause != handles[i].cause && handles[i].cause != SWITCH_CAUSE_LOSE_RACE) {
+               if (getcause && *cause != handles[i].cause && handles[i].cause != SWITCH_CAUSE_LOSE_RACE && handles[i].cause != SWITCH_CAUSE_NO_PICKUP) {
                        *cause = handles[i].cause;
                        getcause++;
                }