Asterisk and Stuff

Things to remember about Asterisk and related subjects.

IAX(2) Trunking to Dynamic host 
Basically you define a peer and a user on each side to match - easy enough, but I ran into frustrating moments when one side of the trunk was on Dynamic host (my home machine connected to a hosted/static one) - I got the idea of registration but what I failed to get was the relationship of the peername in the registration and the username on the other side, so that it knows the registration belonged to its host (You register as a peer, not a user, you still need a user to place a call).
You may also have seen the registration rejected stuff, this is usually type=friend instead of type=user.
Without me trying to explain it all, here is a setup that works -  all in iax.conf on both sides

On hosted/static Server - example IP is 172.18.1.10

; Peer - Outgoing - Config, and it authenticates the registration
[toRemoteSys]
host=dynamic
username=toRemoteSys
secret=MakeYourOwnSecretHere
type=peer
qualify=yes

; User - this authenticates the incoming calls
[remoteUser]
host=dynamic
secret=MakeYourOwnDifferentSecretHere
type=user
context=from-remote
permit=0.0.0.0/0.0.0.0


On Dynamic/remote trunked host
[general]
;other general options here for sure

; register as a peer
register => toRemoteSys:MakeYourOwnSecretHere@172.18.1.10

;  Peer - outgoing config
[trunkToMyServer]
host=172.18.1.10
username=remoteUser
secret=MakeYourOwnDifferentSecretHere
type=peer
qualify=yes

; Incoming/user authentication
[toRemoteSys]
secret=MakeYourOwnSecretHere
type=user
context=from-my-server
permit=172.18.1.10/255.255.255.255


You dont have to qualify - I just think its nice to see status (  iax2 show peers )





Comments