2024-11-21 06:50:55 +00:00
|
|
|
using BotSharp.Abstraction.Agents.Models;
|
2024-11-19 19:05:12 +00:00
|
|
|
using BotSharp.Plugin.Twilio.OutboundPhoneCallHandler.Enums;
|
|
|
|
|
|
2024-11-21 06:50:55 +00:00
|
|
|
namespace BotSharp.Plugin.Twilio.OutboundPhoneCallHandler.Hooks;
|
|
|
|
|
|
|
|
|
|
public class OutboundPhoneCallHandlerUtilityHook : IAgentUtilityHook
|
2024-11-19 19:05:12 +00:00
|
|
|
{
|
2024-12-04 22:12:02 +00:00
|
|
|
private static string PREFIX = "util-twilio-";
|
2025-02-26 17:41:52 +00:00
|
|
|
private static string OUTBOUND_PHONE_CALL_FN = $"{PREFIX}outbound_phone_call";
|
2025-03-17 22:09:02 +00:00
|
|
|
private static string TRANSFER_PHONE_CALL_FN = $"{PREFIX}transfer_phone_call";
|
2025-02-26 17:41:52 +00:00
|
|
|
private static string HANGUP_PHONE_CALL_FN = $"{PREFIX}hangup_phone_call";
|
2025-03-17 22:09:02 +00:00
|
|
|
private static string TEXT_MESSAGE_FN = $"{PREFIX}text_message";
|
2025-03-19 19:37:08 +00:00
|
|
|
private static string LEAVE_VOICEMAIL_FN = $"{PREFIX}leave_voicemail";
|
2024-11-21 06:50:55 +00:00
|
|
|
|
|
|
|
|
public void AddUtilities(List<AgentUtility> utilities)
|
2024-11-19 19:05:12 +00:00
|
|
|
{
|
2024-11-21 06:50:55 +00:00
|
|
|
var utility = new AgentUtility
|
2024-11-19 19:05:12 +00:00
|
|
|
{
|
2025-05-28 21:16:48 +00:00
|
|
|
Category = "phone",
|
2024-11-21 06:50:55 +00:00
|
|
|
Name = UtilityName.OutboundPhoneCall,
|
2025-05-28 21:16:48 +00:00
|
|
|
Items = [
|
|
|
|
|
new UtilityItem
|
|
|
|
|
{
|
|
|
|
|
FunctionName = OUTBOUND_PHONE_CALL_FN
|
|
|
|
|
},
|
|
|
|
|
new UtilityItem
|
|
|
|
|
{
|
|
|
|
|
FunctionName = TRANSFER_PHONE_CALL_FN
|
|
|
|
|
},
|
|
|
|
|
new UtilityItem
|
|
|
|
|
{
|
|
|
|
|
FunctionName = HANGUP_PHONE_CALL_FN
|
|
|
|
|
},
|
|
|
|
|
new UtilityItem
|
|
|
|
|
{
|
|
|
|
|
FunctionName = TEXT_MESSAGE_FN
|
|
|
|
|
},
|
|
|
|
|
new UtilityItem
|
|
|
|
|
{
|
|
|
|
|
FunctionName = LEAVE_VOICEMAIL_FN
|
|
|
|
|
}
|
2025-02-26 17:41:52 +00:00
|
|
|
]
|
2024-11-21 06:50:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
utilities.Add(utility);
|
2024-11-19 19:05:12 +00:00
|
|
|
}
|
|
|
|
|
}
|