Browse code

rtpproxy: removed unused rp_extract_mediaip()

- GH #2787

Daniel-Constantin Mierla authored on 26/06/2021 05:05:29
Showing 1 changed files
... ...
@@ -114,7 +114,6 @@ static str DEFAULT_RTPP_SET_ID_STR = str_init("0");
114 114
 #define	PTL_CPROTOVER	"20081102"
115 115
 
116 116
 #define	CPORT		"22222"
117
-static int rp_extract_mediaip(str *, str *, int *, char *);
118 117
 static int alter_mediaip(struct sip_msg *, str *, str *, int, str *, int, int);
119 118
 static int alter_mediaport(struct sip_msg *, str *, str *, str *, int);
120 119
 static int alter_rtcp(struct sip_msg *msg, str *body, str *oldport, str *newport);
... ...
@@ -939,61 +938,6 @@ isnulladdr(str *sx, int pf)
939 938
 #define	AOLDMEDPRT_LEN	(sizeof(AOLDMEDPRT) - 1)
940 939
 
941 940
 
942
-	static int
943
-rp_extract_mediaip(str *body, str *mediaip, int *pf, char *line)
944
-{
945
-	char *cp, *cp1;
946
-	int len, nextisip;
947
-
948
-	cp1 = NULL;
949
-	for (cp = body->s; (len = body->s + body->len - cp) > 0;) {
950
-		cp1 = ser_memmem(cp, line, len, 2);
951
-		if (cp1 == NULL || cp1[-1] == '\n' || cp1[-1] == '\r')
952
-			break;
953
-		cp = cp1 + 2;
954
-	}
955
-	if (cp1 == NULL)
956
-		return -1;
957
-
958
-	mediaip->s = cp1 + 2;
959
-	mediaip->len = eat_line(mediaip->s, body->s + body->len - mediaip->s)
960
-						- mediaip->s;
961
-	trim_len(mediaip->len, mediaip->s, *mediaip);
962
-
963
-	nextisip = 0;
964
-	for (cp = mediaip->s; cp < mediaip->s + mediaip->len;) {
965
-		len = eat_token_end(cp, mediaip->s + mediaip->len) - cp;
966
-		if (nextisip == 1) {
967
-			mediaip->s = cp;
968
-			mediaip->len = len;
969
-			nextisip++;
970
-			break;
971
-		}
972
-		if (len == 3 && memcmp(cp, "IP", 2) == 0) {
973
-			switch (cp[2]) {
974
-				case '4':
975
-					nextisip = 1;
976
-					*pf = AF_INET;
977
-					break;
978
-
979
-				case '6':
980
-					nextisip = 1;
981
-					*pf = AF_INET6;
982
-					break;
983
-
984
-				default:
985
-					break;
986
-			}
987
-		}
988
-		cp = eat_space_end(cp + len, mediaip->s + mediaip->len);
989
-	}
990
-	if (nextisip != 2 || mediaip->len == 0) {
991
-		LM_ERR("no `IP[4|6]' in `%s' field\n",line);
992
-		return -1;
993
-	}
994
-	return 1;
995
-}
996
-
997 941
 	static int
998 942
 alter_mediaip(struct sip_msg *msg, str *body, str *oldip, int oldpf,
999 943
 		str *newip, int newpf, int preserve)