Trunk IAX2 – Exemplo de conexão entre dois server

Abaixo segue um trunk funcional entre dois servers asterisk.
Serie de vantagens fechando trunk iax entre dois servers qndo necessário!

Primeiramente uma introdução do trunk iax retirado de voip-info:
IAX
The IAX revision 2 protocol is used by the Asterisk VOIP PBX and FreeSwitch Softswitch as an alternative to SIP, H.323, etc. when connecting to other devices that support IAX (a limited list at the moment, but growing very rapidly). However meanwhile other software like Yate SofaSwitch and OPAL have added IAX2 support.

•IAX2 is not the result of a standards group, rather a collaborative, community based effort (Note: IAX2 is now: RFC 5456)
•IAX2 uses a single UDP port 4569, and thus works well in NAT environments (the obsolete IAX1 protocol used port 5036). IAX2 uses ONLY one udp port for both control and data traffic. As outlined in point 4 of the IAX versus SIP topic with IAX you will always have audio if the control connection can be established.
•IAX2 supports PKI-style authentication and trunking.
•The Asterisk IAX2 driver has a jitter buffer. (The SIP driver doesn’t in 1.2.x, but one has been added in 1.4.x. The IAX2 jitterbuffer is more mature however.)

Trunking
When trunking with IAX2, only the used bandwidth is allocated at all times. Other TDMoIP protocols used for trunking always allocate a certain amount of bandwidth to keep all channels open. IAX trunking allows multiple voice streams to share a single “trunk” to another server, reducing overhead created by IP packets. IAX always sends DTMF outline (RFC2833), eliminating the confusion often found with SIP.

It should be noted that trunking requires both sides to know each other (i.e. they need to be valid peers). If one side has trunk=yes and the other does not cannot validate the peer, you will get one-way audio. The easiest way to make this work is to use a register line to register to the systems you want to trunk with.

IP MATRIZ – 192.168.254.254
IP FILIAL – 192.168.254.253

MATRIZ

[general]
minregexpire = 3600
maxregexpire = 3600
bindport=4569
bindaddr=0.0.0.0
language=pt_BR

[FILIAL]
type=friend
context=realiza_chamadas
secret=teste
trunk=yes
callerid=”FILIAL”
auth=md5
qualify=yes

[MATRIZ]
type=friend
secret=teste
host=dynamic
context=recebe_chamadas

[realiza_chamadas]

; Ramais a transferir para o FILIAL
exten => _X,1,Dial(IAX2/FILIAL:teste@192.168.254.253/${EXTEN})

——————————————————
FILIAL

[general]
language=pt_BR
minregexpire = 3600
maxregexpire = 3600
;bindport=4569
;bindaddr=0.0.0.0

[MATRIZ]
type=friend
context=realiza_chamadas
secret=teste
trunk=yes
callerid=”MATRIZ”
auth=md5
qualify=yes

[FILIAL]
type=friend
secret=teste
host=dynamic
context=recebe_chamadas
allow=ualaw

[realiza_chamadas]

exten => _x.,1,Dial(IAX2/MATRIZ:teste@192.168.254.254/${EXTEN})

Lembrar de dar um reload do iax no asterisk após modificações!

Esse trunk esta testado e funcionando.
:)

[photopress:SDC10016.JPG,resized,centered]

Deixe um comentário