ElevenLabs + 3CX: Passing through Caller ID

10

Since my last post about linking ElevenLabs and 3CX, there’s another setting that will make the integration experience better.

Passing through caller ID

By default, an outbound call via a SIP trunk in 3CX will pass through the outbound caller ID as defined in the trunk, extension or department. This doesn’t work for forwarding calls out of 3CX to your AI voice agent, so we’ll need to make some changes to the trunk to ElevenLabs.

Unfortunately, since 3CX version 20, it’s not so straight forward to simply update the outbound caller ID anymore, and instead requires exporting and re-importing the trunk config:

  1. Export your SIP trunk from Voice & Chat (Click … -> Export)
  2. Save the file as Provider.pv.xml and edit it in a text editor.
  3. Find the section:
    <field name=”ParameterOut” custom=”” parameter=”FromUserPart”>$OutboundCallerId</field>
  4. And update the value to:
    <field name=”ParameterOut” custom=”” parameter=”FromUserPart”>$OriginatorCallerId</field>
  5. Save the file and import it back into 3CX: Admin -> Advanced -> Templates -> Provider Templates -> Import Provider
  6. Setup your outbound rules as required.

Now when calls are passed through to ElevenLabs, you can add the caller ID as a variable (system__caller_id) to be used in your prompts and tools, as well as being stored in the agent logs. You might want to use the caller ID to call tools like looking up a customer in a CRM or sending a verification SMS.

10 Comments

  1. Great article !!!
    I was in hell with this issue, spending days and testing why i was not able to receive the original caller id when forwarding calls.
    You save my mental health !!!
    Thank you

  2. i’am having issue connecting my freepbx to the elevenlabs ai agent , i dont have a ip number so i use zoiper as an extension to call , and when i call i have busy , my freepbx receive the call but dont know where to send it , in my freepbx the trunk i made to elevenlabs is not registrated , in elevenlabs it’s said that elevenlabs dont need a registration , so my question is is it normale that my trunk is not registrated in freepbx ? if someon can help

  3. Hi Ben,
    Hi Ben, thanks for your interesting blog posts. I’ve updated our template and now include the caller ID, but the problem is that the Elevanlabs agent isn’t answering anymore. When I reset the template to the original, the agent works again.

    • Hi Catharina, have you got your Phone number setup in ElevenLabs to accept calls from only allowed numbers?

      • HI Ben, thanks for the quick response. No, I left the line in Elevenlabs blank so all numbers should be allowed.

        • Might need to do a packet capture to look at the SIP flow using sngrep or tcpdump. I have found most often when ElevenLabs doesn’t answer, it’s because SIP digest credentials are set, the source phone number is not in the whitelist (if set) or the phone number is malformed (E164 format).

          • Everything mentioned above is configured correctly (SIP authentication, IP and number whitelisting, E.164 format). However, as soon as I modify the template according to your suggested settings and import it, the agent stops answering.

            When I restore the original template, everything works again: I can transfer calls, the agent follows the script correctly, in case of a calamity I can transfer to a human (external number), and for general questions I can route the call to a different agent ID.

            At the moment, we are setting up warm transfers (announced transfers), which is quite challenging (tips are welcome:-) . The main drawback right now is that we have to configure a separate agent per call flow, because we cannot get working while keeping the agent responsive.

            Once works properly, we will be able to reuse a single agent for multiple incoming call flows, each with a different script based on .

          • Please check that you haven’t set an “Allowed Numbers” whitelist in your phone number configuration in ElevenLabs for your normal outbound number. If you haven’t, you might need to do a packet capture and compare the SIP traffic between the original template and the new template.

  4. Hi Ben,
    How can I transfer an external call to elevenlabs if a specific IVR option is selected?
    Thanks

    • Since IVRs in 3CX can’t be forwarded to an external number, I’d suggest creating a dummy extension that forwards all calls to your AI agent phone number, then setting the IVR option to forward calls to that extension.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.