voice copilot playload use tel Digits
This commit is contained in:
parent
effe494571
commit
b99b66e489
|
|
@ -72,6 +72,7 @@ public class TwilioVoiceController : TwilioController
|
|||
ConversationId = conversationId,
|
||||
SeqNumber = seqNum,
|
||||
Content = messageContent,
|
||||
Digits = request.Digits,
|
||||
From = request.From
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ namespace BotSharp.Plugin.Twilio.Models
|
|||
public string ConversationId { get; set; }
|
||||
public int SeqNumber { get; set; }
|
||||
public string Content { get; set; }
|
||||
public string Digits { get; set; }
|
||||
public string From { get; set; }
|
||||
public Dictionary<string, string> States { get; set; } = new();
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ namespace BotSharp.Plugin.Twilio.Services
|
|||
|
||||
var result = await conv.SendMessage(config.AgentId,
|
||||
inputMsg,
|
||||
replyMessage: BuildPostbackMessageModel(conv),
|
||||
replyMessage: BuildPostbackMessageModel(conv, message),
|
||||
async msg =>
|
||||
{
|
||||
reply = new AssistantMessage()
|
||||
|
|
@ -88,7 +88,7 @@ namespace BotSharp.Plugin.Twilio.Services
|
|||
await sessionManager.SetAssistantReplyAsync(message.ConversationId, message.SeqNumber, reply);
|
||||
}
|
||||
|
||||
private PostbackMessageModel BuildPostbackMessageModel(IConversationService conv)
|
||||
private PostbackMessageModel BuildPostbackMessageModel(IConversationService conv, CallerMessage message)
|
||||
{
|
||||
var messages = conv.GetDialogHistory(1);
|
||||
if (!messages.Any()) return null;
|
||||
|
|
@ -98,7 +98,7 @@ namespace BotSharp.Plugin.Twilio.Services
|
|||
{
|
||||
FunctionName = lastMessage.PostbackFunctionName,
|
||||
ParentId = lastMessage.MessageId,
|
||||
Payload = lastMessage.Payload
|
||||
Payload = message.Digits
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue