[Asterisk-code-review] res_pjsip_diversion: handle 181 (asterisk[16])

Torrey Searle asteriskteam at digium.com
Wed Jul 22 03:47:00 CDT 2020


Torrey Searle has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/14690 )


Change subject: res_pjsip_diversion: handle 181
......................................................................

res_pjsip_diversion: handle 181

Adapt arm the response handler so it can also receive 181.  In the
case 181 is received, also forward the 181 response.

ASTERISK-29001 #close

Change-Id: I73cfee46a8ca85371280ebdb38674f8fde7510df
---
M res/res_pjsip_diversion.c
1 file changed, 6 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/90/14690/1

diff --git a/res/res_pjsip_diversion.c b/res/res_pjsip_diversion.c
index 96a9069..eca6ee9 100644
--- a/res/res_pjsip_diversion.c
+++ b/res/res_pjsip_diversion.c
@@ -297,6 +297,11 @@
 
 	set_redirecting(session, div_hdr, contact_hdr ?	(pjsip_name_addr*)contact_hdr->uri :
 			(pjsip_name_addr*)PJSIP_MSG_FROM_HDR(rdata->msg_info.msg)->uri);
+
+	if (status.code == 181) {
+		ast_queue_control(session->channel, AST_CONTROL_REDIRECTING);
+	}
+
 }
 
 /*!
@@ -406,7 +411,7 @@
 	.incoming_response = diversion_incoming_response,
 	.outgoing_request = diversion_outgoing_request,
 	.outgoing_response = diversion_outgoing_response,
-	.response_priority = AST_SIP_SESSION_BEFORE_REDIRECTING,
+	.response_priority = AST_SIP_SESSION_BEFORE_REDIRECTING|AST_SIP_SESSION_BEFORE_MEDIA,
 };
 
 static int load_module(void)

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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I73cfee46a8ca85371280ebdb38674f8fde7510df
Gerrit-Change-Number: 14690
Gerrit-PatchSet: 1
Gerrit-Owner: Torrey Searle <tsearle at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200722/5db97f7e/attachment-0001.html>


More information about the asterisk-code-review mailing list