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

Vitezslav Novy asteriskteam at digium.com
Wed Sep 6 05:25:30 CDT 2017


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


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/19/6419/1

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index b19c669..ee0eb67 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -13517,7 +13517,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/6419
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I533a047490c43dcff32eeca8378b2ba02345b64e
Gerrit-Change-Number: 6419
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/64b0a1aa/attachment-0001.html>


More information about the asterisk-code-review mailing list