# HG changeset patch # User Mychaela Falconia # Date 1668927479 28800 # Node ID 8c28426abef0d24c166563dfdf64b88442510565 # Parent 2ebad02adbe5507a9545bad3493001c242b893ec mgw: start using the new libgsmfrp dependency diff -r 2ebad02adbe5 -r 8c28426abef0 mgw/Makefile --- a/mgw/Makefile Wed Oct 12 18:08:34 2022 -0800 +++ b/mgw/Makefile Sat Nov 19 22:57:59 2022 -0800 @@ -10,7 +10,7 @@ all: ${PROG} ${PROG}: ${OBJS} ${LIBS} - ${CC} ${CFLAGS} -o $@ ${OBJS} ${LIBS} -lgsm -lm + ${CC} ${CFLAGS} -o $@ ${OBJS} ${LIBS} -lgsmfrp -lgsm -lm install: install -c -o bin -g bin -m 755 ${PROG} ${INSTBIN} diff -r 2ebad02adbe5 -r 8c28426abef0 mgw/dlcx.c --- a/mgw/dlcx.c Wed Oct 12 18:08:34 2022 -0800 +++ b/mgw/dlcx.c Sat Nov 19 22:57:59 2022 -0800 @@ -90,6 +90,8 @@ free(ep->gsm_encoder_state); if (ep->gsm_decoder_state) free(ep->gsm_decoder_state); + if (ep->gsm_decoder_extra_state) + free(ep->gsm_decoder_extra_state); free(ep); } delq = 0; diff -r 2ebad02adbe5 -r 8c28426abef0 mgw/gsm2pstn.c --- a/mgw/gsm2pstn.c Wed Oct 12 18:08:34 2022 -0800 +++ b/mgw/gsm2pstn.c Sat Nov 19 22:57:59 2022 -0800 @@ -15,6 +15,7 @@ #include #include #include /* libgsm dependency */ +#include #include "../include/tmgw_ctrl.h" #include "../include/tmgw_const.h" #include "struct.h" @@ -133,6 +134,8 @@ } switch (ep->gsm_payload_msg_type) { case GSM_TCHF_FRAME: + gsmfr_preproc_good_frame(ep->gsm_decoder_extra_state, + pkt.payload); gsm_decode(ep->gsm_decoder_state, pkt.payload, pcm_samples); break; } @@ -156,6 +159,12 @@ ep->gsm_decoder_state = gsm_create(); if (!ep->gsm_decoder_state) return TMGW_RESP_ERR_RSRC; + ep->gsm_decoder_extra_state = gsmfr_preproc_create(); + if (!ep->gsm_decoder_extra_state) { + free(ep->gsm_decoder_state); + ep->gsm_decoder_state = 0; + return TMGW_RESP_ERR_RSRC; + } break; } select_handlers[ep->rtp_gsm.rtp_fd] = gsm2pstn_rtp_in; diff -r 2ebad02adbe5 -r 8c28426abef0 mgw/struct.h --- a/mgw/struct.h Wed Oct 12 18:08:34 2022 -0800 +++ b/mgw/struct.h Sat Nov 19 22:57:59 2022 -0800 @@ -30,6 +30,7 @@ /* gateway functionality */ void *gsm_encoder_state; void *gsm_decoder_state; + void *gsm_decoder_extra_state; /* GSM to PSTN forwarding */ int g2p_state; uint32_t g2p_ssrc;