Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ async def run_dialog(
if (
turn_context.activity.type == ActivityTypes.end_of_conversation
and dialog_context.stack
and DialogExtensions.__is_eoc_coming_from_parent(turn_context)
):
remote_cancel_text = "Skill was canceled through an EndOfConversation activity from the parent."
await turn_context.send_trace_activity(
f"Extension {Dialog.__name__}.run_dialog", label=remote_cancel_text,
)

await dialog_context.cancel_all_dialogs()
else:
# Process a reprompt event sent from the parent.
Expand Down Expand Up @@ -75,3 +81,9 @@ async def run_dialog(
results = await dialog_context.continue_dialog()
if results.status == DialogTurnStatus.Empty:
await dialog_context.begin_dialog(dialog.id)

@staticmethod
def __is_eoc_coming_from_parent(turn_context: TurnContext) -> bool:
# To determine the direction we check callerId property which is set to the parent bot
# by the BotFrameworkHttpClient on outgoing requests.
return bool(turn_context.activity.caller_id)
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async def post_activity(
)
activity.conversation.id = conversation_id
activity.service_url = service_url
activity.caller_id = from_bot_id
activity.caller_id = f"urn:botframework:aadappid:{from_bot_id}"

headers_dict = {
"Content-type": "application/json; charset=utf-8",
Expand Down