From 953fabbf101d963e9a106c91ce0ee4f322f08129 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 29 Jan 2024 14:29:16 -0500 Subject: [PATCH] MT#59038 support `block DTMF` flag Change-Id: I6426798708d4dfb73253236ffdc0030e85494efd --- daemon/call_interfaces.c | 7 +++++++ docs/ng_control_protocol.md | 6 ++++++ include/call_interfaces.h | 1 + 3 files changed, 14 insertions(+) diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index cad552b1e..3c4b9d508 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -1015,6 +1015,10 @@ static void call_ng_flags_flags(sdp_ng_flags *out, str *s, helper_arg dummy) { case CSH_LOOKUP("player"): out->audio_player = AP_TRANSCODING; break; + case CSH_LOOKUP("block-dtmf"): + case CSH_LOOKUP("block-DTMF"): + out->block_dtmf = 1; + break; case CSH_LOOKUP("block-short"): case CSH_LOOKUP("block-shorts"): case CSH_LOOKUP("block-short-packets"): @@ -2162,6 +2166,9 @@ static const char *call_offer_answer_ng(ng_buffer *ngbuf, bencode_item_t *input, CALL_CLEAR(call, DROP_TRAFFIC); } + if (flags.block_dtmf) + call_set_dtmf_block(call, monologues[0], &flags); + ret = monologue_offer_answer(monologues, &streams, &flags); if (!ret) ret = sdp_replace(chopper, &parsed, to_ml, &flags); diff --git a/docs/ng_control_protocol.md b/docs/ng_control_protocol.md index db9e1e719..995c25d91 100644 --- a/docs/ng_control_protocol.md +++ b/docs/ng_control_protocol.md @@ -815,6 +815,12 @@ Spaces in each string may be replaced by hyphens. Corresponds to the *rtpproxy* `a` flag. Advertises an RTP endpoint which uses asymmetric RTP, which disables learning of endpoint addresses (see below). +* `block DTMF` + + Useful in `offer` or `answer` messages to immdiately enable DTMF blocking + (or other DTMF security mechanism) for the relevant call party, identical + to using a `block DTMF` message for the call party immediately after. + * `block short` or `block short packets` Enables blocking of short RTP packets for the applicable call participant. diff --git a/include/call_interfaces.h b/include/call_interfaces.h index 0bc299644..4699add69 100644 --- a/include/call_interfaces.h +++ b/include/call_interfaces.h @@ -183,6 +183,7 @@ struct sdp_ng_flags { accept_any:1, inject_dtmf:1, detect_dtmf:1, + block_dtmf:1, t38_decode:1, t38_force:1, t38_stop:1,