conversation add channelId field
This commit is contained in:
parent
ad0b6bb6f4
commit
127f501771
|
|
@ -24,12 +24,15 @@ public class Conversation
|
|||
|
||||
public string Channel { get; set; } = ConversationChannel.OpenAPI;
|
||||
|
||||
/// <summary>
|
||||
/// Channel id, like phone number, email address, etc.
|
||||
/// </summary>
|
||||
public string ChannelId { get; set; }
|
||||
|
||||
public int DialogCount { get; set; }
|
||||
|
||||
public List<string> Tags { get; set; } = new();
|
||||
|
||||
public string CallingPhone { get; set; }
|
||||
|
||||
public DateTime UpdatedTime { get; set; } = DateTime.UtcNow;
|
||||
public DateTime CreatedTime { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,12 +172,12 @@ public partial class ConversationService : IConversationService
|
|||
{
|
||||
var state = _services.GetRequiredService<IConversationStateService>();
|
||||
var channel = state.GetState("channel");
|
||||
var callingPhone = state.GetState("calling_phone");
|
||||
var channelId = state.GetState("channel_id");
|
||||
var sess = new Conversation
|
||||
{
|
||||
Id = _conversationId,
|
||||
Channel = channel,
|
||||
CallingPhone = callingPhone,
|
||||
ChannelId = channelId,
|
||||
AgentId = agentId
|
||||
};
|
||||
converation = await NewConversation(sess);
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ public class ConversationDocument : MongoBase
|
|||
public string? TaskId { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Channel { get; set; }
|
||||
public string ChannelId { get; set; }
|
||||
public string Status { get; set; }
|
||||
public int DialogCount { get; set; }
|
||||
public List<string> Tags { get; set; }
|
||||
public string CallingPhone { get; set; }
|
||||
public DateTime CreatedTime { get; set; }
|
||||
public DateTime UpdatedTime { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ namespace BotSharp.Plugin.Twilio.Services
|
|||
var states = new List<MessageState>
|
||||
{
|
||||
new("channel", ConversationChannel.Phone),
|
||||
new("channel_id", message.From),
|
||||
new("calling_phone", message.From)
|
||||
};
|
||||
states.AddRange(message.States.Select(kvp => new MessageState(kvp.Key, kvp.Value)));
|
||||
|
|
|
|||
Loading…
Reference in a new issue