https://retellai.com/?utm_source=discord&utm_medium=seo logo
We are currently using your outbound AI agent to c...
# ❓・ai-evy-support
c
@AI Evy We are currently using your outbound AI agent to contact prospects. However, if a prospect calls that number back (inbound), we'd prefer they speak to a human. Is there a way to configure the system to forward all incoming calls directly to our in-house call center instead of having the AI answer them?
a
Thanks for tagging me @chuu. I'll look through relevant sources and get back to you shortly.
### Answer Yes, you can configure your phone number to handle outbound and inbound calls differently. Option 1: Set inbound agent to null You can update your phone number to have an
outbound_agent_id
configured while setting
inbound_agent_id
to
null
. This means the number would not accept inbound calls. [(1) ]() [(2) ]()
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneNumberResponse = await client.phoneNumber.update('+14157774444', {
  inbound_agent_id: null,
  outbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
}) ;
[(2) ]() Option 2: Use an inbound webhook for custom routing You can set an
inbound_webhook_url
on your phone number. This webhook fires for inbound calls and allows you to override agent behavior or implement custom routing logic for each call.
Copy code
javascript
const phoneNumberResponse = await client.phoneNumber.update('+14157774444', {
  outbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
  inbound_webhook_url: '<https://example.com/inbound-webhook',>
}) ;
Option 3: Create an inbound agent that immediately transfers You could create a minimal inbound agent configured to immediately perform a warm or cold transfer to your in-house call center number. [(3) ]() The simplest approach for your use case is Option 1 (setting
inbound_agent_id
to
null
) if you want to reject inbound calls entirely, or configure call forwarding at your telephony provider level to route those calls to your call center.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Outbound Calls (Make Calls)](https://docs.retellai.com/deploy/outbound-call) [[2] Update Phone Number](https://docs.retellai.com/api-references/update-phone-number) [[3] AI Call Center: Automate Calls With Conversational AI | Retell AI](https://www.retellai.com/ai-call-center) ​
c
@AI Evy We're using a Twilio phone number on the agent and in order to do that, we connected to the Twilio account via SIP trunking - but due to this, I don't think we can set up call forwarding through Twilio the way we normally would so it seems it has to be done through Retell instead.
a
Thanks for the follow-up, @chuu. I'll get back to you soon.
### Answer --- Since you're using Twilio via Elastic SIP Trunking, you have a few options to route inbound calls to your call center instead of the AI: Option 1: Set
inbound_agent_id
to null
You can update your imported phone number to disable inbound AI handling entirely. [(1) ]()
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneNumberResponse = await client.phoneNumber.update('+14157774444', {
  inbound_agent_id: null,
  outbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
}) ;
With
inbound_agent_id
set to null, the number would not accept inbound calls through Retell. You would then need to configure the origination routing on your Twilio Elastic SIP Trunk to point inbound calls directly to your call center instead of Retell's SIP server (
sip:sip.retellai.com
) . [(2) ]() Option 2: Use an inbound webhook for custom routing You can set an
inbound_webhook_url
on your phone number. [(1) ]() This webhook fires for inbound calls, allowing you to override agent behavior or implement custom routing logic. [(3) ]()
Copy code
javascript
const phoneNumberResponse = await client.phoneNumber.update('+14157774444', {
  outbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
  inbound_webhook_url: '<https://example.com/inbound-webhook',>
}) ;
[(1) ]() Option 3: Create a minimal inbound agent that immediately transfers You could create an inbound agent configured to immediately perform a cold or warm transfer to your call center number. [(4) ]() For your use case, Option 1 combined with reconfiguring your Twilio SIP trunk origination to route inbound calls directly to your call center (bypassing Retell entirely for inbound) is likely the cleanest approach.
​ To learn more, see the sources I considered: [[1] Update Phone Number](https://docs.retellai.com/api-references/update-phone-number) [[2] I’m trying to use a toll-free number (connected from Twilio through a SIP trunk)](https://retell.discourse.group/t/i-m-trying-to-use-a-toll-free-number-connected-from-twilio-through-a-sip-trunk/127) [[3] Receive calls](https://docs.retellai.com/deploy/inbound-call) [[4] Help on Twilio DID questions](https://retell.discourse.group/t/help-on-twilio-did-questions/24) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the feedback, glad I was helpful.