Browse code

rtpproxy: removed unused replace_sdp_ip()

(cherry picked from commit b92f1ab7c711f7b61abadb706f9a4cfbb2cf0dd4)

Daniel-Constantin Mierla authored on 15/06/2021 07:58:31
Showing 1 changed files
... ...
@@ -939,54 +939,6 @@ isnulladdr(str *sx, int pf)
939 939
 #define	AOLDMEDPRT_LEN	(sizeof(AOLDMEDPRT) - 1)
940 940
 
941 941
 
942
-	static inline int
943
-replace_sdp_ip(struct sip_msg* msg, str *org_body, char *line, str *ip)
944
-{
945
-	str body1, oldip, newip;
946
-	str body = *org_body;
947
-	unsigned hasreplaced = 0;
948
-	int pf, pf1 = 0;
949
-	str body2;
950
-	char *bodylimit = body.s + body.len;
951
-
952
-	/* Iterate all lines and replace ips in them. */
953
-	if (!ip) {
954
-		newip.s = ip_addr2a(&msg->rcv.src_ip);
955
-		newip.len = strlen(newip.s);
956
-	} else {
957
-		newip = *ip;
958
-	}
959
-	body1 = body;
960
-	for(;;) {
961
-		if (rp_extract_mediaip(&body1, &oldip, &pf,line) == -1)
962
-			break;
963
-		if (pf != AF_INET) {
964
-			LM_ERR("not an IPv4 address in '%s' SDP\n",line);
965
-			return -1;
966
-		}
967
-		if (!pf1)
968
-			pf1 = pf;
969
-		else if (pf != pf1) {
970
-			LM_ERR("mismatching address families in '%s' SDP\n",line);
971
-			return -1;
972
-		}
973
-		body2.s = oldip.s + oldip.len;
974
-		body2.len = bodylimit - body2.s;
975
-		if (alter_mediaip(msg, &body1, &oldip, pf, &newip, pf,1) == -1) {
976
-			LM_ERR("can't alter '%s' IP\n",line);
977
-			return -1;
978
-		}
979
-		hasreplaced = 1;
980
-		body1 = body2;
981
-	}
982
-	if (!hasreplaced) {
983
-		LM_ERR("can't extract '%s' IP from the SDP\n",line);
984
-		return -1;
985
-	}
986
-
987
-	return 0;
988
-}
989
-
990 942
 	static int
991 943
 rp_extract_mediaip(str *body, str *mediaip, int *pf, char *line)
992 944
 {