freetdm: allow setting the sig status in alarmed channels (bugzilla 6441)
This commit is contained in:
parent
9257b74953
commit
4c6789b364
|
@ -2534,20 +2534,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_set_sig_status(ftdm_channel_t *fchan, ftd
|
|||
|
||||
ftdm_channel_lock(fchan);
|
||||
|
||||
if (ftdm_test_flag(fchan, FTDM_CHANNEL_IN_ALARM)) {
|
||||
ftdm_log_chan_msg(fchan, FTDM_LOG_WARNING, "You can not set the signaling status of an alarmed channel\n");
|
||||
res = FTDM_EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (sigstatus == FTDM_SIG_STATE_DOWN) {
|
||||
ftdm_log_chan_msg(fchan, FTDM_LOG_WARNING, "You can not set the signaling status to DOWN, valid states are UP or SUSPENDED\n");
|
||||
res = FTDM_EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
res = fchan->span->set_channel_sig_status(fchan, sigstatus);
|
||||
done:
|
||||
|
||||
ftdm_channel_unlock(fchan);
|
||||
|
||||
|
|
|
@ -519,6 +519,28 @@ static FIO_CHANNEL_SET_SIG_STATUS_FUNCTION(ftdm_r2_set_channel_sig_status)
|
|||
openr2_chan_t *r2chan = R2CALL(ftdmchan)->r2chan;
|
||||
openr2_cas_signal_t rxcas, txcas;
|
||||
|
||||
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_IN_ALARM)) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG,
|
||||
"Received request to change sig status of alarmed channel to %s", ftdm_signaling_status2str(status));
|
||||
|
||||
switch (status) {
|
||||
case FTDM_SIG_STATE_SUSPENDED:
|
||||
openr2_chan_set_blocked(r2chan);
|
||||
/* Need to send sig status change to SUSPENDED once out of alarm */
|
||||
R2CALL(ftdmchan)->localsuspend_on_alarm = 1;
|
||||
break;
|
||||
case FTDM_SIG_STATE_UP:
|
||||
openr2_chan_set_blocked(r2chan);
|
||||
/* DO NOT send sig status change to SUSPENDED once out of alarm */
|
||||
R2CALL(ftdmchan)->localsuspend_on_alarm = 0;
|
||||
break;
|
||||
default:
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_WARNING, "Cannot set signaling status to unknown value '%d'\n", status);
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
/* get the current rx and tx cas bits */
|
||||
openr2_chan_get_cas(r2chan, &rxcas, &txcas);
|
||||
|
||||
|
|
Loading…
Reference in New Issue