nat: Remove the CRCX value from the nat
Assume that if the MSC has assigned a timeslot/multiplex it will also be used for the MGCP. So we just assume that it was allocated on the BSC as well... in the worse case we will send a DLCX downstream but it should be fine.
This commit is contained in:
parent
c021fbe603
commit
39cd32e650
|
@ -83,7 +83,6 @@ struct sccp_connections {
|
||||||
* audio handling. Remember if we have ever send a CRCX,
|
* audio handling. Remember if we have ever send a CRCX,
|
||||||
* remember the endpoint used by the MSC and BSC.
|
* remember the endpoint used by the MSC and BSC.
|
||||||
*/
|
*/
|
||||||
int crcx;
|
|
||||||
int msc_endp;
|
int msc_endp;
|
||||||
int bsc_endp;
|
int bsc_endp;
|
||||||
|
|
||||||
|
|
|
@ -149,13 +149,12 @@ void bsc_mgcp_init(struct sccp_connections *con)
|
||||||
{
|
{
|
||||||
con->msc_endp = -1;
|
con->msc_endp = -1;
|
||||||
con->bsc_endp = -1;
|
con->bsc_endp = -1;
|
||||||
con->crcx = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void bsc_mgcp_dlcx(struct sccp_connections *con)
|
void bsc_mgcp_dlcx(struct sccp_connections *con)
|
||||||
{
|
{
|
||||||
/* send a DLCX down the stream */
|
/* send a DLCX down the stream */
|
||||||
if (con->bsc_endp != -1 && con->crcx) {
|
if (con->bsc_endp != -1) {
|
||||||
bsc_mgcp_send_dlcx(con->bsc, con->bsc_endp);
|
bsc_mgcp_send_dlcx(con->bsc, con->bsc_endp);
|
||||||
bsc_mgcp_free_endpoint(con->bsc->nat, con->msc_endp);
|
bsc_mgcp_free_endpoint(con->bsc->nat, con->msc_endp);
|
||||||
}
|
}
|
||||||
|
@ -253,7 +252,6 @@ 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 */
|
/* send the message and a fake MDCX to force sending of a dummy packet */
|
||||||
sccp->crcx = 1;
|
|
||||||
bsc_write(sccp->bsc, bsc_msg, NAT_IPAC_PROTO_MGCP);
|
bsc_write(sccp->bsc, bsc_msg, NAT_IPAC_PROTO_MGCP);
|
||||||
bsc_mgcp_send_mdcx(sccp->bsc, mgcp_endp);
|
bsc_mgcp_send_mdcx(sccp->bsc, mgcp_endp);
|
||||||
return MGCP_POLICY_DEFER;
|
return MGCP_POLICY_DEFER;
|
||||||
|
@ -288,7 +286,6 @@ static void free_chan_downstream(struct mgcp_endpoint *endp, struct bsc_endpoint
|
||||||
} else {
|
} else {
|
||||||
if (con->bsc == bsc) {
|
if (con->bsc == bsc) {
|
||||||
bsc_mgcp_send_dlcx(bsc, ENDPOINT_NUMBER(endp));
|
bsc_mgcp_send_dlcx(bsc, ENDPOINT_NUMBER(endp));
|
||||||
con->crcx = 0;
|
|
||||||
} else {
|
} else {
|
||||||
LOGP(DMGCP, LOGL_ERROR,
|
LOGP(DMGCP, LOGL_ERROR,
|
||||||
"Endpoint belongs to a different BSC\n");
|
"Endpoint belongs to a different BSC\n");
|
||||||
|
|
Loading…
Reference in New Issue