Revert "nat: Remember where the BTS is listening for things."
Remove the code to parse port as we need to discover the
BTS behind the nat and most likely it will have a different
port than the one advertised by the BTS.
This reverts commit c6a1fe773d16eb20d4cb1d3097761419436f4537.
diff --git a/openbsc/src/nat/bsc_mgcp_utils.c b/openbsc/src/nat/bsc_mgcp_utils.c
index 6fc5eac..ffdc3ed 100644
--- a/openbsc/src/nat/bsc_mgcp_utils.c
+++ b/openbsc/src/nat/bsc_mgcp_utils.c
@@ -186,7 +186,7 @@
struct msgb *output;
struct bsc_endpoint *bsc_endp = NULL;
struct mgcp_endpoint *endp = NULL;
- int i, code, port;
+ int i, code;
char transaction_id[60];
/* Some assumption that our buffer is big enough.. and null terminate */
@@ -228,9 +228,6 @@
/* make it point to our endpoint */
endp->ci = bsc_mgcp_extract_ci((const char *) msg->l2h);
- port = bsc_mgcp_extract_port((const char *) msg->l2h);
- endp->bts_rtp = htons(port);
- endp->bts_rtcp = htons(port + 1);
output = bsc_mgcp_rewrite((char * ) msg->l2h, msgb_l2len(msg),
bsc->nat->mgcp_cfg->source_addr, endp->rtp_port);
@@ -269,18 +266,6 @@
return ci;
}
-int bsc_mgcp_extract_port(const char *str)
-{
- int port;
- char *res = strstr(str, "m=audio ");
- if (!res)
- return 0;
-
- if (sscanf(res, "m=audio %d RTP/AVP %*d", &port) != 1)
- return 0;
- return port;
-}
-
/* we need to replace some strings... */
struct msgb *bsc_mgcp_rewrite(char *input, int length, const char *ip, int port)
{