I’m new to FreePBX and we are using FreePBX 18.104.22.168.
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:
Invite-IN Recv Req INVITE from 22.214.171.124:5060 tid=Pj29ce2625-a7f3-4698-8988-1c0dbb5ada3f Call-ID=3765aaed-51c3-4bc6-a1a4-53abff9d3aa2:
INVITE sip:[email protected]:5060;rinstance=dd41e0f3640002fb SIP/2.0
Via: SIP/2.0/UDP 126.96.36.199:5060;rport=5060;branch=z9hG4bKPj29ce2625-a7f3-4698-8988-1c0dbb5ada3f
Contact: <sip:[email protected]:5060>
To: <sip:[email protected];rinstance=dd41e0f3640002fb>
From: "0412345678" <sip:[email protected]>;tag=66f658df-916d-4057-811a-bc656e0c2602
CSeq: 2119 INVITE
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
P-Asserted-Identity: "0412345678" <sip:[email protected]>
o=- 1437439270 1437439270 IN IP4 188.8.131.52
c=IN IP4 184.108.40.206
m=audio 15556 RTP/AVP 107 9 18 0 8 3 101
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.
If the called device is another PBX, SIP proxy, SBC, etc., you would normally set it up as a trunk. Why did you choose an extension?
The functionality and integration into our other systems worked better with extensions than creating a trunk.
There is a module that, if you can pass through it, called SetUserID(), which may be useful.
There are also a lot of settings about RPID and other functions and settings that should get you where you want to go.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.