[asterisk-users] "Remote" extension search?

Gordon Henderson
Wed, 15 Aug 2007 08:29:13 -0000

On Tue, 14 Aug 2007, Nicholas Blasgen wrote:

> I've heard about this, but I really can't seem to find anything on
it.  I've
> got a strange setup that exists only because of firewall issues, and
> everything about it seems fine.  The setup:
>
> SIP clients -> Asterisk (office) -> IAX -> Asterisk (colocation)
-> SIP PSTN
> Termination
>
> All the extensions I want to be able to dial are on the colocation box.
> What I'd really like is for the "office" asterisk box to
forward all
> extension requests it doesn't know about to the colocation Asterisk
box.  I
> think this is refered to as Trunking.  I only need to do this in a single
> direction, if that's any easier to setup.

You can do this by having a default widlcard extension to point to the
co-lo box. Simple (crude?) but effective... So in the diaplan in the
office asterisk box:

   exten => _X.,1,Dial(IAX2/co-lo/${EXTEN})

so anything not matched locally will get punted through to the co-lo box.

This assumes 'co-lo' has an entry in iax.conf. (and corresponding
authentication on the co-lo side)

You can narrow it down if you know the extension numbering scheme - so if
you want to point all numbers starting with 0 and all 3-digit extensions
in the range 200 through 399, to the co-lo, then:

   exten => _0.,1,Dial(IAX2/co-lo/${EXTEN})
   exten => _2XX,1,Dial(IAX2/co-lo/${EXTEN})
   exten => _3XX,1,Dial(IAX2/co-lo/${EXTEN})

and so on.

Although the last 2 might be combined with:

   exten => _[23]XX,1,Dial(IAX2/co-lo/${EXTEN})

etc.

If you explicitly wanted to dial 9 for an outside line, then:

   exten => _9.,1,Dial(IAX2/co-lo/${EXTEN:1})


> Are there any good documents on VOIP-Info or another site on setting up
> something like this?  The office Asterisk's job is just to act as a SIP
to
> IAX gateway.  I've got a work-a-round that will work, but I thought
I'd
> learn the proper method.

With so many ways to do something, who defines "proper" :)

Gordon