diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c index 8842ef5934..b0848379e9 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c @@ -642,10 +642,11 @@ void sngisdn_snd_data(ftdm_channel_t *dchan, uint8_t *data, ftdm_size_t len) void sngisdn_snd_event(ftdm_channel_t *dchan, ftdm_oob_event_t event) { sng_l1_event_t l1_event; + sngisdn_span_data_t *signal_data = NULL; memset(&l1_event, 0, sizeof(l1_event)); - sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) dchan->span->signal_data; + signal_data = (sngisdn_span_data_t*) dchan->span->signal_data; switch(event) { case FTDM_OOB_ALARM_CLEAR: l1_event.type = SNG_L1EVENT_ALARM_OFF; diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_rcv.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_rcv.c index e3898b9096..02e0bdf71b 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_rcv.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_rcv.c @@ -871,9 +871,10 @@ int16_t sngisdn_rcv_l1_data_req(uint16_t spId, sng_l1_frame_t *l1_frame) { ftdm_status_t status; ftdm_wait_flag_t flags = FTDM_WRITE; - sngisdn_span_data_t *signal_data = g_sngisdn_data.spans[spId]; - ftdm_assert(signal_data, "Received Data request on unconfigured span\n"); + sngisdn_span_data_t *signal_data = g_sngisdn_data.spans[spId]; ftdm_size_t length = l1_frame->len; + + ftdm_assert(signal_data, "Received Data request on unconfigured span\n"); do { flags = FTDM_WRITE;