From d5face6404c604e0baff7aed9a1ba5db18431f51 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sat, 27 Feb 2021 12:07:32 +0100 Subject: Add DTMF detection via telephone-event payload --- src/router/call.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/router/call.h') diff --git a/src/router/call.h b/src/router/call.h index 580f267..e782c26 100644 --- a/src/router/call.h +++ b/src/router/call.h @@ -21,6 +21,8 @@ enum call_state { #include "routing.h" +#define MAX_CODECS 8 + /* relation to upper layer */ typedef struct call_relation { struct call_relation *next; @@ -39,6 +41,8 @@ typedef struct call_relation { int rtp_proxy; osmo_cc_session_t *cc_session; int codec_negotiated; + struct osmo_cc_helper_audio_codecs orig_codecs[MAX_CODECS + 1]; /* codecs for originator */ + struct osmo_cc_helper_audio_codecs term_codecs[MAX_CODECS + 1]; /* codecs for terminator, stored at relation of originator */ osmo_cc_session_codec_t *codec; wave_play_t play; /* play a wave file */ @@ -48,6 +52,7 @@ typedef struct call_relation { wave_rec_t rec; /* record a wave file */ dtmf_dec_t dtmf_dec; /* dtmf decoder */ int dtmf_dec_enable;/* feed decoder with data */ + int te_started; /* we got a digit via telephone-event */ } call_relation_t; /* call instance */ @@ -77,8 +82,16 @@ typedef struct call { extern call_t *call_list; +struct telephone_event { + uint8_t event; + uint8_t e, r; + uint8_t volume; + uint16_t duration; +}; + int call_init(osmo_cc_endpoint_t *ep, const char *_routing_script, const char *_routing_shell); void call_exit(void); int call_handle(void); void cc_message(osmo_cc_endpoint_t *ep, uint32_t callref, osmo_cc_msg_t *msg); +void telephone_event(call_relation_t *relation, struct telephone_event *te); -- cgit v1.2.3