aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-22 20:12:13 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-22 20:12:13 +0800
commit5bd9493257ee3a43d36c0be5f23ac05a2459694b (patch)
treead75c8f33b63ddcdea10e4d5a65476d67684123a
parentc92fd5d9d3ced494b2ba3090af9a501726bde87b (diff)
nat: Only send DLCX when we have send a CRCX to the BSC on this endpoint
-rw-r--r--openbsc/include/openbsc/bsc_nat.h1
-rw-r--r--openbsc/src/nat/bsc_mgcp_utils.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index 6ef1f597..4d90ed74 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -112,6 +112,7 @@ struct sccp_connections {
struct sccp_source_reference remote_ref;
/* GSM audio handling. That is 32 * multiplex + ts */
+ int crcx;
int msc_timeslot;
int bsc_timeslot;
};
diff --git a/openbsc/src/nat/bsc_mgcp_utils.c b/openbsc/src/nat/bsc_mgcp_utils.c
index 79bd2a5d..6cb62645 100644
--- a/openbsc/src/nat/bsc_mgcp_utils.c
+++ b/openbsc/src/nat/bsc_mgcp_utils.c
@@ -147,12 +147,13 @@ void bsc_mgcp_init(struct sccp_connections *con)
{
con->msc_timeslot = -1;
con->bsc_timeslot = -1;
+ con->crcx = 0;
}
void bsc_mgcp_dlcx(struct sccp_connections *con)
{
/* send a DLCX down the stream */
- if (con->bsc_timeslot != -1) {
+ if (con->bsc_timeslot != -1 && con->crcx) {
int endp = mgcp_timeslot_to_endpoint(0, con->msc_timeslot);
bsc_mgcp_send_dlcx(con->bsc, endp);
bsc_mgcp_free_endpoint(con->bsc->nat, endp);
@@ -247,6 +248,7 @@ int bsc_mgcp_policy_cb(struct mgcp_config *cfg, int endpoint, int state, const c
}
/* send the message and a fake MDCX for force sending of a dummy packet */
+ sccp->crcx = 1;
bsc_write(sccp->bsc, bsc_msg, NAT_IPAC_PROTO_MGCP);
bsc_mgcp_send_mdcx(sccp->bsc, mgcp_endp);
return MGCP_POLICY_DEFER;