Link two Asterisk with iax2

hi good day to all,

I want to link two Asterisk with iax2 and this is my scenario:

SERVER 1 IP 192.168.1.190

iax_additional.conf

[supermex2]
type=friend
username=lufisa1
context=sucursal
secret=12345
host=192.168.34.166
disallow=all
allow=g729
allow=alaw
allow=ulaw
trunk=yes
deny=0.0.0.0/0.0.0.0
permit=192.168.34.166/255.255.255.0
qualify=yes

extensions_additional.conf

[sucursal]
include => internas

[salida]
exten => _6.,1,Dial(IAX2/supermex2/${EXTEN:1})

[micontexto]
include => salida
include => servicios
include => internas

SERVER 2 IP 192.168.34.166

iax_additional.conf

[lufisa1]
type=friend
username=supermex2
context=sucursal
secret=12345
host=192.168.1.190
disallow=all
allow=g729
allow=alaw
allow=ulaw
trunk=yes
deny=0.0.0.0/0.0.0.0
permit=192.168.1.190/255.255.255.0
qualify=yes

extensions_additional.conf

[sucursal]
include => internas

[salida]
exten => _7.,1,Dial(IAX2/lufisa1/${EXTEN:1})

[micontexto]
include => salida
include => servicios
include => internas

when any pbx framework I get the following error:

– Executing [7100@micontexto:1] Dial(“SIP/usuario1-00000003”, “IAX2/lufisa1
/100”) in new stack
[May 21 13:59:41] WARNING[1487]: app_dial.c:2345 dial_exec_full: Unable to creat
e channel of type ‘IAX2’ (cause 20 - Subscriber absent)
== Everyone is busy/congested at this time (1:0/0/1)
– Auto fallthrough, channel ‘SIP/usuario1-00000003’ status is ‘CHANUNAVAIL’

in advance thank you so much your help and your input.

Regards,

Show us the output of the iax2 show peers and the output of when you call with the iax2 enabled. Seems like your peer can’t reach each other.

thanks for answering, advance and appreciate the help:

*CLI> iax2 show peers
Name/Username Host Mask Port Status
demo/asterisk 216.207.245.47 (S) 255.255.255.255 4569 Unmonitored
lufisa1/superme 192.168.1.190 (S) 255.255.255.255 4569 (T) UNREACHABLE
2 iax2 peers [0 online, 1 offline, 1 unmonitored]

That only show one peer of one server, and it show unreachable status so there are some issues for that:

–You don’t have proper contact with the other server, if you can pinging each other check your iptables rules for allow IAX2 port in both servers.

–If you have contact and IAX2 port is open, maybe your IAX2 cfg is bad try adding the requirecalltoken=no in both peers, the maxcallnumbers & calltokenoptional settings.

Once you check or add that again show us the iax2 show peers output and this is important: the IAX2 DEBUG when you do a iax2 reload from both servers.

this is my scenario iax_additional.conf:

[lufisa1]
type=friend
username=supermex2
context=sucursal
secret=12345
host=192.168.1.190
disallow=all
allow=g729
allow=alaw
allow=ulaw
trunk=yes
deny=0.0.0.0/0.0.0.0
permit=192.168.1.190/255.255.255.0
qualify=yes
requirecalltoken=no
nat=yes
calltokenoptional=192.168.1.0/255.255.255.0
maxcallnumbers=512

when I get the surcharge iax2 following:

*CLI> iax2 reload
== Parsing ‘/etc/asterisk/iax.conf’: == Found
== Parsing ‘/etc/asterisk/iax_additional.conf’: == Found
== Parsing ‘/etc/asterisk/users.conf’: == Found
[May 22 12:36:48] NOTICE[1603]: chan_iax2.c:12059 iax2_poke_peer: Still have a c
allno…

framework as an extension appears this:

-- Executing [7100@micontexto:1] Dial("SIP/usuario1-00000002", "IAX2/lufisa1

/100") in new stack
[May 22 12:38:19] WARNING[1604]: app_dial.c:2345 dial_exec_full: Unable to creat
e channel of type ‘IAX2’ (cause 20 - Subscriber absent)
== Everyone is busy/congested at this time (1:0/0/1)
– Auto fallthrough, channel ‘SIP/usuario1-00000002’ status is ‘CHANUNAVAIL’

my iptables are:

:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp – anywhere anywhere udp dpt:iax
ACCEPT udp – anywhere anywhere udp dpt:iax

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

:~# netstat -anpl
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
1001/mysqld
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
581/portmap
tcp 0 0 0.0.0.0:2000 0.0.0.0:* LISTEN
1133/asterisk
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
1056/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
1394/exim4
tcp 0 0 0.0.0.0:46111 0.0.0.0:* LISTEN
594/rpc.statd
tcp 0 52 192.168.34.166:22 192.168.34.171:60159 ESTABLISH
1565/1
tcp6 0 0 :::22 :::* LISTEN
1056/sshd
tcp6 0 0 ::1:25 :::* LISTEN
1394/exim4
udp 0 0 0.0.0.0:5060 0.0.0.0:*
1133/asterisk
udp 0 0 0.0.0.0:4569 0.0.0.0:*
1133/asterisk
udp 0 0 0.0.0.0:36708 0.0.0.0:*
594/rpc.statd

so is my scenario on both servers, I thank you for the support provided

I don’t see the iax2 debug on both servers when you reload the config or when you dial. Please provide it from both servers that is important to see if the iax2 requests are reaching the servers.

*CLI> iax2 set debug on
IAX2 Debugging Enabled
Tx-Frame Retry[000] – OSeqno: 000 ISeqno: 000 Type: IAX Subclass: POKE
Timestamp: 00012ms SCall: 00174 DCall: 00000 [192.168.1.190:4569]

Tx-Frame Retry[001] – OSeqno: 000 ISeqno: 000 Type: IAX Subclass: POKE
Timestamp: 00012ms SCall: 00174 DCall: 00000 [192.168.1.190:4569]

Tx-Frame Retry[000] – OSeqno: 000 ISeqno: 000 Type: IAX Subclass: POKE
Timestamp: 00004ms SCall: 07524 DCall: 00000 [192.168.1.190:4569]

Tx-Frame Retry[001] – OSeqno: 000 ISeqno: 000 Type: IAX Subclass: POKE
Timestamp: 00004ms SCall: 07524 DCall: 00000 [192.168.1.190:4569]

Thanks and regards,

Provide it from BOTH SERVERS, when reloading config and calling. Also notice that there are an issue reported in the tracked you may check if its applicable to yur setup issues.asterisk.org/jira/browse/ASTERISK-21787

I have installed asterisk1.8.20.0, even so you can be the fault?