From e6ed009a36d410fc0cbac7a82d92313bd6d4c084 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 20 Aug 2015 14:58:19 +0200 Subject: mgcp: Begin to separate network and bts endpoints Make it possible to bind the call-agent to a specific IP address and the network and bts end to different ip addresses. Begin by clarifying which source ip address we want to have. --- openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'openbsc/src/osmo-bsc_nat') diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c index f04c9815a..f19cb4c97 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c @@ -269,7 +269,7 @@ static void bsc_mgcp_send_mdcx(struct bsc_connection *bsc, int port, struct mgcp "\r\n" "c=IN IP4 %s\r\n" "m=audio %d RTP/AVP 255\r\n", - port, bsc->nat->mgcp_cfg->source_addr, + port, mgcp_bts_src_addr(endp), endp->bts_end.local_port); if (len < 0) { LOGP(DMGCP, LOGL_ERROR, "snprintf for MDCX failed.\n"); @@ -550,7 +550,7 @@ static int bsc_mgcp_policy_cb(struct mgcp_trunk_config *tcfg, int endpoint, int /* we need to generate a new and patched message */ bsc_msg = bsc_mgcp_rewrite((char *) nat->mgcp_msg, nat->mgcp_length, - sccp->bsc_endp, nat->mgcp_cfg->source_addr, + sccp->bsc_endp, mgcp_bts_src_addr(mgcp_endp), mgcp_endp->bts_end.local_port, osmux_cid, &mgcp_endp->net_end.codec.payload_type, nat->sdp_ensure_amr_mode_set); @@ -745,7 +745,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), -1, - bsc->nat->mgcp_cfg->source_addr, + mgcp_net_src_addr(endp), endp->net_end.local_port, -1, &endp->bts_end.codec.payload_type, bsc->nat->sdp_ensure_amr_mode_set); -- cgit v1.2.3