ftmod_libpri: Skip channels marked in use during NT-mode idle restart.

Channels can be in DOWN state but reserved by an incoming call
(FTDM_CHANNEL_INUSE flag). Additionally check the flag in on_timeout_t3xx()
and skip those channels.

Reported-by: privi #freetdm @ irc.freenode.net
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
This commit is contained in:
Stefan Knoblich 2012-09-11 11:09:40 +02:00
parent c0e4ca47bc
commit a478a5de04
1 changed files with 1 additions and 1 deletions

View File

@ -1938,7 +1938,7 @@ static int on_timeout_t3xx(struct lpwrap_pri *spri, struct lpwrap_timer *timer)
if (ftdm_channel_get_type(cur) != FTDM_CHAN_TYPE_B)
continue;
/* Restart idle b-channels */
if (ftdm_channel_get_state(cur) == FTDM_CHANNEL_STATE_DOWN) {
if (ftdm_channel_get_state(cur) == FTDM_CHANNEL_STATE_DOWN && !ftdm_test_flag(cur, FTDM_CHANNEL_INUSE)) {
ftdm_set_state_locked(cur, FTDM_CHANNEL_STATE_RESTART);
}
}