Need to route calls based on SIP headers like X-Caller-Type or X-Customer-ID? This guide shows you how to extract SIP header parameters passed from AudioCodes Live Hub into your bot in Microsoft Copilot Studio (formerly Power Virtual Agents).
๐ This setup works for both inbound and transferred calls! For complete instructions, refer to the official Tech Docs.
๐ This setup works for both inbound and transferred calls!
โ What Youโll Learn
How Live Hub sends SIP headers to your bot
How to store these headers in your bot using global variables
How to work with them inside Adaptive Dialogs
Tips for other bot platforms like Google Dialogflow or Rasa
๐ค What are SIP Headers and Why Use Them?
SIP headers are metadata sent with calls, like customer type, campaign ID, or call source. These are passed by Live Hub to your bot automaticallyโif you configure them.
You can use these headers to:
Route VIP customers differently
Personalize the bot greeting
Log values for analytics or support
๐งญ Step-by-Step Setup
๐ง Step 1: Configure SIP Headers in Live Hub
Make sure your SIP Connection settings in Live Hub include the headers you want forwarded to the bot.
โก๏ธ Learn how to do this
๐ง Step 2: Create Global Variables in Copilot Studio
Inside your bot, define global variables to store the incoming header values. For example:
Global.caller Global.sipHeader1 Global.sipHeader2 ...
โ ๏ธ These names must match the ones being passed from Live Hub in the ChannelData payload. This depends on how your SIP headers were defined in the portal.
๐ฌ Step 3: Use Adaptive Dialog Code to Extract SIP Headers
Hereโs a sample snippet to add to your botโs topic using Adaptive Dialog JSON:
{ "$schema": "https://schemas.botframework.com/schemas/adaptive-dialog.json", "kind": "AdaptiveDialog", "id": "main", "triggers": [ { "kind": "OnEventActivity", "actions": [ { "kind": "ParseValue", "variable": "Global.caller", "valueType": "String", "value": "=System.Activity.ChannelData.caller" }, { "kind": "ParseValue", "variable": "Global.sipHeader1", "valueType": "String", "value": "=System.Activity.ChannelData.sipHeader1" }, { "kind": "ParseValue", "variable": "Global.sipHeader2", "valueType": "String", "value": "=System.Activity.ChannelData.sipHeader2" } ] } ] }๐ฏ Adjust the header names to match your actual SIP header keys from Live Hub.
๐ค What About Other Bot Platforms?
You can use this with other frameworks that support incoming webhook payloads and custom JSON parsing.
Bot Platform | Works? | Notes |
Microsoft Bot SDK | โ Yes | Use |
Google Dialogflow | โ Yes | Parse via webhook middleware |
Rasa | โ Yes | Use connector or webhook middleware |
Amazon Lex | โ ๏ธ No | Does not support SIP or header injection |
Twilio Autopilot | โ No | Deprecated and doesnโt support custom SIP integration |
๐ Helpful Resources
๐ Ready to go?
Once your SIP headers are mapped in Live Hub and your bot is set up, you can:
Route calls by header value
Display caller details
Trigger logic based on header types
Need help? Just message our support team or share this doc with your developer ๐
Happy Connecting! ๐ค๐
The LiveHub Team
