Skip to content

Commit f2e793d

Browse files
authored
Merge pull request #13 from cmdotcom/feature/VAPPS-2434
Support FlowBuilder instruction
2 parents 3ef2749 + ab95f4e commit f2e793d

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System.Collections.Generic;
2+
using Newtonsoft.Json;
3+
4+
namespace CM.Voice.VoiceApi.Sdk.Models.Instructions.Apps
5+
{
6+
/// <summary>
7+
/// This sends the instruction to make and outbound call and start a FlowBuilder flow.
8+
/// </summary>
9+
public class FlowBuilderInstruction : BaseAppInstruction
10+
{
11+
/// <summary>
12+
/// The unique identifier of the FlowBuilder flow.
13+
/// </summary>
14+
[JsonProperty("callflow-id", Order = 7)]
15+
public string CallflowId { get; set; }
16+
17+
/// <summary>
18+
/// Optional list of flow variables that will be set.
19+
/// </summary>
20+
[JsonProperty("flow-variables", Order = 8)]
21+
public Dictionary<string, object> FlowVariables { get; set; }
22+
23+
/// <summary>
24+
/// Determines the Voicemail detection flow.
25+
/// </summary>
26+
[JsonProperty("voicemail-response", Order = 9)]
27+
public VoicemailResponse VoicemailResponse { get; set; } = VoicemailResponse.Stop;
28+
}
29+
}

CM.Voice.VoiceApi.Sdk/VoiceApiClient.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ private static string GetUrlSuffix(BaseAppInstruction instruction)
7676
return "/OTP";
7777
case RequestDtmfInstruction _:
7878
return "/DTMF";
79+
case FlowBuilderInstruction _:
80+
return "/FlowBuilder";
7981
default:
8082
throw new NotImplementedException($"No known endpoint for sending a {instruction.GetType().Name} to the CM VoiceApi.");
8183
}
8284
}
8385
}
84-
}
86+
}

0 commit comments

Comments
 (0)