You are here

IAX2 Issue

30 posts / 0 new
Last post
Ai6bx
IAX2 Issue

Greetings!

I am trying to link two Asterisk/FreePBX systems using IAX2. As we do not have an RF link between the two mesh islands we are using a mesh tunnel. Each end shows an active IAX2 trunk on the dashboard page but when dialing a phone on the other end, each receives an all circuits are busy message. We have 5525 forwarded for the tunnel and, after several failed attempts, have forwarded 4569 with UDP at both ends with no change. 

Any ideas?

Thank you,

Keith - AI6BX

w6abj
With out more information it

With out more information it is hard to say? how are your extensions setup? how is your dial plan setup ?

N2MH
N2MH's picture
General Idea

To help you in your thinking, when you trunk between PBX's, one PBX has to send a number to the other PBX to complete a call. In a little more detail, the PBX on the originating side has to know number(s) that are on the other PBX. It takes this number, and sends it across the trunk to the other PBX. Finally, the PBX on the other end has to take this incoming number and send it to the desired extension. For calls going in the other direction, this process is reversed.

In asterisk, the dial plan in the originating phone's context must have an entry for the number on the other PBX so it can send the call to the outgoing trunk. The outgoing trunk then sends this number to the destination PBX. The trunk definition on the destination PBX must then have an entry to send this call to the terminating phone's context. If any of these routing statements are missing, the call will not go through.

I'm not sure what terminology FreePBX uses for this. I think "Outbound Routes" is the routing on the originating PBX and "Incoming Routes" is the routing on the incoming PBX.

w6abj is correct - you have to have a clear idea of what extensions live where and then how to get from one to the other. The term "dial plan" encompasses this whole idea (what extension number goes where). If you can relate that information here in another post, we can better help you.

Also, be sure to watch the asterisk console in real time when calls are placed. With a little experience, you can tell where calls are going. If you can have both consoles up on one screen at the same time, you can tell if the call actually made it across the trunk. Ultimately, with both screens up, you can see the call go from one phone to the other phone.

Mark
 

KE6UPI
IAX *Updated

Keith, IAX2 doesn't care about NAT like SIP does. So the question is, can you ping both Asterisk servers ping each other?

Simple IAX2 setup.
http://www.voip-info.org/wiki/view/Asterisk+Connect+2+servers

If you want a little more then a simple PBX and want to try app-rpt take a look at www.allstarlink.org (No FreePBX) or www.xelatec.com/xipar/ (With FreePBX).

David KE6UPI

P.S. App-RPT has built EchoLink and can be installed on a Raspberry Pi.

ag6if
ag6if's picture
Extensions are set up as a TIE LINE.

Extensions are set up as a tie-line environment, as any sort of mapping extensions in a large mesh will be impossible to document and manage.
For example, in my case, I set up *81 to hit Keith's trunk.
I dial *81 and then any extension number that Keith has identified.   Duplicate extensions within the many systems will not be a problem this way.

() + *81 | .  "If a user dials *81 and then dials anything, the *81 will be removed and the rest of the numbers will be sent to System2."
The trunk appears healthy, except for 'all circuits are busy'
73
Jim AG6IF
 

Ai6bx
IAX2 info from status tab

Does the (E) in the status line mean anything? This is taken from one of the servers and is identical on the remote server only with the remote IP and host name.
 

			
Name/Username    Host                 Mask             Port          Status      Description                     
AG6IF            10.67.79.232    (S)  255.255.255.255  4569 (T)      OK (231 ms)                                 
AG6IF-Link/AG6I  10.67.79.232    (S)  255.255.255.255  4569 (T)  (E) OK (110 ms)                                 
2 iax2 peers [2 online, 0 offline, 0 unmonitored]
		
KE2N
KE2N's picture
(E)

This  means the data on the link is Encrypted.  You have turned that on in your config.
Note that if you have a registered trunk with a user id and password, encryption is used in authenticating the connection but that does not mean the subsequent data is encrypted.  For data encryption to happen, you must have put:
encryption=aes128
or
encryption=yes
somewhere in your config file.

 

Ai6bx
Mark - email me

Mark if you can email my your number at ai6bx@arrl.net I will call you back.

Thanks,

Keith

Ai6bx
Encryption

thanks for the tip on the encryption. I have removed this and also removed scripting from the inbound route configured as I found a thread regarding this. Both ends are identical and both show the iax trunks as active. Asterisk servers are able to ping each other at this point and both still report "all circuits busy" when extensions are dialed on the other. Each side is using the *80 prefix to designate the use of the iax circuit.

KE2N
KE2N's picture
busy

The "all circuits busy" will happen when the two ends sharing the IAX trunk encounter a problem when actually trying to USE the trunk. There are a number of things that can cause this.  I have found the log files from free PBX not very useful.  

As an alternative, you can log into your asterisk system, turn up the debug level (core set debug 5) and watch the command line when a call is attempted. You may see something there hinting at the problem being encountered.

If you post your details here some expert may be able to spot the problem.

I would note that naming is critical and case matters. Both ends need to match up precisely.

 

K5DLQ
K5DLQ's picture
as I recall, the command to

as I recall, the command to see verbose debug info is:

asterisk -rvvvv

 

ag6if
ag6if's picture
thank,    asterisk -rvvv  

thank,    asterisk -rvvv   worked..      basically, nothingn new on the console, same info that is going into my log file.
This may be the common consistant issue:

-- Executing [continue@macro-dialout-trunk:1] NoOp("SIP/103-00000026", "TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 50 - failing through to other trunks") in new stack.

Neither Keith or I see each others dial attempts in our own logs.
73
Jim AG6IF

 

KE2N
KE2N's picture
debug

yes that is correct if you are sitting at the OS command line.  The number of v's is the debug level.
If you are already logged into an asterisk session, then core set debug <n> is how you change the debug level.
n runs from 1 to 7 I think.  0 (zero) means off.
I find 5 to be helpful at times. 
 

KE6UPI
Trunk details

Hey Jim, Can you paste your IAX trunk details for both servers? Looking at your iax show peers. Both servers has the same IP addresses. This means that server AG6IF will only take an iax connection from what ever IP address is given in "iax show peers" So AG6IF thinks AG6IF-Link/AG6I IP address is 10.67.79.232. Plus I don't think you need to tunnel. "I think." If both Aredn router devices can ping each other on the Aredn Network i.e. ping 10.67.xxx.xxx.

You'll have to use your devices Aredn Network IP address and port forward iax UDP 4569 to your PBX. Your Register String should look like this ag6if@10.67.xxx.xxx. Then your Aredn device would port forward UDP 4569 to your PBX on your LAN network. 

If your using
auth=
encrtption=
delete them for now.

you should only need:
type=friend
host=dynamic
username
secret=

I'll be out for day and should be back tonight. I'll monitor the GTARC 2m repeater when I get home.

Lets document this and post it to Aredn's website when we get it working.

David KE6UPI

KE2N
KE2N's picture
address

Each end of the trunk should be showing the address of the other end in "iax2 show peers". 
If it is a "register" type of trunk then the leftmost should show the trunk name and user name - I noticed the first one has no user name.
With a user name, you need a password too (and I think the passwords need to be the same on both ends).

On a common 10.x.x.x mesh network no tunnel is required.  
They can even be on different networks with routers in between - no tunnel require there either ... although you then have to use the address on the WAN side of the router..
 

ag6if
ag6if's picture
this is from my end.  The IP

this is from my end.  The IP is Keiths ASterisk box, and the port 4569 is open.

I added 4569 to my mesh forward screen, however, the sniffer trace proved it was working prior, in other words, I was seeing packets from his end, port 4569 (udp)


ag6if-raspbx*CLI> iax2 show peers
Name/Username    Host                 Mask             Port          Status      Description                     
AI6BX            10.80.3.84      (S)  255.255.255.255  4569 (T)      OK (68 ms)                                  
ai6bx-raspbx/ai  10.80.3.84      (S)  255.255.255.255  4569 (T)      OK (55 ms)                                  
2 iax2 peers [2 online, 0 offline, 0 unmonitored]


 

ag6if
ag6if's picture
Keith posted the trunk status

Keith posted the trunk status from his end.
I posted the trunk status from my end, (showing his user name etc.)

The 10.67 address is my asterisk box here at my mesh network. 
the udp poke/ack between the servers appears to be working (seeing packets using iptraf) , and the trunks are showing as connected.
 

ag6if
ag6if's picture
from the PEERS set.

from the PEERS set.

username=ai6bx
host=10.80.3.84
secret=password
deny=all
allow=g729&alaw
type=friend
context=from-internal
qualify=yes
qualifyfreqok=25000
transfer=no
trunk=yes
forceencryption=no
encryption=no

and from the USER set

context=from-internal
host=10.80.3.84
deny=all
allow=g729&alaw
qualify=yes
secret=password
trunk=yes
type=friend


 

ag6if
ag6if's picture
here is the stats when a call

here is the stats when a call via the iax trunk is in progress.  (listening to all circuits are busy now)
This is the command I constructed...(i'm using linux to wrap the extremely defective asterisk console functionality--lacking pagers grep, etc..  )

watch -n 10 "asterisk -rx 'iax2 show channels' "

Channel               Peer             Username    ID (Lo/Rem)  Seq (Tx/Rx)  Lag      Jitter  JitBuf  Format  FirstMsg    LastMsg
(None)                10.80.3.84       ai6bx       17031/08365  00002/00002  00000ms  0000ms  0040ms  Unknow  Tx:NEW      Tx:ACK
1 active IAX channel

 

KE2N
KE2N's picture
debug

My pi-trunk lines do not have anything at all in the User Details section - it is not required for this sort of trunk.
I think if you are using a password you need auth=md5 on both ends
It has to know how to handle the password authorization exchange (not sure if there is a default).

that error code 50 would seem to be related to this:
http://www.voip-info.org/wiki/view/Asterisk+No+authority+found

From the asterisk CLI you could turn IAX debugging on 
iax2 set debug on
you may see that the auth fails 

also
allow=g729&alaw
is not something I have seen before try doing it with two lines
allow=g729
allow=alaw
. . .



 

ag6if
ag6if's picture
i split the allows into 2

i split the allows into 2 lines, and the gui put them back together...interesting.

KE2N
KE2N's picture
weird

yeah - mine did that too.

The reason I have not seen it before is that I have not put anything at all about codecs in my PEER details.  
FreePBX finds the codecs somewhere else and puts them in the internal config file just fine without my "help".
  /etc/asterisk/iax_general_additional.conf

Another thing you can leave blank is the "context"  FreePBX will make one for you.  
I note that "from-internal" is one that is already in use by FreePBX - not sure if that could cause problems ...
 

ag6if
ag6if's picture
thank you,

thank you,
after you sent keith 2 files to get away from gui, I couldnt get the outbound route to attach to the iax trunk, but I added the commands that you sent, to a brand new gui aix trunk and it works fine now.
I can call Keith and he is working to get his end fixed up.
here are the commands i inserted in the PEERS gui box.

host=ai6bx-raspbx
secret=<redacted>
type=friend
auth=plaintext
context=from internal   <---edit as of 8/28/16 2am, this line is missing a - between FROM and INTERNALl..fixed, works now!
disallow=all
allow=ulaw
qualify=yes
transfer=no

Once this was in, then I could go to outbound route and select the trunk.  (that wasnt available when just using the /etc/asterisk/..  file method.
getting close!!
73
Jim AG6IF


 

KE2N
KE2N's picture
progress

I think the "auth= " was the key to getting the trunk to connect. Per my previous post - when you use a password, you need to specify how it will  be handled in authorizing.  Over a part-97 the communications cannot be encrypted, but I think it is widely accepted that checking of "hashed" passwords is not a problem. .

KE6UPI
Hey Jim, 

Hey Jim, 

Both host have the same IP addresses. I'm not following this.

Server "A" AG6BX 10.80.3.84

Server "B ai6bx-raspbx/ai 10.80.3.84

ag6if-raspbx*CLI> iax2 show peers
Name/Username    Host                 Mask             Port          Status      Description                     
AI6BX            10.80.3.84      (S)  255.255.255.255  4569 (T)      OK (68 ms)                                  
ai6bx-raspbx/ai  10.80.3.84      (S)  255.255.255.255  4569 (T)      OK (55 ms)                                  
2 iax2 peers [2 online, 0 offline, 0 unmonitored]


Peer settings should be host=dynamic not host=IPAddress. Also IAX doesn't need USER setup in freepbx.

David

ag6if
ag6if's picture
David,

David,

server A has PEER and USER configs, (10.80.3.84)  what you are seeing above

serverB has PEER and USER configs  (10.67.79.239)

 

ag6if
ag6if's picture
I removed the USER config

I removed the USER config info, this is the trunk status from me end now... NO change, 'all circuits are busy'

								
Name/Username    Host                 Mask             Port          Status      Description                     
ai6bx-raspbx/ai  10.80.3.84      (S)  255.255.255.255  4569 (T)      OK (49 ms)                                  
1 iax2 peers [1 online, 0 offline, 0 unmonitored]

KE6UPI
Ok that looks better. Its

Ok that looks better. Its been a long time since I used freepbx. So try context=from-internal or context=pstn in your PEER settings. Your server needs to what context to use. From the command line type asterisk -vvvvvvvr then have the user make a call. See if their is any errors.

ag6if
ag6if's picture
Keith is working on making changes to his end

Keith is working on changes to his end at the moment, but my end works great going to his system.
here is part of my log.   note, only 1 codec now, instead of formerly having 2...not sure what the effect of that is..but for now.... yay!


[2016-08-27 17:01:01] VERBOSE[3132][C-00000009] app_dial.c: -- Called IAX2/ai6new/7004
[2016-08-27 17:01:01] VERBOSE[1379][C-00000009] chan_iax2.c: -- Call accepted by 10.80.3.84 (format ulaw)
[2016-08-27 17:01:01] VERBOSE[1379][C-00000009] chan_iax2.c: -- Format for call is (ulaw)
[2016-08-27 17:01:01] VERBOSE[3132][C-00000009] app_dial.c: -- IAX2/ai6new-466 is ringing
[2016-08-27 17:01:01] VERBOSE[3132][C-00000009] app_dial.c: -- IAX2/ai6new-466 is ringing
de Jim AG6IF

ag6if
ag6if's picture
ok, both ends are working as

ok, both ends are working as expected....yay!!

As you recall, my end could call Keith but he couldn't call me.
The config on my end was  missing a single -  in the context=from internal        that is it!!
73  Jim AG6IF
16-08-28 01:25:29] VERBOSE[9079][C-00000008] pbx.c: -- Executing [s@macro-dialout-trunk:23] Dial("IAX2/Ag6if-m-9686", "IAX2/Ag6if-m/103,300,Ttr") in new stack
[2016-08-28 01:25:29] VERBOSE[9079][C-00000008] app_dial.c: -- Called IAX2/Ag6if-m/103
[2016-08-28 01:25:30] VERBOSE[1735][C-00000008] chan_iax2.c: -- Call accepted by 10.67.79.232 (format ulaw)
[2016-08-28 01:25:30] VERBOSE[1735][C-00000008] chan_iax2.c: -- Format for call is (ulaw)
[2016-08-28 01:25:30] VERBOSE[9079][C-00000008] app_dial.c: -- IAX2/Ag6if-m-3291 is ringing
[2016-08-28 01:25:31] VERBOSE[9079][C-00000008] app_dial.c: -- IAX2/Ag6if-m-3291 is ringing
[2016-08-28 01:25:34] VERBOSE[9079][C-00000008] chan_iax2.c: -- Hungup 'IAX2/Ag6if-m-3291'
[2016-08-28 01:25:34] VERBOSE[9079][C-00000008] app_macro.c: == Spawn extension (macro-dialout-trunk, s, 23) exited non-zero on 'IAX2/Ag6if-m-9686' in macro 'dialout-trunk'

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer