DynamicRoute Match = Outbound Call

I have a dynamic route that I am looking up the ${FROM_DID} variable against a table

If I find the number, I return a route to 10-digit phone number THAT IS NOT ON THE PBX ${DYNROUTE_PBROUTETO}

How do I send this call to the outbound routes? I was thinking of using a custom destination to from-pstn,
but is that right context/am I remembering correctly? Will that send the call to the outbound routes?


Yes, using a custom destination to route the call to from-pstn,${DYNROUTE_PBROUTETO},1 would be a suitable approach to send the call to the outbound routes.

  • from-pstn: This is the context typically used for inbound calls coming from the PSTN (Public Switched Telephone Network). It’s a common entry point for inbound calls into FreePBX.
  • ${DYNROUTE_PBROUTETO}: This variable contains the destination number that you’ve looked up in your dynamic route table. It should be the 10-digit phone number that you want to route the call to.
  • 1: This represents the priority of the route within the context. In this case, priority 1 means it’s the highest priority within the from-pstn context.

Assuming ${DYNROUTE_PBROUTETO} contains the desired 10-digit phone number that is not on the PBX and needs to be routed out, using this custom destination will direct the call to the specified number through the outbound routes configured in your FreePBX system.

Best Regard
Danish Hafeez | QA Assistant

1 Like


If you still have trouble, use pjsip logger to see whether issues with caller ID or destination formatting.


I think the normal contexts are logically named. If a call is coming from the pstn, you want it to hit an inbound roure and so use the from-pstn context. If a call is being dialed from an internal location, it will use an outbound route using the from-internal context.

The use case here is from-internal, but there’s another lesser known context for this use case, outbound-allroutes. This context will skip eveything like feature codes, local extensions, queues, ring groups, etc and proceed right to the outbound routing rules.

Sorry, but this post is quite misleading.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.