ftmod_analog_em: Block/unblock signaling when a span is stopped/started

This commit is contained in:
Moises Silva 2013-10-06 20:51:31 -04:00
parent 4d0cc03928
commit 01b02acfae
1 changed files with 4 additions and 0 deletions

View File

@ -44,6 +44,8 @@
struct tm * localtime_r(const time_t *clock, struct tm *result);
#endif
static FIO_SPAN_SET_SIG_STATUS_FUNCTION(analog_em_set_span_sig_status);
/* check if the given file is a wave file and skip the header if it is */
#define WAVE_CHUNK_ID "RIFF"
#define WAVE_FMT "WAVEfmt "
@ -223,6 +225,7 @@ static ftdm_status_t ftdm_analog_em_stop(ftdm_span_t *span)
ftdm_analog_em_data_t *analog_data = span->signal_data;
ftdm_clear_flag(analog_data, FTDM_ANALOG_EM_RUNNING);
ftdm_sleep(100);
analog_em_set_span_sig_status(span, FTDM_SIG_STATE_SUSPENDED);
return FTDM_SUCCESS;
}
@ -1014,6 +1017,7 @@ static void *ftdm_analog_em_run(ftdm_thread_t *me, void *obj)
ftdm_analog_em_data_t *analog_data = span->signal_data;
ftdm_log(FTDM_LOG_DEBUG, "ANALOG EM thread starting.\n");
analog_em_set_span_sig_status(span, FTDM_SIG_STATE_UP);
while(ftdm_running() && ftdm_test_flag(analog_data, FTDM_ANALOG_EM_RUNNING)) {
int waitms = 10;