Blame opensips-0030-rtpproxy-revert-commit-ee2731212303eb7055b3bd165464f.patch

df8195
From: Ovidiu Sas <osas@voipembedded.com>
df8195
Date: Mon, 5 Feb 2018 15:58:20 -0500
df8195
Subject: [PATCH] rtpproxy: revert commit
df8195
 ee2731212303eb7055b3bd165464fe44fae05e7b  - add comments to better explain
df8195
 logic behind code
df8195
df8195
(cherry picked from commit ebbe49c50ce045a41b390198e3ee731450aaf600)
df8195
df8195
diff --git a/modules/rtpproxy/rtpproxy.c b/modules/rtpproxy/rtpproxy.c
df8195
index c68ba7251..945a89111 100644
df8195
--- a/modules/rtpproxy/rtpproxy.c
df8195
+++ b/modules/rtpproxy/rtpproxy.c
df8195
@@ -1898,7 +1898,11 @@ alter_mediaip(struct sip_msg *msg, str *body, str *oldip, int oldpf,
df8195
 	str omip, nip, oip;
df8195
 
df8195
 	/* check that updating media-ip is really necessary */
df8195
-	if (oldpf == newpf || isnulladdr(oldip, oldpf))
df8195
+	/* Conditions:
df8195
+	- same IP protocol format for received IP and new IP
df8195
+	- null IP received
df8195
+	*/
df8195
+	if (oldpf == newpf && isnulladdr(oldip, oldpf))
df8195
 		return 0;
df8195
 	if (newip->len == oldip->len &&
df8195
 	    memcmp(newip->s, oldip->s, newip->len) == 0)