Bridge an outbound call to an internal user

Hi everyone,

Here’s an extension to my diaplan that handles incoming calls to +33123456789:

   <extension name="Inbound-3CXuser">
      <condition field="destination_number" expression="^\+33123456789$">
         <action application="bridge" data="user/3CXuser"/>
      </condition>
   </extension>

The call is successfully transmitted to my user except with a SIP INVITE of this form:

<sip:3CXUser@[3CX_IP]:5060>

This doesn’t work for me since the user 3CXUser is also a PBX, the ideal form of the SIP invite would be as follows:

<sip:{destination number}@[3CX_IP]:5060>

So that the call can be routed to the correct user in the remote 3CX.

Thanks for your help.

Cédric

Try this:

<extension name="Inbound-3CXuser">
   <condition field="destination_number" expression="^\+33123456789$">
      <action application="set" data="sip_invite=sip:${destination_number}@3CX_IP:5060;transport=tcp"/>
      <action application="bridge" data="sofia/external/${sip_invite}"/>
   </condition>
</extension>