Browse code

nathelper: don't fail if 'a=rtcp' has no IP

Examples from RFC3605:
> m=audio 49170 RTP/AVP 0
> a=rtcp:53020
>
> m=audio 49170 RTP/AVP 0
> a=rtcp:53020 IN IP4 126.16.64.4
>
> m=audio 49170 RTP/AVP 0
> a=rtcp:53020 IN IP6 2001:2345:6789:ABCD:EF01:2345:6789:ABCD

fix #2768

Victor Seva authored on 08/06/2021 13:03:21 • Victor Seva committed on 09/06/2021 09:23:41
Showing 1 changed files
... ...
@@ -1696,7 +1696,7 @@ static inline int replace_sdp_ip(
1696 1696
 		hasreplaced = 1;
1697 1697
 		body1 = body2;
1698 1698
 	}
1699
-	if(!hasreplaced) {
1699
+	if(!hasreplaced && memcmp("a=rtcp", line, 6) != 0) {
1700 1700
 		LM_ERR("can't extract '%s' IP from the SDP\n", line);
1701 1701
 		return -1;
1702 1702
 	}