Getting extension from assistant-request event
# support
a
Hi, Is there a way to access the dialed extension from the event assistant-request? Our uses call a Number + Extension (e.g. +1234555666,1234) and we want to return an assistant based on the extension.
v
Hi there! 👋 I wasn't able to find specific information on how to directly access the dialed extension from the assistant-request event. However, I can help with understanding how the assistant-request event works and how you might approach returning an assistant based on call information. According to the [documentation](https://docs.vapi.ai/server-url/events), the assistant-request event is sent to your Server URL as a POST request with a JSON payload that includes a call object:
Copy code
json
{
  "message": {
    "type": "assistant-request",
    "call": { Call Object }
  }
}
While I couldn't find explicit details on accessing the extension, the [documentation](https://docs.vapi.ai/api-reference/calls/update) does show that extension fields exist within the system (in "fallbackDestination" and "customer" objects), suggesting that extensions are properties that can be accessed. To implement your use case, you would: 1. Configure your phone number with
assistantId
set to
null
and specify your
serverUrl
as mentioned in the [SIP documentation](https://docs.vapi.ai/advanced/sip) 2. When a call comes in, Vapi will send the assistant-request event to your server 3. Your server code would need to examine the call object to extract the extension 4. Based on the extension, return the appropriate assistant configuration using the format shown in the [server events documentation](https://docs.vapi.ai/server-url/events):
Copy code
json
{
  "assistant": {
    "firstMessage": "Hello, how can I help you today?",
    "model": {
      "provider": "openai",
      "model": "gpt-3.5-turbo",
      "messages": [
        {
          "role": "system",
          "content": "You're an assistant for..."
        }
      ]
    }
  }
}
Do you have any other questions about implementing this workflow? Sources: - [Server URL Events Documentation](https://docs.vapi.ai/server-url/events) - [API Reference Calls Update](https://docs.vapi.ai/api-reference/calls/update)
- [Advanced SIP Documentation](https://docs.vapi.ai/advanced/sip) - [Inbound Support Example](https://docs.vapi.ai/examples/inbound-support)
v
checking if this is resolved/solved for you?