Share via

Send Custom Context with a Teams Calling Bot

Dr Dave H 160 Reputation points
2026-04-07T17:06:26.8666667+00:00

We are using the Graph Cloud Communications API for our Teams Calling Bots and would like to know if it's possible to send custom context on either an outgoing call or a call transfer. We're unable to find any documentation regarding this.

It looks like this is possible when using Azure Communication Services Call Automation (see https://learn.microsoft.com/en-us/azure/communication-services/how-tos/call-automation/custom-context?tabs=csharp ) but we're unable to find any equivalent documentation for using the Graph Cloud Communications API.

We've performed a number of tests and can see that a Teams Calling Bot (using the Graph API) is able to receive custom context via a SIP Direct Routing call; we can see the SIP User-to-user header information presented to the Bot in both the "incomingContext" and "customContext" elements within the microsoft.graph.call object.

However, our attempts to use the "customContext" element on an outgoing call don't produce any errors but don't actually cause any "customContext" to be received by another Bot. Furthermore, the "customContext" element appears to be completely undocumented.

Any help on this matter will be gratefully received. [Moderator note: personal info removed] 

 

Microsoft Teams | Development
Microsoft Teams | Development

Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs

0 comments No comments

2 answers

Sort by: Most helpful
  1. Hin-V 13,570 Reputation points Microsoft External Staff Moderator
    2026-04-07T19:14:00.5866667+00:00

    Please note that our forum is a public platform, and we will modify your question to hide your personal information in the description. Kindly ensure that you hide any personal or organizational information the next time you post an error or other details to protect personal data.  

    Hi @Dr Dave H

    Thank you for sharing your concerns.     

    First, I’d like to clarify that this is a user‑to‑user support forum. Moderators participating here do not have access to backend systems, nor can we directly intervene in Microsoft product functionality. Our role is limited to providing technical guidance and sharing best‑practice recommendations based on reported issues, requests, and scenarios.      

    Currently, I have not found any supported way to send custom context (such as SIP User-to-User headers or equivalent customContext data) on outgoing calls or call transfers using the Microsoft Graph Cloud Communications API for Teams Calling Bots. 

    As far as I know, Graph Cloud Communications is optimized for native Teams bot scenarios (P2P, group calls, meetings). While full SIP header/custom context control is a telephony-focused feature that Microsoft has implemented in ACS (which has deeper PSTN/Direct Routing integration) but not exposed in the Graph API surface for calling bots. 

    If your goal is passing contextual data between calls or across transfers is a requirement, you could consider to Microsoft’s recommended approach is to use Azure Communication Services Call Automation, which provides support for this functionality. 

    Additionally, If you feel this update would improve the user experience and your workflow, we would encourage you to submit your feedback directly to Microsoft. You can do so through the Microsoft 365 Feedback Portal. This ensures your inquiry reaches the Microsoft product team, allowing them to better understand user needs, enhance product experience, and potentially prioritize your request in future updates.    

    I hope this helps. 

    If you have any additional concerns, feel free to comment below. I would be more than happy to assist. 


    Note: Please follow the steps in [our documentation] to enable e-mail notifications if you want to receive the related email notification for this thread. 

    0 comments No comments

  2. Q&A Assist
    2026-04-07T17:06:47.8633333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    With Microsoft Teams Phone extensibility, sending and receiving custom context is supported for Teams calls, but the support is tied to the Calling SDK and Azure Communication Services (ACS) Call Automation, not to the Microsoft Graph Cloud Communications API used by Teams Calling bots.

    From the documented capabilities:

    • "Send custom context as part of call invite (AddParticipant and Transfer)" is supported in:
      • Client Calling SDK ✔️
      • Call Automation ✔️
    • "Receive custom context as part of call invite (AddParticipant and Transfer)" is supported in:
      • Client Calling SDK ✔️
      • Call Automation ✔️
    • "Send and receive SIP headers (UUI and X-header) as part of call invite to and from SIP endpoints" is:
      • N/A for Client Calling SDK
      • ✔️ for Call Automation

    This custom context and SIP header handling is explicitly documented and supported in ACS Call Automation and ACS Calling SDKs, including:

    • User-to-user (UUI) and custom SIP headers for Direct Routing in Call Automation.
    • Custom SIP and VoIP headers, plus UUI, that can be sent and received on invites and transfers.

    In contrast, the Microsoft Graph Cloud Communications API documentation in the provided context only describes incomingContext and the shape of microsoft.graph.call, but does not document any supported behavior for sending customContext on outbound calls or transfers between bots. The customContext element that appears on incoming calls is therefore not documented as a supported, interoperable mechanism for outbound calls via Graph.

    Given the documented capabilities, the supported way to send custom context on call invites and transfers today is via:

    • ACS Call Automation (for server-side workflows), or
    • ACS Calling SDK (for client-side apps),

    not via the Graph Cloud Communications Calling bot API. The behavior observed when setting customContext on an outgoing Graph call (no error, but no context delivered to the other bot) aligns with the fact that this is not a documented or supported feature in Graph.

    To reliably send custom context between endpoints, use ACS Call Automation or the Calling SDK and the documented custom context / SIP header mechanisms, rather than relying on the undocumented customContext field in Graph Cloud Communications calls.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.