...
Code Block | ||
---|---|---|
| ||
public class ExampleCallAction : ICallCommand, IModuleSelector<CallCommandSelector> { public IModuleSelector<CallCommandSelector> Selector => this; public AntonyCommandInfo ActionInfo => new AntonyCommandInfoBuilder() .WithDisplayName("-> Ticket") .WithGroupName("Example") .WithGeneralPageName() .Build(); public event EventHandler CommandStateChanged; public async Task ExecuteAsync(ICall call, IntPtr parentWindow, IProgressReporter reporter) { using (var client = new HttpClient()) { var content = new StringContent($"{{" + $"\"from\": {call.FromNumber}," + $"\"title\": From antony call," + $"\"description\": {call.Subject}," + $"}}"); await client.PostAsync("http://example.ticketsystem.com/api/tickets", content); } } public CommandState GetCommandState() { return CommandState.Normal; } public AntonyPriority GetPriority(CallCommandSelector selectorParameter) { if (selectorParameter.Direction == CallDirection.Incoming) return AntonyPriority.Buildin; return AntonyPriority.None; } } |
The code above should provide an example howto implement a ICallCommand
. Of course this is not production ready, as we dont have authentication, configuration or Exception handling!
Tip |
---|
You are able to access all client side services here. For example the |
Conclusion
As in all others modules you only need to provide an ICallCommand
within the DI container and you can start implementing your own modules. You can start now.