SOLVED IAX2 server to server trunk no external calls

tech1

New Member
Joined
May 18, 2011
Messages
14
Reaction score
0
PBX in a Flash Version = 1.7.5.5,FreePBX Version = 2.8.1.4,Running Asterisk Version = k 1.6.2.18,Operating System = CentOS release 5.6 (Final),Kernel Version = 2.6.18-194.26.1.el5 - 64 Bit
I have 2 asterisk servers connected by IAX2 trunk thru T1 point to point. Server A is at my main location and Server B is at my second location. My Server A is connected to a cable modem for internet access and my Server B location goes thru Server A location for internet access. I have my VoIP provider trunk configured on Server A. I can dial from ext to ext on either server thru the IAX2 trunk. I can call from Server A to another business or outside number ok. However, when I dial an outside line from Server B my DID is tagged with the number I am dialing and the call is not processed by my provider. How can I control the DID tag in the IAX2 protocol from Server B. I am attaching the log of a test call for your inspection.
 

Attachments

  • TrunkToTrunkDID.txt
    9.5 KB · Views: 34

blanchae

Guru
Joined
Mar 12, 2008
Messages
1,910
Reaction score
9
On the trunks, you can check-off the Intracompany Trunk box. It's purpose is to allow the extensions CID to override the trunks. See if that helps.
 

tech1

New Member
Joined
May 18, 2011
Messages
14
Reaction score
0
Intracompany

Good Idea. I am assuming you are talking about the matching outbound route to enable the intracompany flag. This is already checked or enabled.
 

blanchae

Guru
Joined
Mar 12, 2008
Messages
1,910
Reaction score
9
Reread your post and had to draw a picture with a summary:

Server B => IAX2 => Server A => SIP => ISP

When Server A receives an outbound call from Server B to send to the ISP. Your DID is replaced with Server B's destination DID number. And your ISP's rejecting the call.

On your Server A trunk to the ISP, do you have Outbound Caller ID set?

TrunkAddIAX2.JPG
 

tech1

New Member
Joined
May 18, 2011
Messages
14
Reaction score
0
Need DID to from Server B sent thru IAX2 trunk to Server A

I tried making the change you recommended but the debug on ServerA still looks the same referencing the _DID

Log From ServerA Debug
-- Executing [NumberIAmDialing@from-trunk:1] Set("IAX2/ToCECIAXpeer-12867", "__FROM_DID=NumberIAmDialing") in new stack
-- Executing [NumberIAmDialing@from-trunk:2] NoOp("IAX2/ToCECIAXpeer-12867", "Received an unknown call with DID set to "NumberIAmDialing") in new stack
-- Executing [NumberIAmDialing@from-trunk:3] Goto("IAX2/ToCECIAXpeer-12867", "s,a2") in new stack
There has to be somewhere on ServerB that I can tell it to send DID x to ServerA for routing but I just cant seem to logically find it.
 

Linetux

Guru
Joined
Oct 5, 2008
Messages
541
Reaction score
1
Do you have the proper Outbound CID set on the extension trying to make the call? It's set per-extension on the server the extension is registering with.
 

tech1

New Member
Joined
May 18, 2011
Messages
14
Reaction score
0
Did

I tried inserting my external Caller ID number for my extension on Server B but the _DID is still the number I am dialing.
Server B Extension Options - Outbound CID I put number A (my external dial in phone number) and in the debug on Server A it has the number I am dialing for the _DID.
 

Linetux

Guru
Joined
Oct 5, 2008
Messages
541
Reaction score
1
You still haven't answered Blanchae's question - do you have a CID set on the IAX trunk being used?
 

tech1

New Member
Joined
May 18, 2011
Messages
14
Reaction score
0
Sorry, I was not clear. I inserted my external number in the CID field of ServerB on my IAX2 trunk and the debug on ServerA for _DID is the number I am dialing.
 

Linetux

Guru
Joined
Oct 5, 2008
Messages
541
Reaction score
1
I never use trunk CID's.

I always set the CID on the extension and let it be handled that way - sometimes my routing will send a call as a failover event, and I want the extension to give the CID, not the trunk.

Try clearing the CID setting (on all trunks) and, with the CID set on the extension, it should send as expected.
 

blanchae

Guru
Joined
Mar 12, 2008
Messages
1,910
Reaction score
9
Try this: On Server A's IAX2 trunk to Server B, set the context=from_internal instead of from_trunk. This will treat the calls coming in from Server B as internal calls and they will obey the outgoing route rules of Server A as if they were a directly attached extension.
 

tech1

New Member
Joined
May 18, 2011
Messages
14
Reaction score
0
I think I finally discovered how to make this work. On ServerA, my IAX2 trunk I had User Context - Context=From-Trunk and I changed this to Context=From-Internal. I also changed this setting on ServerB. Voila, I can call external numbers from ServerA/ServerB and my callerID is being set correctly by my VoIP DID provider.

Thanks to all for trying to help. The IAX2 setup has a few gotchas
1) make sure asterisk versions are the same on both servers. Seems IAX2 versions have to be the same
2) Make sure you have requirecalltoken=no in peer details (this is dependent on asterisk versions I am told) I am using 1.6
3) Seems in the trunk setup the trunk name in both spots needs to be the same and they have to match the username under peer details
4) trunk-peer details has to have trunk=yes if you want ext and callerid to be correct
5) if you have problems with trunk debug asterisk at level 12 make sure second server is being hit and then debug the peer of the second server for any issues.
All of the above suggestions are my perceived requirements that may of may not be true, however, this is what worked for me and I am trying to be helpful to others
 

tech1

New Member
Joined
May 18, 2011
Messages
14
Reaction score
0
Blanchae you win the prize. I was just changing settings on my own to see if anything works. The internal setting instead of trunk worked
 

blanchae

Guru
Joined
Mar 12, 2008
Messages
1,910
Reaction score
9
Thanks for the summary, that will help others who wander down the same path.
 

blanchae

Guru
Joined
Mar 12, 2008
Messages
1,910
Reaction score
9
If you think of the PBX as a firewall, you have inbound and outbound rules. The context=from-trunk applies calls using inbound rules.
The context=from-internal applies calls using outbound rules.
 

Chris Gicale

Member
Joined
Oct 17, 2016
Messages
38
Reaction score
3
I have same issue with this subject. Following this thread solve my problem. Kudos!
 

Members online

Forum statistics

Threads
25,825
Messages
167,848
Members
19,250
Latest member
mark-curtis
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top