https://retellai.com/?utm_source=discord&utm_medium=seo logo
I have a service with multiple domains that share ...
# ❓・ai-evy-support
e
@AI Evy I have a service with multiple domains that share the same IP. Is there a way that when I make a call to your system, it can identify the domain so that the correct agent responds to me?
a
Thanks for tagging me @elisra27. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, you can route calls to different agents using the inbound webhook feature [(1) ]() . When you have multiple domains sharing the same IP, you can set up a webhook URL on your phone number . This webhook allows you to override the agent ID based on conditions you define, enabling you to route calls to the correct agent for each domain . To implement this: 1. Configure an inbound webhook URL in your phone number settings 2. Use the webhook to determine which domain the call is coming from 3. Return the appropriate agent ID based on your routing logic This approach lets you dynamically assign different agents to the same inbound number based on whatever conditions you need .
​ To learn more, see the sources I considered: [[1] multiple agent for same inbound number](https://discord.com/channels/1186424376300679209/1422923667821826058) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
e
@AI Evy But, does that also work when I initiate the call to Retellai? That is, when my system dials yours? I understand that the documentation talks about calls originating from Retellai to my system.
a
Thanks for the follow-up, @elisra27. I'll get back to you soon.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
### Answer You're correct that the inbound webhook feature is specifically for calls coming to Retell AI (when external callers dial your Retell number) [(1) ]() . This feature does not apply when you initiate calls from your system to Retell AI . The inbound webhook is triggered when someone calls your Retell number, allowing you to override the agent ID based on the
from_number
or
to_number
in the webhook payload [(1) ]() [(2) ]() . However, this is the opposite direction from what you're describing. For calls that you initiate (outbound from your perspective, inbound to Retell) , you would need to specify the agent when making the call through the API. The inbound webhook documentation specifically states it "does not apply for dial to sip calls, as you can provide call specific information when you register the phone call" [(1) ]() . So to route to different agents based on domain when your system calls Retell AI, you would need to: 1. Determine the appropriate agent ID in your system based on the domain 2. Specify that agent ID when initiating the call via API The inbound webhook won't help in this scenario since it's designed for the opposite call direction.
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Importing existing phone number to multiple agents via API](https://discord.com/channels/1186424376300679209/1418871771045564509) ​