IAX Trunk Configuration

Hi my name is Luca.
I have this problem with trunk IAX

In the gateway i have this error
chan_iax2.c:11474 socket_process: Registration of ‘host01’ rejected: ‘Registration Refused’ from: ‘192.168.1.110’

In the host i have
chan_iax2.c:8122 register_verify: No registration for peer ‘host01’ (from 192.168.1.100)
chan_iax2.c:11474 socket_process: Registration of ‘host01’ rejected: ‘Registration Refused’ from: ‘192.168.1.100’

This is the configuration

GATEWAY
[general]
register => host01:marilena@192.168.1.110

bindport=4569
bindaddr=0.0.0.0
language=it
disallow=all
allow=gsm
allow=g729
allow=alaw
jitterbuffer=no
requirecalltoken=no

[host01]
type=peer
username=host01
secret=marilena
auth=plaintext
host=192.168.1.110
qualify=yes
trunk=yes

HOST01
[general]
register => host01:marilena@192.168.1.100

bindport=4569
bindaddr=0.0.0.0
language=it
disallow=all
allow=gsm
allow=g729
allow=alaw
jitterbuffer=no
requirecalltoken=no

[gateway]
type=user
username=host01
secret=marilena
auth=plaintext
host=192.168.1.100
qualify=yes
trunk=yes

Now i am try in the same LAN, when the configuration is OK i change the IP and the machine is place on different place
I use Asterisk 1.8.32.3
Thanks

This implies that host01 does not exist on the machine receiving the registration request.

On your gateway, you are attempting to register as User host01:

register => host01:marilena@192.168.1.110

However, you don’t have a peer named host01 on HOST01. Instead, you have a user named gateway:

[gateway]
type=user
username=host01
...

I would suspect that your user should be of type peer, and that when you register from the GATEWAY, that you should register as the peer on HOST01. That is:

GATEWAY:

register => gateway:marilena@192.168.1.110

HOST01:

[gateway]
type=peer
username=gateway
secret=marilena
...

Thanks for your answer.
I dont copy all file

GATEWAY
[general]
register => host01:marilena@192.168.1.110

[host01]
type=friend
host=192.168.1.110
username=host01
secret=marilena
auth=plaintext
qualify=yes
trunk=yes
context=tohost01
peercontext=tohost01

[gateway]
type=user
host=192.168.1.100
username=gateway
secret=marilena

HOST01
[general]
register => gateway:marilena@192.168.1.100

[gateway]
type=friend
host=192.168.1.100
username=gateway
secret=marilena
auth=plaintext
qualify=yes
trunk=yes
context=fromgateway
peercontext=fromgateway

[host01]
type=user
host=192.168.1.110
username=host01
secret=marilena

I check both file iax.conf but dont work
I have always the error

GATEWAY ERROR
register_verify: No registration for peer ‘gateway’ (from 192.168.1.110)
socket_process: Registration of ‘host01’ rejected: ‘Registration Refused’ from: ‘192.168.1.110’

HOST01 ERROR
register_verify: No registration for peer ‘host01’ (from 192.168.1.100)
socket_process: Registration of ‘gateway’ rejected: ‘Registration Refused’ from: '192.168.1.100’
Thanks

[host01]
type=user
host=192.168.1.110
username=host01
secret=marilena

Hosts that are static don’t need a registration. You only need to register if your host is dynamic.

If you want to use registration, then set the host=dynamic for your peers/users.

That aside, I’m not sure why you have both friends and users defined on each system. You should only need the peer or friend, each one representing the system on the other side.

Most people should be using just peer, in spite of what all the cookbooks say.

1 Like

Hi
I check the parameter host but dont work.
If i check the peer is OK but the registry is not ok.

I dont understand.
For me is all ok

The purpose of registration is for one IAX2 peer to inform another IAX2 peer of its location. This is analogous to registration in SIP as well, where a SIP UA will register to a SIP registrar so that other SIP UAs can find its location.

If you know the location of the IAX2 peer - which you apparently do, since you hardcoded their IP addresses - then you don’t need to register. Each peer has the location already. Registrations will fail because there is nothing for them to register against - each peer already has the address in the .conf file.

If you want to use registration - for example, you don’t want to have to hardcode the IP address or domain names of your IAX2 peers in the respective .conf files - then you must set host=dynamic.

1 Like

Hi i want update you.
I reinstall SO and ASTERISK.
Copy all file conf and now is all OK.
I thinks there is the file corrupt.
Thanks