From 56bc61d703ab793efd930bffb27cbe78f6e8a57c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Mon, 22 Aug 2022 12:34:35 +0200 Subject: [PATCH] Added dtmfMode in preparation for DTMF-aware conferences --- .../Calling/Callbacks/Request/DtmfMode.cs | 9 +++++++++ .../Response/IConnectConferenceSvamletResponse.cs | 4 +++- .../Internal/ConnectConferenceSvamletResponse.cs | 7 +++++++ src/Sinch.ServerSdk/Calling/Models/SvamletActionModel.cs | 3 +++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/Sinch.ServerSdk/Calling/Callbacks/Request/DtmfMode.cs diff --git a/src/Sinch.ServerSdk/Calling/Callbacks/Request/DtmfMode.cs b/src/Sinch.ServerSdk/Calling/Callbacks/Request/DtmfMode.cs new file mode 100644 index 0000000..9d44e5e --- /dev/null +++ b/src/Sinch.ServerSdk/Calling/Callbacks/Request/DtmfMode.cs @@ -0,0 +1,9 @@ +namespace Sinch.ServerSdk.Calling.Callbacks.Request +{ + public enum DtmfMode + { + Ignore, + Forward, + Detect + } +} diff --git a/src/Sinch.ServerSdk/Calling/Callbacks/Response/IConnectConferenceSvamletResponse.cs b/src/Sinch.ServerSdk/Calling/Callbacks/Response/IConnectConferenceSvamletResponse.cs index 26ce9a6..8510d42 100644 --- a/src/Sinch.ServerSdk/Calling/Callbacks/Response/IConnectConferenceSvamletResponse.cs +++ b/src/Sinch.ServerSdk/Calling/Callbacks/Response/IConnectConferenceSvamletResponse.cs @@ -1,4 +1,5 @@ -using Sinch.ServerSdk.Calling.Models; +using Sinch.ServerSdk.Calling.Callbacks.Request; +using Sinch.ServerSdk.Calling.Models; namespace Sinch.ServerSdk.Calling.Callbacks.Response { @@ -13,5 +14,6 @@ public interface IConnectConferenceSvamletResponse : ISvamletResponse IConnectConferenceSvamletResponse WithTwoParts(); IConnectConferenceSvamletResponse WithMultiParts(); IConnectConferenceSvamletResponse WithCallTag(CallTag tagType, string value); + IConnectConferenceSvamletResponse WithDtmfMode(DtmfMode mode); } } \ No newline at end of file diff --git a/src/Sinch.ServerSdk/Calling/Callbacks/Response/Internal/ConnectConferenceSvamletResponse.cs b/src/Sinch.ServerSdk/Calling/Callbacks/Response/Internal/ConnectConferenceSvamletResponse.cs index 483166e..e79af9b 100644 --- a/src/Sinch.ServerSdk/Calling/Callbacks/Response/Internal/ConnectConferenceSvamletResponse.cs +++ b/src/Sinch.ServerSdk/Calling/Callbacks/Response/Internal/ConnectConferenceSvamletResponse.cs @@ -1,3 +1,4 @@ +using Sinch.ServerSdk.Calling.Callbacks.Request; using Sinch.ServerSdk.Calling.Models; namespace Sinch.ServerSdk.Calling.Callbacks.Response.Internal @@ -58,5 +59,11 @@ public IConnectConferenceSvamletResponse WithCallTag(CallTag tagType, string val return this; } + + public IConnectConferenceSvamletResponse WithDtmfMode(DtmfMode mode) + { + Model.Action.DtmfMode = mode.ToString(); + return this; + } } } \ No newline at end of file diff --git a/src/Sinch.ServerSdk/Calling/Models/SvamletActionModel.cs b/src/Sinch.ServerSdk/Calling/Models/SvamletActionModel.cs index 76f6501..83ed49b 100644 --- a/src/Sinch.ServerSdk/Calling/Models/SvamletActionModel.cs +++ b/src/Sinch.ServerSdk/Calling/Models/SvamletActionModel.cs @@ -92,5 +92,8 @@ public class SvamletActionModel [JsonProperty(PropertyName = "amd", DefaultValueHandling = DefaultValueHandling.Ignore)] public AmdOptions Amd { get; set; } + + [JsonProperty(PropertyName = "dtmfMode", DefaultValueHandling = DefaultValueHandling.Ignore)] + public string DtmfMode { get; set; } } } \ No newline at end of file