freetdm: E&M: Set the line offhook when suspended
This commit is contained in:
parent
6edf3341a6
commit
3a162334fe
|
@ -291,13 +291,23 @@ static FIO_CHANNEL_SET_SIG_STATUS_FUNCTION(analog_em_set_channel_sig_status)
|
||||||
return FTDM_FAIL;
|
return FTDM_FAIL;
|
||||||
case FTDM_SIG_STATE_SUSPENDED:
|
case FTDM_SIG_STATE_SUSPENDED:
|
||||||
if (!ftdm_test_flag(ftdmchan, FTDM_CHANNEL_SUSPENDED)) {
|
if (!ftdm_test_flag(ftdmchan, FTDM_CHANNEL_SUSPENDED)) {
|
||||||
|
int cas_bits = 0xFF;
|
||||||
ftdm_set_flag(ftdmchan, FTDM_CHANNEL_SUSPENDED);
|
ftdm_set_flag(ftdmchan, FTDM_CHANNEL_SUSPENDED);
|
||||||
|
ftdm_channel_command(ftdmchan, FTDM_COMMAND_SET_CAS_BITS, &cas_bits);
|
||||||
|
if (!ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OFFHOOK)) {
|
||||||
|
ftdm_channel_command(ftdmchan, FTDM_COMMAND_OFFHOOK, NULL);
|
||||||
|
}
|
||||||
ftdm_analog_set_chan_sig_status(ftdmchan, FTDM_SIG_STATE_SUSPENDED);
|
ftdm_analog_set_chan_sig_status(ftdmchan, FTDM_SIG_STATE_SUSPENDED);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FTDM_SIG_STATE_UP:
|
case FTDM_SIG_STATE_UP:
|
||||||
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_SUSPENDED)) {
|
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_SUSPENDED)) {
|
||||||
|
int cas_bits = 0x00;
|
||||||
ftdm_clear_flag(ftdmchan, FTDM_CHANNEL_SUSPENDED);
|
ftdm_clear_flag(ftdmchan, FTDM_CHANNEL_SUSPENDED);
|
||||||
|
ftdm_channel_command(ftdmchan, FTDM_COMMAND_SET_CAS_BITS, &cas_bits);
|
||||||
|
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OFFHOOK)) {
|
||||||
|
ftdm_channel_command(ftdmchan, FTDM_COMMAND_ONHOOK, NULL);
|
||||||
|
}
|
||||||
if (!ftdm_test_flag(ftdmchan, FTDM_CHANNEL_IN_ALARM)) {
|
if (!ftdm_test_flag(ftdmchan, FTDM_CHANNEL_IN_ALARM)) {
|
||||||
ftdm_analog_set_chan_sig_status(ftdmchan, FTDM_SIG_STATE_UP);
|
ftdm_analog_set_chan_sig_status(ftdmchan, FTDM_SIG_STATE_UP);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue