[Asterisk-code-review] chan sip: Do not change IP address in SDP origin line (o=) i... (asterisk[15])

Vitezslav Novy asteriskteam at digium.com
Wed Sep 6 05:29:56 CDT 2017


Vitezslav Novy has uploaded this change for review. ( https://gerrit.asterisk.org/6421


Change subject: chan_sip: Do not change IP address in SDP origin line (o=) in SIP reINVITE
......................................................................

chan_sip: Do not change IP address in SDP origin line (o=) in SIP reINVITE

If directmedia=yes is configured, when call is answered, asterisk sends reINVITE
to both parties to set up media path directly between the endpoints.
In this reINVITE msg SDP origin line (o=) contains IP address of endpoint
instead of IP of asterisk. This behavior violates RFC3264, sec 8:
"When issuing an offer that modifies the session,
the "o=" line of the new SDP MUST be identical to that in the
previous SDP, except that the version in the origin field MUST
increment by one from the previous SDP."
This patch assures IP address of astrisk is always sent in
SDP origin line.

ASTERISK-17540
Reported by:  saghul

Change-Id: I533a047490c43dcff32eeca8378b2ba02345b64e
---
M channels/chan_sip.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/21/6421/1

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index beaa3de..798fe56 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -13531,7 +13531,7 @@
 		 p->sessionid, p->sessionversion,
 		 (ast_sockaddr_is_ipv6(&dest) && !ast_sockaddr_is_ipv4_mapped(&dest)) ?
 			"IP6" : "IP4",
-		 ast_sockaddr_stringify_addr_remote(&dest));
+		 ast_sockaddr_stringify_addr_remote(&p->ourip));
 
 	snprintf(connection, sizeof(connection), "c=IN %s %s\r\n",
 		 (ast_sockaddr_is_ipv6(&dest) && !ast_sockaddr_is_ipv4_mapped(&dest)) ?

-- 
To view, visit https://gerrit.asterisk.org/6421
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: I533a047490c43dcff32eeca8378b2ba02345b64e
Gerrit-Change-Number: 6421
Gerrit-PatchSet: 1
Gerrit-Owner: Vitezslav Novy <a1 at vnovy.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170906/063839bb/attachment.html>


More information about the asterisk-code-review mailing list