[Asterisk-Users] IAX to IAX connect question

Benjamin on Asterisk Mailing Lists benjk.on.asterisk.ml at gmail.com
Wed Sep 15 04:09:36 MST 2004


On Wed, 15 Sep 2004 03:45:59 -0600, Raul Elizondo (wizardteam)
<rauleli at wizardteam.com> wrote:
> I got my * working fine with FWD at office with 2 extensions, i receive
> calls and i can make calls thru FWD.  I got also my * at home, and i
> connected it using auth=rsa.  From my home, i can make calls using my office
> iax, but if i try to redirect incomming calls from FWD to my * at home, it
> rejects the call.  I created the pub/key pairs for rsa and its working ok
> and i just pasted the sections/contexts involved.
> 
> Must of the samples around the internet works with double config in iax.conf
> for each server, a peer and a user, i've done that in a VPN and that works
> fine.  But... imagine setting a new *, i would need to modify the first 2
> besides that adding them in the new one.  What about a 4th or a 5th?  Every
> new * in the pbx means to modify all other *.  So what i thougth was to set
> a main one with some of slaves or users, in this way, i will only need to
> add new "slaves" in the master, and this is what i tried.

There are a few things wrong and bad in your setup.

For example _999999 doesn't make any sense. The underscore denotes a
pattern for pattern matching, you you don't use any pattern, just a
number.

Further, you should not use Dial(.../user:passwd at peer, ...). NEVER
EVER other than for testing.

It is sad that FWD recommends this in their sample because by doing
that, they teach newbies to do things the wrong way.

The context for your user01 is "localuse" which in itself is a master
context that includes a context "extensions". Yet, you don't provide
that context, so it is hard to say how you end up in the out of office
hours context.

I also think you should make a distinction between dialing internal
extensions from a remote office and dialing an external service for
which you act as a gateway. In my book this should be separated, like
so ...

Office:/etc/asterisk/iax.conf ...

[FWD-service]
type=user   ; we are letting a remote user use this server to call FWD
username=rfwduser   ; their username with us here
host=dynamic   ; their host may not have a fixed ip address
context=fwd-service

[FWD-gw] ; outbound connections to FWD from here
type=peer
username=12345
host=iax2.fwdnet.net


Home:/etc/asterisk/iax.conf ...

[FWD-gw]
type=peer   ; we are using the remote office server as a gateway to call out
username=rfwduser   ; our username with the remote office server
host=ip-or-dns   ; the ip address or dns name of the remote office server

Office:/etc/asterisk/extensions.conf ...

[globals]
FWDUSERID=12345
FWDUSERNAME=Fred Flintstone Inc
FWDGW=IAX2/12345 at FWD-gw ; this is FWD's IAX server

[fwd-service]
; we provide this context for remote users calling FWD through us
exten => _X.,1,SetCallerID(${FWDUSERID})
exten => _X.,2,SetCIDName(${FWDUSERNAME})
exten => _X.,3,Dial(${FWDGW}/${EXTEN},60,r)
exten => _X.,4,Hangup

Home:/etc/asterisk/extensions.conf ...

[globals]
FWDGW=IAX2/rfwduser at FWD-gw ; this is our office server acting as a gateway

[fwd-service]
; we use the remote server at the office to call FWD
exten => _X.,1,Dial($FWDGW}/${EXTEN},60,r)
exten => _X.,2,Hangup
;
; Don't forget to include this context for anybody who is supposed to use it


This is just the bare minimum, you need to fill in passwords or RSA
keys and the codecs (ulaw only for FWD's server) and whatever else you
may wish to use (ie qualify=yes, accountcode=123 etc).

You can then use the same FWD gateway service you provide through your
own office server from any location, so there is no additional
configuration required for additional offices or homes.

You can then also use the same as a blueprint for providing a service
to call other services for which you want your office server to act as
a gateway. Finally you can use part of it as a blueprint for providing
a service to call internal extensions.

The key is to think of everything as a service. You are either a
service provider or a service user, in some cases you are both a
provider and a user (when you are acting as a gateway).

Keeping different services apart from each other helps breaking down
the complexity of the configuration, it keeps your dialplan and other
configs easier to understand when they grow and consequently easier to
maintain. It also makes trouble shooting much easier because you can
focus at a single piece and ignore all the rest. Finally, you reduce
side effects, that is to say, you won't run into a situation where
something that worked yesterday doesn't work anymore because of a
configuration change in what appeared to be a totally unrelated thing
that shouldn't have made any impact.

hope this helps
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