]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip.c Fix pickup on channel that are in AST_STATE_DOWN
authorMark Petersen <bugs.digium.com@zombie.dk>
Fri, 7 Jan 2022 10:01:27 +0000 (11:01 +0100)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Tue, 1 Feb 2022 14:13:44 +0000 (08:13 -0600)
resolve issue with pickup on device that uses "183" and not "180"

ASTERISK-29832

Change-Id: I4c7d223870f8ce9a7354e0f73d4e4cb2e8b58841

channels/chan_sip.c
doc/CHANGES-staging/chan_sip_pickup_AST_STATE_DOWN.txt [new file with mode: 0644]

index 07cef0d3a18df328d1253bfe3cf30478c4709ec3..cd1346f82da35180a811d22c1adb04b95eecdb3c 100644 (file)
@@ -26605,7 +26605,14 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, str
                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 (file)
index 0000000..e658faa
--- /dev/null
@@ -0,0 +1,3 @@
+Subject: chan_sip.c
+
+resolve issue with pickup on device that uses "183" and not "180"