Dynamic inbound-to-outbound routing to a different SIP trunk (V20)

aman-pandey

Trial User
Joined
Aug 21, 2026
Messages
2
Reaction score
0
Hi team,

I'm using Telnyx's API to originate calls into our 3CX (V20, self-hosted). I need these inbound calls to route back out through a different SIP trunk to a phone number that's different each time — not a fixed number.

I've tried using %DialedNum% and %CalledNum% in an Inbound Rule and in a trunk's Default Route ("Forward to Outside Number"), but both get treated as literal text instead of the actual dialed number, and the call fails. Is there a supported way to do this, or do I need to use DISA or a Call Processing Script instead?
 
Can you explain what the aim is in a bit more detail? Are the Outgoing numbers matched 1-to-1 with the Incoming (per-extension forwarding), or do they change over time (CFD or some other automation)?
 
Thanks for looking into this.

To clarify: it's neither. The outgoing number isn't tied 1-to-1 to any extension, and it's not a schedule/time-based change either — it's decided dynamically, per call, by our own backend application before the call is even placed.

Here's the actual flow: our backend calls Telnyx's API to originate a call, specifying a destination number that varies every single time (different number per call, chosen by our application logic). That call lands on 3CX. We then need 3CX to take that same destination number and dial it back out through a different SIP trunk (Twilio in our case).

So essentially: 3CX needs to read "who was this call actually for" from the inbound leg, and re-dial that same number outbound through a specific trunk — with the number being different on every call, not following any fixed pattern or schedule.

Is there a way to access the inbound call's destination number as a true runtime variable (not a static field), either via CFD or another mechanism?
 

Forum statistics

Threads
111,875
Messages
589,510
Members
164,723
Latest member
aman-pandey