[Asterisk-code-review] chan_sip: SIP route header is missing on UPDATE (asterisk[16])

Mark Petersen asteriskteam at digium.com
Mon Mar 7 08:14:01 CST 2022


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


Change subject: chan_sip: SIP route header is missing on UPDATE
......................................................................

chan_sip: SIP route header is missing on UPDATE

if Asterisk need to send an UPDATE before answer
on a channel that uses Record-Route:
it will not include a Route header

ASTERISK-29955

Change-Id: Id1920ecbfea7739a038b14dc94487ecfe7b57eef
---
M channels/chan_sip.c
1 file changed, 5 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/89/18189/1

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index cd1346f..0cad810 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -12441,9 +12441,8 @@
 	 * Send UPDATE to the same destination as CANCEL, if call is not in final state.
 	 */
 	if (!sip_route_empty(&p->route) &&
-			!(sipmethod == SIP_CANCEL ||
-				(sipmethod == SIP_ACK && (p->invitestate == INV_COMPLETED || p->invitestate == INV_CANCELLED)) ||
-				(sipmethod == SIP_UPDATE && (p->invitestate == INV_PROCEEDING || p->invitestate == INV_EARLY_MEDIA)))) {
+		!(sipmethod == SIP_CANCEL ||
+			(sipmethod == SIP_ACK && (p->invitestate == INV_COMPLETED || p->invitestate == INV_CANCELLED)))) { 
 		if (p->socket.type != AST_TRANSPORT_UDP && p->socket.tcptls_session) {
 			/* For TCP/TLS sockets that are connected we won't need
 			 * to do any hostname/IP lookups */
@@ -12451,6 +12450,9 @@
 			/* For NATed traffic, we ignore the contact/route and
 			 * simply send to the received-from address. No need
 			 * for lookups. */
+		} else if (sipmethod == SIP_UPDATE && (p->invitestate == INV_PROCEEDING || p->invitestate == INV_EARLY_MEDIA)) {
+			/* set_destination on UPDATE in early dialog,
+			 * mangles eventually later CANCEL according to ASTERISK-24628 */
 		} else {
 			set_destination(p, sip_route_first_uri(&p->route));
 		}

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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Id1920ecbfea7739a038b14dc94487ecfe7b57eef
Gerrit-Change-Number: 18189
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/20220307/5e31277e/attachment-0001.html>


More information about the asterisk-code-review mailing list