]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: Allow call pickup to set the hangup cause. 43/1143/1
authorJoshua Colp <jcolp@digium.com>
Wed, 26 Aug 2015 10:40:32 +0000 (07:40 -0300)
committerJoshua Colp <jcolp@digium.com>
Wed, 26 Aug 2015 11:08:31 +0000 (06:08 -0500)
The call pickup implementation in chan_sip currently sets the channel
hangup cause to "normal clearing" if call pickup is successfully
performed. This action overwrites the "answered elsewhere" hangup cause
set by the call pickup code and can result in the SIP device in
question showing a missed call when it should not.

This change sets the hangup cause to "normal clearing" as a
default initially but allows the call pickup to change it as
needed.

ASTERISK-25346 #close

Change-Id: I00ac2c269cee9e29586ee2c65e83c70e52a02cff

channels/chan_sip.c

index 67b93536075673d0d0fc2f15dec1ad54e34ca614..a2695419a8ca75ecb3fd631bcc2f56b1db6698b2 100644 (file)
@@ -24434,10 +24434,9 @@ static void *sip_pickup_thread(void *stuff)
        struct ast_channel *chan;
        chan = stuff;
 
+       ast_channel_hangupcause_set(chan, AST_CAUSE_NORMAL_CLEARING);
        if (ast_pickup_call(chan)) {
                ast_channel_hangupcause_set(chan, AST_CAUSE_CALL_REJECTED);
-       } else {
-               ast_channel_hangupcause_set(chan, AST_CAUSE_NORMAL_CLEARING);
        }
        ast_hangup(chan);
        ast_channel_unref(chan);