[Asterisk-Users] RE: IAX Incoming/Outgoing

JR Richardson jr.richardson at cox.net
Sat Mar 25 10:28:39 MST 2006


I'vce got three Asterisk systems here that I'd like to be able to place
calls between with IAX. Each system, pbx1, pbx2, pbx3, should be able to
connect to every other. Do I need separate user/peers or can I combine them
into a single user=friend for each system? 
Has anyone got a working example they could supply? Can I do all this with
just three peers and one username?
 
Thanks... Doug.
 
[pbx1_inbound]
type=user
auth=rsa
inkeys=pbx1
username=pbx1_inbound
deny=0.0.0.0
permit=xxx.187.142.203
context=global_pbx_transfer
 
[pbx1_outbound]
type=peer
auth=rsa
outkey=pbx1
username=pbx1
host=pbx1.ipt.yyy.com
 
[pbx2_inbound]
type=user
auth=rsa
inkeys=pbx2
username=pbx2_inbound
deny=0.0.0.0
permit=xxx.187.142.204
context=global_pbx_transfer
 
[pbx2_outbound]
type=peer
auth=rsa
outkey=pbx1
username=pbx1
host=pbx2.ipt.yyy.com
 
[pbx3_inbound]
type=user
auth=rsa
inkeys=pbx3
username=pbx3_inbound
deny=0.0.0.0
permit=xxx.187.142.234
context=global_pbx_transfer



**********Hi Doug,

You certainly can have in/out trunks for each and work fine plus you can get
more granular with security.

If all these boxes are on the same subnet and secure from a public network,
there is really no reason to have an IAX [context] for each outbound/inbound
session between the servers, just use one [context] common on all servers.  

Example iax.conf all PBX's

[iaxtrunk] (my internal iax trunk)
type=friend 
auth=md5
secret=1234   
host=dynamic
context=incomingiax
disallow=all
allow=ulaw
trunk=yes


extensions.conf all PBX's

[incomingiax]
Include => local (or whatever contexts the incoming iax trunks need access
to)


Now routing call between them is a whole other topic, several ways to
accomplish this but it is all dial plan related at this point.  The only
thing we accomplished so far is allowing all 3 PBX's trunk access to each
other over a common [context] group.  This is good, as you add PBX4, PBX5,
you just add this common [context] in iax.conf in the new servers without
the need of updating pbx1,2&3.

Routing example extensions.conf 

[internal]
;To reach internal extensions on pbx1 (put this in pbx 2&3)
Exten => 1XXX,1,Dial(IAX2/iaxtrunk:1234 at XXX.187.142.203/${EXTEN})

;To reach internal extensions on pbx2 (put this in pbx 1&3)
Exten => 2XXX,1,Dial(IAX2/iaxtrunk:1234 at XXX.187.142.204/${EXTEN})

;To reach internal extensions on pbx3 (put this in pbx 1&2)
Exten => 3XXX,1,Dial(IAX2/iaxtrunk:1234 at XXX.187.142.234/${EXTEN})


You could also specify each PBX in the [globals] context
Example

[globals]

TRUNKPBX1 => IAX2/iaxtrunk:1234 at XXX.187.142.203
TRUNKPBX2 => IAX2/iaxtrunk:1234 at XXX.187.142.204
TRUNKPBX3 => IAX2/iaxtrunk:1234 at XXX.187.142.234

So your routing extension would look like this:

Exten => 1XXX,1,Dial(${TRUNKPBX1}/${EXTEN})
Exten => 2XXX,1,Dial(${TRUNKPBX2}/${EXTEN})
Exten => 3XXX,1,Dial(${TRUNKPBX3}/${EXTEN})


Hope this helps.

JR





More information about the asterisk-users mailing list