freetdm: ftmod_r2 - set feature FTDM_CHANNEL_FEATURE_IO_STATS just when the channel is in FTDM_CHANNEL_STATE_UP state

This commit is contained in:
Arnaldo Pereira 2010-11-29 16:48:01 -02:00
parent f7279386e4
commit ac2998b61f
1 changed files with 6 additions and 1 deletions

View File

@ -1403,7 +1403,6 @@ static void *ftdm_r2_run(ftdm_thread_t *me, void *obj)
openr2_chan_process_cas_signaling(r2chan);
ftdmchan = openr2_chan_get_client_data(r2chan);
ftdm_channel_set_feature(ftdmchan, FTDM_CHANNEL_FEATURE_IO_STATS);
}
memset(&start, 0, sizeof(start));
@ -1462,6 +1461,12 @@ static void *ftdm_r2_run(ftdm_thread_t *me, void *obj)
ftdmchan = openr2_chan_get_client_data(r2chan);
r2call = R2CALL(ftdmchan);
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_STATE_UP)) {
ftdm_channel_set_feature(ftdmchan, FTDM_CHANNEL_FEATURE_IO_STATS);
} else {
ftdm_channel_clear_feature(ftdmchan, FTDM_CHANNEL_FEATURE_IO_STATS);
}
ftdm_mutex_lock(ftdmchan->mutex);
ftdm_r2_state_advance_all(ftdmchan);
openr2_chan_process_signaling(r2chan);