From 601180f2d93e56757a02a2b2161a73ce6a99e8b8 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 29 Aug 2010 23:40:33 +0800 Subject: nat: Send the right MDCX down the stream --- openbsc/src/nat/bsc_mgcp_utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openbsc/src/nat/bsc_mgcp_utils.c b/openbsc/src/nat/bsc_mgcp_utils.c index 12124aff2..b71ec9482 100644 --- a/openbsc/src/nat/bsc_mgcp_utils.c +++ b/openbsc/src/nat/bsc_mgcp_utils.c @@ -148,7 +148,7 @@ void bsc_mgcp_free_endpoints(struct bsc_nat *nat) } /* send a MDCX where we do not want a response */ -static void bsc_mgcp_send_mdcx(struct bsc_connection *bsc, struct mgcp_endpoint *endp) +static void bsc_mgcp_send_mdcx(struct bsc_connection *bsc, int port, struct mgcp_endpoint *endp) { char buf[2096]; int len; @@ -159,7 +159,7 @@ static void bsc_mgcp_send_mdcx(struct bsc_connection *bsc, struct mgcp_endpoint "\r\n" "c=IN IP4 %s\r\n" "m=audio %d RTP/AVP 255\r\n", - ENDPOINT_NUMBER(endp), + port, bsc->nat->mgcp_cfg->source_addr, endp->bts_end.local_port); if (len < 0) { @@ -292,7 +292,7 @@ int bsc_mgcp_policy_cb(struct mgcp_config *cfg, int endpoint, int state, const c /* send the message and a fake MDCX to force sending of a dummy packet */ bsc_write(sccp->bsc, bsc_msg, NAT_IPAC_PROTO_MGCP); - bsc_mgcp_send_mdcx(sccp->bsc, mgcp_endp); + bsc_mgcp_send_mdcx(sccp->bsc, sccp->bsc_endp, mgcp_endp); return MGCP_POLICY_DEFER; } else if (state == MGCP_ENDP_DLCX) { /* we will free the endpoint now and send a DLCX to the BSC */ -- cgit v1.2.3