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.
diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
index f04c981..f19cb4c 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 @@
"\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 @@
/* 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 @@
* 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);