Search code examples
botframeworkmicrosoft-teams

Botframework not working Action Call in HeroCard


I want to have a Call button in response Chat over Botframework teams

The doc refer to https://github.com/Microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#card-action

An action of type call represents a telephone number that may be called.

    const buttons = [
    { type: ActionTypes.OpenUrl, title: '1. Open URL', value: encodeURI('http://www.google.com') },
    { type: ActionTypes.Call, title: '2. Call with tel:', value: 'tel:08001323333' },
    { type: ActionTypes.ImBack, title: '3. Uploaded Attachment', value: '3' },
    { type: ActionTypes.Call, title: '4. call without tel:', value: '45456544' },
  ];

  const card = CardFactory.heroCard('', undefined, buttons, {
    text: 'Select your choices.',
  });

But the result under Teams desktop app is: ActionType.Call is missing

Is there any way to show a "call button" ?


Solution

  • Much of the Bot Framework schema is channel-specific, especially when it comes to cards. If you'd like to know what card actions Teams specifically supports, you should refer to the Teams docs: https://learn.microsoft.com/microsoftteams/platform/task-modules-and-cards/cards/cards-actions

    Since Teams does not support call actions, you need to use open-URL instead. Using a tel URL won't work, but you can read about that problem and a workaround here: how to make callto: works in adaptive card