[Asterisk-Users] IAX2 and asterisk servers linking to each other
Rich Adamson
radamson at routers.com
Sun Mar 13 18:36:40 MST 2005
> Guys. I have a few IAX2 connectivity questions that maybe somebody can
> clarify to me:
>
> I have my * server and another one with a friend. We are both inside nat and
> doing port forwarding:
>
> * -> nat -> internet -> nat -> *
>
> Now, what I dont understand is this, why FWD needs to be configured in
> iax.conf with a register and a peer and user entries:
>
> register => user:pw at iax2.fwdnet.net
>
> [iaxfwd]
> type=user
> context=fwd-incoming
> auth=rsa
> inkeys=freeworlddialup
>
> [fwd-gw]
> type=peer
> host=iax2.fwdnet.net
> user=user
> secret=pw
> qualify=2000
> disallow=all
> allow=ulaw
> callerid=Anton Krall
>
> But for connecting 2 * servers you need just this:
>
> register => user:pw at asteriskhost.com
>
> [remoteasterisk]
> type=friend
> language=sp
> host=dynamic
> secret=pw
> context=mty-incoming
> disallow=all
> allow=ilbc
> auth=md5
> trunk=no
> qualify=3000
> accountcode=mike
>
> Why not use a peer and user entries also? And when do you need to use
> trunking? In this example, trunk=no.. Why?
>
> Any enlightment on this will be greatly appreciated.
The register statement is primarily intended to let the other end
know your system is available. Options with the statement include
the ability to inform the other end how you want to be contacted
(eg, an extension number they should use when sending a call to you).
The User and Peer context types are primarily used to specify
specific parameters for incoming and outgoing calls. Maybe a bad
example, but you could specify ulaw for outgoing calls and gsm
for incoming calls, or whatever.
You might have an extensions.conf entry that looks something like:
exten => _6X.,1,Dial(IAX2/rsa-laptop/${EXTEN:1})
where the call is directed to context=rsa-laptop, or,
exten => _6X.,1,Dial(IAX2/1.2.3.4/${EXTEN:1})
where the call is directed to a specific IP address and does not
reference a context.
In the first case, the parameters from the context are used. The
second case does not reference a context, therefore default parameter
values will be used (whatever they happen to be).
So, for you and your friend, if both asterisk systems are always
on and available, there really is no value to register. Just use
the User and Peer contexts, and set passwords and security parameters
to your needs.
More information about the asterisk-users
mailing list