I’m new to FreePBX and we are using FreePBX 14.0.13.4.
I would like to use a second DID from the inbound trunk out to route to a registered extension and pass the DID in the call information so we can route it on the extension. I’ve spent a few hours looking through documentation and these forums but have not had any luck.
It seems like a pretty standard thing to do and I assumed it could be done by setting the context on the trunk to “from-pstn-toheader” but this has not changed the outbound call details to the extension to send the DID I want. I am now starting to think it could be because we are using the pjsip driver but I’ve posted here for some help.
I’ve changed the numbers and IP addresses for privacy.
The extension is registered as 0261123456 and we have a second inbound route 0261123457 but the DID information is not included in the call to extension despite registering in the CDR reports in DID column.
Does anyone have any advice? Do I need to use a custom extension to get this functionality?
The logs on the receiving device is reporting the following:
I’m sure we do, and I’m sure you won’t need a custom extension, however, having said that, I can’t make heads or tails out of what you are saying. I recognize all of the words, but they just give the request an air of “I saw this in a spy movie” vibe that I just can’t figure out.
It might help to understand that FreePBX (and by extension Asterisk) is a Back to Back User Agent, so all calls logically terminate or originate in the PBX. Every call is actually (at least) two calls one in and at least one out. The calls are “bridged” in Asterisk so they appear to be a single call - even though the are actually separate call legs managed and handled by the PBX.
As an aside, this is why you get a CDR record for every destination in a Ring Group - they are all calls to the extensions in response to an incoming call from outside.
So, a call comes in associated with a DID. This passes the call and the DID to the Inbound Routes list. A route matches your criteria (DID or CID) and the call is processed. You pick a destination in the route for that call. That routes the call.
Setting the context to “from-pstn-toheader” handles pulling the DID into the DID variable from the TO header instead of one of the other ways of getting the DID and allows your Inbound Route to match the DID. The rest is simply call direction and handling by connecting the system’s modules to the route.
Thank you for you clarification as your reply does help, I’ll attempt to explain it again as I am still learning FreePBX and Asterisk.
We want the DID from the incoming call from the trunk to sent to the extension on the second call initiated by FreePBX. This occurs on a trunk in FreePBX but not on extensions. We may have this set up incorrectly and extensions can not provide this capability. In short, we want an extension to have trunk functionality.
Researching more I found this is around the context set on extensions which is from-internal and we are looking for the functionality of from-pstn.