From eaf0318e9c702485e558f472b59d8e012562670f Mon Sep 17 00:00:00 2001 From: Grzegorz Sluja <grzegorz.sluja@iopsys.eu> Date: Fri, 9 May 2025 11:37:00 +0000 Subject: [PATCH] Play busy and congestion tones by DSP for both FXS and DECT, REF 16487,16548 Also set the flag for overlapped dialling which is used by VOICE_SIG_INGRESS_DTMF to speed up the en-bloc dialling process. --- libvoice/libvoice.h | 1 + line-dect.c | 6 ++++++ line.c | 13 ++++--------- main.c | 1 + 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/libvoice/libvoice.h b/libvoice/libvoice.h index 55a6fd9..7e2cea9 100644 --- a/libvoice/libvoice.h +++ b/libvoice/libvoice.h @@ -156,6 +156,7 @@ struct line_t { pe_list_t *pending_digits; // List of keypad digits waiting to be sent enum PAGING_STATUS paging_status; // Line's paging status #define VOICEMNGR_LINE_FLAG_NARROW_BAND_ONLY 0x1 +#define VOICEMNGR_LINE_FLAG_OVERLAP_DIALING 0x2 uint32_t flags; void *priv; // Platform dependent data diff --git a/line-dect.c b/line-dect.c index 9064d44..eeeec49 100644 --- a/line-dect.c +++ b/line-dect.c @@ -180,6 +180,12 @@ int simulate_digits_pressing(int line, const char *pressed_digits) { if(lines[line].type != VOICE_LINE_DECT) return 0; + if (!pressed_digits) { + ENDPT_DBG("line: %d overlap dialing\n", line); + lines[line].flags |= VOICEMNGR_LINE_FLAG_OVERLAP_DIALING; + return 0; + } + ENDPT_DBG("line: %d pressed_digits: %s\n", line, (pressed_digits ? pressed_digits : "")); // Store digits in a list. diff --git a/line.c b/line.c index bc340d2..242262f 100644 --- a/line.c +++ b/line.c @@ -99,7 +99,7 @@ static int perhaps_simulate_busy(int line, struct voice_ubus_req_t *ubus_req) } //---------------------------------------------------------------------------------- // DECT handset tone trigger -static int dect_tone_play(int line, int pcm, enum VOICE_SIGNAL signal, const char *data, struct voice_ubus_req_t *ubus_req) +/*static int dect_tone_play(int line, int pcm, enum VOICE_SIGNAL signal, const char *data, struct voice_ubus_req_t *ubus_req) { struct line_req_t *line_req = NULL; ENDPT_DBG("line=%d, pcm=%d, data=%s\n", line, pcm, data); @@ -136,7 +136,7 @@ static int dect_tone_play(int line, int pcm, enum VOICE_SIGNAL signal, const cha line_req->ubus.reqIn = NULL; return 0; -} +}*/ static void setCLIDinfo(const char *data, struct line_req_t *line_req) { @@ -390,15 +390,10 @@ int line_signal(int line, const char *signame, const char *data, struct voice_ub case VOICE_SIG_NETBUSY: if (lines[line].type == VOICE_LINE_DECT) { pcm_states_dump(__func__, line); - if (get_callid_state(lines[line].pcm_callid[PCM_0])==CALLID_ESTABLISHED && get_callid_state(lines[line].pcm_callid[PCM_1])==CALLID_ESTABLISHED){ + if (get_callid_state(lines[line].pcm_callid[PCM_0])==CALLID_ESTABLISHED && get_callid_state(lines[line].pcm_callid[PCM_1])==CALLID_ESTABLISHED) send_dect_event_to_asterisk(line, dect_event_map[DECT_EVT_RELEASE]); - } else if (get_callid_state(lines[line].pcm_callid[PCM_0]) == CALLID_ESTABLISHED || get_callid_state(lines[line].pcm_callid[PCM_1]) == CALLID_ESTABLISHED){ - // play tone on DECT - res = dect_tone_play(line, get_callid_state(lines[line].pcm_callid[PCM_0]) == CALLID_ESTABLISHED ? PCM_0 : PCM_1, sig->signal, data, ubus_req); - } else { - // In other cases, just play the tone on DECT by DSP in the same way as FXS + else res = voice_line_signal(line, -1, sig->signal, atoi(data), NULL); - } } else { res = voice_line_signal(line, -1, sig->signal, atoi(data), NULL); } diff --git a/main.c b/main.c index 16b9132..c288bee 100644 --- a/main.c +++ b/main.c @@ -213,6 +213,7 @@ static void voicemngr_event_report(int line, const char *event, const char *data msg->name = event; msg->data = data; msg->line = line; + ENDPT_ERR("%s: event: %s, data: %s, line: %d\n", __func__, msg->name ? msg->name : "null", msg->data ? msg->data : "null", msg->line); send_event_main(msg, EVENT_MAIN_LINE); } } -- GitLab