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

Joshua Colp asteriskteam at digium.com
Wed Aug 26 06:08:55 CDT 2015


Joshua Colp has uploaded a new change for review.

  https://gerrit.asterisk.org/1140

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(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/40/1140/1

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: newchange
Gerrit-Change-Id: I00ac2c269cee9e29586ee2c65e83c70e52a02cff
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list