diff --git a/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c b/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c index 4e936d9817..ba4049a32f 100644 --- a/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c +++ b/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c @@ -950,7 +950,8 @@ static int on_restart(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_eve ftdm_channel_t *ftdmchan; ftdm_log(FTDM_LOG_NOTICE, "-- Restarting %d:%d\n", spri->span->span_id, pevent->restart.channel); - + + spri->dchan->state = FTDM_CHANNEL_STATE_UP; ftdmchan = span->channels[pevent->restart.channel]; if (!ftdmchan) { @@ -1132,6 +1133,7 @@ static void *ftdm_libpri_run(ftdm_thread_t *me, void *obj) } ftdm_log(FTDM_LOG_CRIT, "PRI down on span %d\n", isdn_data->spri.span->span_id); + isdn_data->spri.dchan->state = FTDM_CHANNEL_STATE_DOWN; if (!down) { ftdm_set_state_all(span, FTDM_CHANNEL_STATE_RESTART); diff --git a/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c b/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c index 7d192d59c5..d2a4f1b2b2 100644 --- a/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c +++ b/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c @@ -950,23 +950,15 @@ static FIO_GET_ALARMS_FUNCTION(wanpipe_get_alarms) } if (alarms & WAN_TE_BIT_ALARM_AIS) { - ftdmchan->alarm_flags |= FTDM_ALARM_AIS; ftdmchan->alarm_flags |= FTDM_ALARM_BLUE; alarms &= ~WAN_TE_BIT_ALARM_AIS; } if (alarms & WAN_TE_BIT_ALARM_RAI) { - ftdmchan->alarm_flags |= FTDM_ALARM_RAI; ftdmchan->alarm_flags |= FTDM_ALARM_YELLOW; alarms &= ~WAN_TE_BIT_ALARM_RAI; } - /* still missing to map: - * FTDM_ALARM_RECOVER - * FTDM_ALARM_LOOPBACK - * FTDM_ALARM_NOTOPEN - * */ - /* if we still have alarms that we did not map, set the general alarm */ if (alarms) { ftdm_log(FTDM_LOG_DEBUG, "Unmapped wanpipe alarms: %d\n", alarms); diff --git a/libs/freetdm/src/include/freetdm.h b/libs/freetdm/src/include/freetdm.h index fa599021e5..beb43fe40f 100644 --- a/libs/freetdm/src/include/freetdm.h +++ b/libs/freetdm/src/include/freetdm.h @@ -175,6 +175,7 @@ typedef enum { FTDM_STR2ENUM_P(ftdm_str2ftdm_chan_type, ftdm_chan_type2str, ftdm_chan_type_t) #define FTDM_IS_VOICE_CHANNEL(ftdm_chan) ((ftdm_chan)->type != FTDM_CHAN_TYPE_DQ921 && (ftdm_chan)->type != FTDM_CHAN_TYPE_DQ931) +#define FTDM_IS_DCHAN(ftdm_chan) ((ftdm_chan)->type == FTDM_CHAN_TYPE_DQ921 || (ftdm_chan)->type == FTDM_CHAN_TYPE_DQ931) typedef void (*ftdm_logger_t)(const char *file, const char *func, int line, int level, const char *fmt, ...); diff --git a/libs/freetdm/src/include/private/ftdm_core.h b/libs/freetdm/src/include/private/ftdm_core.h index 3c072cb958..3ab807620c 100644 --- a/libs/freetdm/src/include/private/ftdm_core.h +++ b/libs/freetdm/src/include/private/ftdm_core.h @@ -647,7 +647,9 @@ static __inline__ void ftdm_set_state_all(ftdm_span_t *span, ftdm_channel_state_ uint32_t j; ftdm_mutex_lock(span->mutex); for(j = 1; j <= span->chan_count; j++) { - ftdm_set_state_locked((span->channels[j]), state); + if (!FTDM_IS_DCHAN(span->channels[j])) { + ftdm_set_state_locked((span->channels[j]), state); + } } ftdm_mutex_unlock(span->mutex); }