diff --git a/src/channels/chan_voicemngr.c b/src/channels/chan_voicemngr.c index 548867df821bb5657967d5d2696595d7e7c29d37..acb8809594d16787ddc7370ee03f2cd96fb64d4b 100644 --- a/src/channels/chan_voicemngr.c +++ b/src/channels/chan_voicemngr.c @@ -67,6 +67,7 @@ #include <libubus.h> #include <libpicoevent.h> +#include "voice-types.h" #include "chan_voicemngr.h" #ifndef AST_MODULE #define AST_MODULE "chan_voicemngr" @@ -233,7 +234,6 @@ static pe_stream_t *audio_rx_stream; static int mwi_dialtone_state = DIALTONE_ON; static char lineCallStatus[16]; int dtmf_wait_timer = 2000; /*Time to wait for dtmf(for R4 call setup) before setting up a conference call*/ -#define RTP_HEADER_SIZE 12 #define RTP_DTMF_SIZE 4 enum { @@ -355,14 +355,6 @@ struct endpt_event { int line; }; -enum VOICE_CODEC { - VOICE_CODEC_G711U, - VOICE_CODEC_G711A, - VOICE_CODEC_G722, - VOICE_CODEC_G723, - VOICE_CODEC_G726, - VOICE_CODEC_G729, -}; struct voicemngr_codec { char *name; @@ -380,16 +372,6 @@ struct voicemngr_codec { #define VOICEMNGR_CODECS_NUM (sizeof(voicemngr_codecs)/sizeof(struct voicemngr_codec)) -/* ubus action to voicemngr for config update */ -#define UBUS_DATA_CODEC_BIT 1 -#define UBUS_DATA_PTIME_BIT (1<<1) -struct config_update_struct { - uint8_t mask; // 8 bit mask - enum VOICE_CODEC codec; - int ptime; - // add more if needed -}; - static struct voicemngr_codec* voicemngr_codec_get(const char *name) { for (int i=0; i<VOICEMNGR_CODECS_NUM; i++) @@ -442,13 +424,6 @@ static enum VOICE_CODEC codec_string_to_enum(const char *data) return VOICE_CODEC_G711A; } -typedef struct __attribute__((__packed__)) { - int32_t line; - int32_t cnx_id; - uint32_t rtp_size; - uint8_t rtp[1]; -} audio_packet_t; - static struct endpt_event event_map[] = { { .name = "DTMF0", .event = EVENT_DTMF0 }, { .name = "DTMF1", .event = EVENT_DTMF1 }, @@ -1741,7 +1716,7 @@ static int chan_voicemngr_write(struct ast_channel *ast, struct ast_frame *frame } ap->line = sub->parent->line_id; - ap->cnx_id = sub->parent->line_id; + ap->connection_id = sub->parent->line_id; ap->rtp_size = RTP_HEADER_SIZE + 1; /* copy frame data to audio packet */ @@ -1778,7 +1753,7 @@ static int chan_voicemngr_write(struct ast_channel *ast, struct ast_frame *frame } ap->line = sub->parent->line_id; - ap->cnx_id = sub->parent->line_id; + ap->connection_id = sub->parent->line_id; ap->rtp_size = RTP_HEADER_SIZE + frame->datalen; /* copy frame data to audio packet */ @@ -1822,7 +1797,7 @@ static int chan_voicemngr_write(struct ast_channel *ast, struct ast_frame *frame } ap->line = sub->parent->line_id; - ap->cnx_id = sub->parent->line_id; + ap->connection_id = sub->parent->line_id; ap->rtp_size = frame->datalen; /* copy frame data to audio packet */ @@ -3086,8 +3061,8 @@ static void audio_packet_handler(pe_packet_t *p) { pvt = chan_voicemngr_get_pvt_from_lineid(iflist, ap->line); sub = chan_voicemngr_get_active_subchannel(pvt); if (!pvt || !sub) { - ast_log(LOG_ERROR, "Failed to find subchannel for %s/%d/%d\n", frame.src, ap->line, ap->cnx_id); - endpt_connection(ap->line, ap->cnx_id, "destroy"); // Request line close + ast_log(LOG_ERROR, "Failed to find subchannel for %s/%d/%d\n", frame.src, ap->line, ap->connection_id); + endpt_connection(ap->line, ap->connection_id, "destroy"); // Request line close return; } diff --git a/src/channels/chan_voicemngr.h b/src/channels/chan_voicemngr.h index 2da36d116fc5f8219817946267bc5989c95fc05d..834b45d79d4b8d16313276677a620c11986bf186 100644 --- a/src/channels/chan_voicemngr.h +++ b/src/channels/chan_voicemngr.h @@ -109,12 +109,6 @@ typedef enum dialtone_state { DIALTONE_LAST, } dialtone_state; -typedef enum callid_state { - CALLID_INVALID = -1, - CALLID_OBTAINING = 0, - CALLID_ESTABLISHED = 1 -} callid_state; - struct line_stats_t { uint32_t rxpkts; uint32_t txpkts;