[Asterisk-Users] IAX to IAX connect question

Benjamin on Asterisk Mailing Lists benjk.on.asterisk.ml at gmail.com
Wed Sep 15 07:41:51 MST 2004


On Wed, 15 Sep 2004 06:36:48 -0600, Raul Elizondo (wizardteam)
<rauleli at wizardteam.com> wrote:
> Acording to http://www.voip-info.org/wiki-Asterisk+iax+rsa+auth, and my
> understanding of peer and user, [FWD-service] in the sample you provide me
> should be type=peer as it will be the master/server, and [FWD-gw] should be
> type=user as it is a client for FWD service.

It always depends from which side you are looking, local or remote.

An entry of type peer is for the local Asterisk where this entry is
defined to make connections to a remote Asterisk. An entry of type
user is for the local Asterisk to accept incoming connections from a
remote Asterisk.

An entry of type peer on the local Asterisk has to be matched with an
entry of type user on the remote Asterisk. Likewise, an entry of type
user on the local Asterisk has to be matched with an entry of type
peer on the remote Asterisk.

Admittedly, this can be confusing. In my experience, it is the naming
of local and remote peers which causes most people difficulties
configuring IAX peering. Once you got the naming right, everything
else becomes straightforward.

Here is what I use ...

Let's assume we are setting up IAX peering with a company called Flintstone Inc.

On the local system, I define flintstones for inbound and
flintstones-gw for outbound connections:

; -----------------------------------------------------------------------------
; Peer entries for P2P IAX connections
; -----------------------------------------------------------------------------
;
[flintstones] ; incoming connections from Flintstone Inc.
type=user ; they are user "flintstones" here at Sunrise
auth=md5
secret=blah
host=iax.flintstones.com
qualify=yes
disallow=all
allow=ulaw
allow=alaw
allow=ilbc
context=incoming
;
[flintstones-gw] ; outbound connections to Flintstone Inc.
type=peer
username=sunrise ; we are user "sunrise" at remote peer "flintstones-gw"
auth=md5
secret=blah
host=iax.flintstones.com
qualify=yes
disallow=all
allow=ulaw
allow=alaw
allow=ilbc
callerid="Sunrise"<1 408 350-2438>

On the remote system I'd define sunrise and sunrise-gw, where sunrise
would match up with flintstones-gw and sunrise-gw would match up with
flintstones:

; -----------------------------------------------------------------------------
; Peer entries for P2P IAX connections
; -----------------------------------------------------------------------------
;
[sunrise] ; incoming connections from Sunrise Telephone Systems Ltd.
type=user ; they are user "sunrise" here at Flintstones
auth=md5
secret=blah
host=sunrise-tel-server
qualify=yes
disallow=all
allow=ulaw
allow=alaw
allow=ilbc
context=incoming
;
[sunrise-gw] ; outbound connections to Sunrise Telephone Systems Ltd.
type=peer
username=flintstones ; we are user "flintstones" at remote peer "sunrise-gw"
auth=md5
secret=blah
host=sunrise-tel-server
qualify=yes
disallow=all
allow=ulaw
allow=alaw
allow=ilbc
callerid="Flintstones"<1 555 123-4567>

You will find that this is all you need to get calls in both
directions going. You will also find that these two pairs illustrate
how peering works. Study these samples and you can roll your own.

I don't want to discourage you from using names such as "office" and
"home", but you first need to understand that you need two entries on
each side and that they need to be matching pairs. Once you have
immersed that, you can start thinking about your own naming scheme.

The catch is that a name you assign on Asterisk server "Home" may make
perfect sense locally but confuses you when you use it on Asterisk
server "Office" for connecting to "Home". Likewise, a name you assign
on Asterisk server "Office" may make sense locally but confuse you on
Asterisk server "Home".

Typically, names like Home-in and Home-out, Office-in and Office-out
fall into this category. The reason is that Home-in on Home would be
Home-in on Office for outgoing calls and Office-in on Office would be
Office-in on Home, which doesn't make a lot of sense. This is because
what is "in" on one side should be "out" on the other.

Anyway, I don't claim to have invented the ultimate naming scheme, but
I found the scheme I use to be the least confusing of all the
different things I have tried.

One of the things I would advise against is using type=friend. It
looks like a great space saver when you start doing this, but it is
prone to lead you to confusion and it invisibly joins things that
should be kept separate.

The only time when type=friends should be used is when troubleshooting
an entry, but once you've got it working you should narrow it down to
either peer or user again.

> The question is:  What would i need to set in office in order to receive
> calls from FWD or another service?

Set up two entries on each machine, one for incoming and one for
outgoing connections, similar to the way I have shown above.

rgds
benjk

-- 
Sunrise Telephone Systems, 9F Shibuya Daikyo Bldg., 1-13-5 Shibuya,
Tokyo, Japan.

NB: Spam filters in place. Messages unrelated to the * mailing lists
may get trashed.



More information about the asterisk-users mailing list