diff --git a/src/Plugins/BotSharp.Plugin.Twilio/OutboundPhoneCallHandler/Functions/OutboundPhoneCallFn.cs b/src/Plugins/BotSharp.Plugin.Twilio/OutboundPhoneCallHandler/Functions/OutboundPhoneCallFn.cs index 905a2253..afe6b89c 100644 --- a/src/Plugins/BotSharp.Plugin.Twilio/OutboundPhoneCallHandler/Functions/OutboundPhoneCallFn.cs +++ b/src/Plugins/BotSharp.Plugin.Twilio/OutboundPhoneCallHandler/Functions/OutboundPhoneCallFn.cs @@ -145,14 +145,17 @@ public class OutboundPhoneCallFn : IFunctionCallback Title = args.InitialMessage }); + var messageId = Guid.NewGuid().ToString(); convStorage.Append(newConversationId, new List { new RoleDialogModel(AgentRole.User, "Hi") { + MessageId = messageId, CurrentAgentId = entryAgentId }, new RoleDialogModel(AgentRole.Assistant, args.InitialMessage) { + MessageId = messageId, CurrentAgentId = entryAgentId } }); @@ -160,6 +163,7 @@ public class OutboundPhoneCallFn : IFunctionCallback convService.SetConversationId(newConversationId, [ new MessageState(StateConst.ORIGIN_CONVERSATION_ID, originConversationId), + new MessageState("channel", "phone"), new MessageState("phone_from", call.From), new MessageState("phone_direction", call.Direction), new MessageState("phone_number", call.To),