[Asterisk-code-review] chan sip: Allow call pickup to set the hangup cause. (asterisk[11])

Mark Michelson asteriskteam at digium.com
Wed Aug 26 14:27:42 CDT 2015


Mark Michelson has submitted this change and it was merged.

Change subject: chan_sip: Allow call pickup to set the hangup cause.
......................................................................


chan_sip: Allow call pickup to set the hangup cause.

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
---
M channels/chan_sip.c
1 file changed, 1 insertion(+), 2 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, approved
  Anonymous Coward #1000019: Verified



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index cd2ba17..e03ed11 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -24499,10 +24499,9 @@
 	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);

-- 
To view, visit https://gerrit.asterisk.org/1140
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I00ac2c269cee9e29586ee2c65e83c70e52a02cff
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Michael L. Young <elgueromexicano at gmail.com>



More information about the asterisk-code-review mailing list