IAX2 - why the peers status are UNKNOWN


#1

Hello All,

I am trying IAX2 for my Asterisk (1.8.3)

172.16.1.252 (ext 101) <–> 172.16.1.214 (ext. 250 & 252)

on 172.16.1.252 (ext. 101)
on 172.16.1.214 (ext. 250 & 252)

why the status of peers are UNKNOWN?

and in both sides shown …

[2011-10-17 16:07:35] NOTICE[2854]: chan_iax2.c:11236 socket_process: Registration of ‘252-user’ rejected: ‘Registration Refused’ from: ‘172.16.1.252’

[Oct 17 16:02:46] NOTICE[3703]: chan_iax2.c:11236 socket_process: Registration of ‘214-user’ rejected: ‘Registration Refused’ from: ‘172.16.1.214’

in 172.16.1.252


*CLI> iax2 show registry
Host                  dnsmgr  Username    Perceived             Refresh  State
172.16.1.214:4569     N       214-peer    <Unregistered>             60  Rejected
1 IAX2 registrations.


register=252-user:iax3035@172.16.1.252

[214-peer]
host=172.16.1.214
username=214-user
secret=iax3035
type=peer
qualify=yes
trunk=yes
context=from-trunk-iax2-214-peer

[214-user]
secret=iax3035
type=user
context=from-trunk

[250]
deny=0.0.0.0/0.0.0.0
secret=iax3035
transfer=yes
context=from-internal
host=dynamic
type=friend
port=4569
qualify=yes
dial=IAX2/250
mailbox=250@device
permit=0.0.0.0/0.0.0.0
requirecalltoken=yes
callerid=device <250>
setvar=REALCALLERIDNUM=250

[252]
deny=0.0.0.0/0.0.0.0
secret=iax3035
transfer=yes
context=from-internal
host=dynamic
type=friend
port=4569
qualify=yes
dial=IAX2/252
mailbox=252@device
permit=0.0.0.0/0.0.0.0
requirecalltoken=yes
callerid=device <252>
setvar=REALCALLERIDNUM=252

myasterisk*CLI> iax2 show peers
Name/Username    Host                 Mask             Port          Status
214-peer/214-us  172.16.1.214    (S)  255.255.255.255  4569 (T)      OK (1 ms)
252              (null)          (D)  255.255.255.255  0             UNKNOWN
250              (null)          (D)  255.255.255.255  0             UNKNOWN
3 iax2 peers [1 online, 2 offline, 0 unmonitored]

=============================
in 172.16.1.214


asterisk*CLI> iax2 show registry
Host                  dnsmgr  Username    Perceived             Refresh  State
172.16.1.252:4569     N       252-peer    <Unregistered>             60  Rejected


register=214-user:iax3035@172.16.1.214

[101]
deny=0.0.0.0/0.0.0.0
secret=iax1234
transfer=yes
context=from-internal
host=dynamic
type=friend
port=4569
qualify=yes
dial=IAX2/101
mailbox=101@device
permit=0.0.0.0/0.0.0.0
requirecalltoken=yes
callerid=device <101>
setvar=REALCALLERIDNUM=101

[252-peer]
host=172.16.1.252
username=252-user
secret=iax1234
type=peer
qualify=yes
trunk=yes
context=from-trunk-iax2-252-peer

[252-user]
secret=iax1234
type=user
context=from-trunk

#2

It looks like you are expecting the endpoints to register to the other systems, not just the IAX trunks.

Let the sets register via SIp to the server you want, then create IAX trunks in iax.conf just for the to systems to communicate. You control call flow between the systems within dial plan.


#3

Hello,
I am sorry I don’t understand what you meant, could you please more detail? or give me an example? :smile:
thanks a lot in advance
Regards
Winanjaya


#4

Basically what I mean is this.

On host 172.16.1.252

in sip.conf, define the device that will ring when 101 is dialed. Assign it to a context that you will create in extensions.conf that has access

in iax.conf, define the inbound connection from host 127.16.1.214 as well as the outbound connection to that host. The context for the inbound connection must have access to a context that can reach extension 101.

in extensions.conf, create extensions for 250 and 252 which Dial() those digits via the connection defined in iax.conf. Also create an extension that match the digits 101 and Dial() the device defined in sip.conf

On host 172.16.1.214

in sip.conf, define the devices that will wing when 250 and 252 are dialed.

in iax.conf, define the inbound and outbound connections from/to 172.16.1.252. The context for the inbound connection must have access to a context that can dial 250 and 252.

In extensions.conf, create an extension for 101 which Dial() those digits via the connection defined in iax.conf. Create extensions 250 and 252 which Dial() the devices defined in sip.conf.

I also highly recommend you pick up a copy of the Asterisk: The Definitive Guide shop.oreilly.com/product/9780596517342.do That will take you a long way in learning to use Asterisk.

in