Skip to content

Commit 434cd44

Browse files
authored
Merge pull request #1041 from adenchen123/master
Track phone call success state in application
2 parents ad952cb + aaa72a2 commit 434cd44

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/Infrastructure/BotSharp.Abstraction/Infrastructures/Enums/StateConst.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ public class StateConst
1717
public const string SUB_CONVERSATION_ID = "sub_conversation_id";
1818
public const string ORIGIN_CONVERSATION_ID = "origin_conversation_id";
1919
public const string WEB_DRIVER_TASK_ID = "web_driver_task_id";
20+
public const string PHONE_CALL_SUCCESSED = "phone_call_successed";
2021
}

src/Plugins/BotSharp.Plugin.Twilio/OutboundPhoneCallHandler/Functions/OutboundPhoneCallFn.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,15 @@ public async Task<bool> Execute(RoleDialogModel message)
123123
var originConversationId = convService.ConversationId;
124124
var entryAgentId = routing.EntryAgentId;
125125

126+
states.SetState(StateConst.PHONE_CALL_SUCCESSED, true);
126127
await ForkConversation(args, entryAgentId, originConversationId, newConversationId, call);
127128

128129
message.Content = $"The call has been successfully queued. The initial information is as follows: {args.InitialMessage}.";
129130
return true;
130131
}
131132
else
132133
{
134+
states.SetState(StateConst.PHONE_CALL_SUCCESSED, false);
133135
message.Content = $"Failed to make a call, status is {call.Status}.";
134136
return false;
135137
}

0 commit comments

Comments
 (0)