Module: kamailio
Branch: master
Commit: 14d92c0d7ab1229996176b131ab8edcabc3a5717
URL:
https://github.com/kamailio/kamailio/commit/14d92c0d7ab1229996176b131ab8edc…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-06-26T07:05:29+02:00
rtpproxy: removed unused rp_extract_mediaip()
- GH #2787
---
Modified: src/modules/rtpproxy/rtpproxy.c
---
Diff:
https://github.com/kamailio/kamailio/commit/14d92c0d7ab1229996176b131ab8edc…
Patch:
https://github.com/kamailio/kamailio/commit/14d92c0d7ab1229996176b131ab8edc…
---
diff --git a/src/modules/rtpproxy/rtpproxy.c b/src/modules/rtpproxy/rtpproxy.c
index 733ea3cec8..bd2eb5368d 100644
--- a/src/modules/rtpproxy/rtpproxy.c
+++ b/src/modules/rtpproxy/rtpproxy.c
@@ -114,7 +114,6 @@ static str DEFAULT_RTPP_SET_ID_STR = str_init("0");
#define PTL_CPROTOVER "20081102"
#define CPORT "22222"
-static int rp_extract_mediaip(str *, str *, int *, char *);
static int alter_mediaip(struct sip_msg *, str *, str *, int, str *, int, int);
static int alter_mediaport(struct sip_msg *, str *, str *, str *, int);
static int alter_rtcp(struct sip_msg *msg, str *body, str *oldport, str *newport);
@@ -939,61 +938,6 @@ isnulladdr(str *sx, int pf)
#define AOLDMEDPRT_LEN (sizeof(AOLDMEDPRT) - 1)
- static int
-rp_extract_mediaip(str *body, str *mediaip, int *pf, char *line)
-{
- char *cp, *cp1;
- int len, nextisip;
-
- cp1 = NULL;
- for (cp = body->s; (len = body->s + body->len - cp) > 0;) {
- cp1 = ser_memmem(cp, line, len, 2);
- if (cp1 == NULL || cp1[-1] == '\n' || cp1[-1] == '\r')
- break;
- cp = cp1 + 2;
- }
- if (cp1 == NULL)
- return -1;
-
- mediaip->s = cp1 + 2;
- mediaip->len = eat_line(mediaip->s, body->s + body->len - mediaip->s)
- - mediaip->s;
- trim_len(mediaip->len, mediaip->s, *mediaip);
-
- nextisip = 0;
- for (cp = mediaip->s; cp < mediaip->s + mediaip->len;) {
- len = eat_token_end(cp, mediaip->s + mediaip->len) - cp;
- if (nextisip == 1) {
- mediaip->s = cp;
- mediaip->len = len;
- nextisip++;
- break;
- }
- if (len == 3 && memcmp(cp, "IP", 2) == 0) {
- switch (cp[2]) {
- case '4':
- nextisip = 1;
- *pf = AF_INET;
- break;
-
- case '6':
- nextisip = 1;
- *pf = AF_INET6;
- break;
-
- default:
- break;
- }
- }
- cp = eat_space_end(cp + len, mediaip->s + mediaip->len);
- }
- if (nextisip != 2 || mediaip->len == 0) {
- LM_ERR("no `IP[4|6]' in `%s' field\n",line);
- return -1;
- }
- return 1;
-}
-
static int
alter_mediaip(struct sip_msg *msg, str *body, str *oldip, int oldpf,
str *newip, int newpf, int preserve)