From 58ff219c856a4ad4648e4de06f90907d6964a251 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 5 Aug 2010 03:08:35 +0800 Subject: mgcp: Attempt to separate the RTP/RTCP port for the Network and for the BTS We plan to have two different ports for the network and for the BTS to avoid detecting the BTS and to dynamically allocate the port to have old data not go to a new socket. --- openbsc/src/nat/bsc_mgcp_utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'openbsc/src/nat/bsc_mgcp_utils.c') diff --git a/openbsc/src/nat/bsc_mgcp_utils.c b/openbsc/src/nat/bsc_mgcp_utils.c index d309ba213..e8f7e2461 100644 --- a/openbsc/src/nat/bsc_mgcp_utils.c +++ b/openbsc/src/nat/bsc_mgcp_utils.c @@ -121,7 +121,7 @@ static void bsc_mgcp_send_mdcx(struct bsc_connection *bsc, struct mgcp_endpoint "m=audio %d RTP/AVP 255\r\n", ENDPOINT_NUMBER(endp), bsc->nat->mgcp_cfg->source_addr, - endp->rtp_port); + endp->bts_end.local_port); if (len < 0) { LOGP(DMGCP, LOGL_ERROR, "snprintf for DLCX failed.\n"); return; @@ -229,7 +229,7 @@ int bsc_mgcp_policy_cb(struct mgcp_config *cfg, int endpoint, int state, const c /* we need to generate a new and patched message */ bsc_msg = bsc_mgcp_rewrite((char *) nat->mgcp_msg, nat->mgcp_length, - nat->mgcp_cfg->source_addr, mgcp_endp->rtp_port); + nat->mgcp_cfg->source_addr, mgcp_endp->bts_end.local_port); if (!bsc_msg) { LOGP(DMGCP, LOGL_ERROR, "Failed to patch the msg.\n"); return MGCP_POLICY_CONT; @@ -325,7 +325,7 @@ void bsc_mgcp_forward(struct bsc_connection *bsc, struct msgb *msg) * with the value of 0 should be no problem. */ output = bsc_mgcp_rewrite((char * ) msg->l2h, msgb_l2len(msg), - bsc->nat->mgcp_cfg->source_addr, endp->rtp_port); + bsc->nat->mgcp_cfg->source_addr, endp->net_end.local_port); if (!output) { LOGP(DMGCP, LOGL_ERROR, "Failed to rewrite MGCP msg.\n"); -- cgit v1.2.3