[Asterisk-code-review] chan_sip.c Fix pickup on channel that are in AST_STATE_DOWN (asterisk[master])

Mark Petersen asteriskteam at digium.com
Mon Jan 31 09:50:32 CST 2022


Mark Petersen has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/17966 )


Change subject: chan_sip.c Fix pickup on channel that are in AST_STATE_DOWN
......................................................................

chan_sip.c Fix pickup on channel that are in AST_STATE_DOWN

resolve issue with pickup on device that uses "183" and not "180"

ASTERISK-29832

Change-Id: I4c7d223870f8ce9a7354e0f73d4e4cb2e8b58841
---
M channels/chan_sip.c
A doc/CHANGES-staging/chan_sip_pickup_AST_STATE_DOWN.txt
2 files changed, 11 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/66/17966/1

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index e19e19d..b6aff80 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -26607,7 +26607,14 @@
 		if (!error && ast_strlen_zero(pickup.exten) &&
 				ast_channel_state(replaces_chan) != AST_STATE_RINGING &&
 				ast_channel_state(replaces_chan) != AST_STATE_RING &&
-				ast_channel_state(replaces_chan) != AST_STATE_UP) {
+				ast_channel_state(replaces_chan) != AST_STATE_UP &&
+				/*
+				* Check the down state as well because some SIP devices do not
+				* give 180 ringing when they can just give 183 session progress
+				* instead. same fix the one in ast_can_pickup
+				* git show 0a8f9d2cf08
+				*/
+				ast_channel_state(replaces_chan) != AST_STATE_DOWN) {
 			ast_log(LOG_NOTICE, "Supervised transfer attempted to replace non-ringing or active call id (%s)!\n", replace_id);
 			transmit_response_reliable(p, "603 Declined (Replaces)", req);
 			error = 1;
diff --git a/doc/CHANGES-staging/chan_sip_pickup_AST_STATE_DOWN.txt b/doc/CHANGES-staging/chan_sip_pickup_AST_STATE_DOWN.txt
new file mode 100644
index 0000000..e658faa
--- /dev/null
+++ b/doc/CHANGES-staging/chan_sip_pickup_AST_STATE_DOWN.txt
@@ -0,0 +1,3 @@
+Subject: chan_sip.c
+
+resolve issue with pickup on device that uses "183" and not "180"

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/17966
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I4c7d223870f8ce9a7354e0f73d4e4cb2e8b58841
Gerrit-Change-Number: 17966
Gerrit-PatchSet: 1
Gerrit-Owner: Mark Petersen <bugs.digium.com at zombie.dk>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220131/c2ada9cd/attachment.html>


More information about the asterisk-code-review mailing list