[Asterisk-code-review] res_pjsip_session.c: Map empty extensions in INVITEs to s. (asterisk[master])

N A asteriskteam at digium.com
Sun Oct 16 19:35:33 CDT 2022


N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/19417 )


Change subject: res_pjsip_session.c: Map empty extensions in INVITEs to s.
......................................................................

res_pjsip_session.c: Map empty extensions in INVITEs to s.

Some SIP devices use an empty extension for PLAR functionality.

Rather than rejecting these empty extensions, we now use the s
extension for such calls to mirror the existing PLAR functionality
in Asterisk (e.g. chan_dahdi).

ASTERISK-30265 #close

Change-Id: I0861a405cd49bbbf532b52f7b47f0e2810832590
---
M res/res_pjsip_session.c
1 file changed, 19 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/17/19417/1

diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index fa3d813..af6395e 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -3690,8 +3690,9 @@
 		ao2_ref(pickup_cfg, -1);
 	}
 
+	/* Some SIP devices send an empty extension for PLAR: this should map to s, if it exists. */
 	if (!strcmp(session->exten, pickupexten) ||
-		ast_exists_extension(NULL, session->endpoint->context, session->exten, 1, NULL)) {
+		ast_exists_extension(NULL, session->endpoint->context, S_OR(session->exten, "s"), 1, NULL)) {
 		/*
 		 * Save off the INVITE Request-URI in case it is
 		 * needed: CHANNEL(pjsip,request_uri)

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I0861a405cd49bbbf532b52f7b47f0e2810832590
Gerrit-Change-Number: 19417
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221017/1db180ac/attachment.html>


More information about the asterisk-code-review mailing list