{"id":15,"date":"2010-07-07T01:59:12","date_gmt":"2010-07-07T04:59:12","guid":{"rendered":"http:\/\/blog.digavoip.com.br\/2010\/07\/07\/trunk-iax2-exemplo-de-conexao-entre-dois-server\/"},"modified":"2010-07-07T01:59:12","modified_gmt":"2010-07-07T04:59:12","slug":"trunk-iax2-exemplo-de-conexao-entre-dois-server","status":"publish","type":"post","link":"https:\/\/blog.abratel.com.br\/?p=15","title":{"rendered":"Trunk IAX2 &#8211; Exemplo de conex\u00e3o entre dois server"},"content":{"rendered":"<p>Abaixo segue um trunk funcional entre dois servers asterisk.<br \/>\nSerie de vantagens fechando trunk iax entre dois servers qndo necess\u00e1rio!<\/p>\n<p>Primeiramente uma introdu\u00e7\u00e3o do trunk iax retirado de voip-info:<br \/>\nIAX<br \/>\nThe 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. <\/p>\n<p>\u2022IAX2 is not the result of a standards group, rather a collaborative, community based effort (Note: IAX2 is now: RFC 5456)<br \/>\n\u2022IAX2 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.<br \/>\n\u2022IAX2 supports PKI-style authentication and trunking.<br \/>\n\u2022The Asterisk IAX2 driver has a jitter buffer. (The SIP driver doesn&#8217;t in 1.2.x, but one has been added in 1.4.x. The IAX2 jitterbuffer is more mature however.) <\/p>\n<p>Trunking<br \/>\nWhen 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 &#8220;trunk&#8221; to another server, reducing overhead created by IP packets. IAX always sends DTMF outline (RFC2833), eliminating the confusion often found with SIP. <\/p>\n<p>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. <\/p>\n<p>IP MATRIZ &#8211; 192.168.254.254<br \/>\nIP FILIAL &#8211; 192.168.254.253<\/p>\n<p>MATRIZ<\/p>\n<p>[general]<br \/>\nminregexpire = 3600<br \/>\nmaxregexpire = 3600<br \/>\nbindport=4569<br \/>\nbindaddr=0.0.0.0<br \/>\nlanguage=pt_BR<\/p>\n<p>[FILIAL]<br \/>\ntype=friend<br \/>\ncontext=realiza_chamadas<br \/>\nsecret=teste<br \/>\ntrunk=yes<br \/>\ncallerid=&#8221;FILIAL&#8221; <FILIAL><br \/>\nauth=md5<br \/>\nqualify=yes<\/p>\n<p>[MATRIZ]<br \/>\ntype=friend<br \/>\nsecret=teste<br \/>\nhost=dynamic<br \/>\ncontext=recebe_chamadas<\/p>\n<p>[realiza_chamadas]<\/p>\n<p>  ; Ramais a transferir para o FILIAL<br \/>\nexten => _X,1,Dial(IAX2\/FILIAL:teste@192.168.254.253\/${EXTEN})<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nFILIAL<\/p>\n<p>[general]<br \/>\nlanguage=pt_BR<br \/>\nminregexpire = 3600<br \/>\nmaxregexpire = 3600<br \/>\n;bindport=4569<br \/>\n;bindaddr=0.0.0.0<\/p>\n<p>[MATRIZ]<br \/>\ntype=friend<br \/>\ncontext=realiza_chamadas<br \/>\nsecret=teste<br \/>\ntrunk=yes<br \/>\ncallerid=&#8221;MATRIZ&#8221; <MATRIZ><br \/>\nauth=md5<br \/>\nqualify=yes<\/p>\n<p>[FILIAL]<br \/>\ntype=friend<br \/>\nsecret=teste<br \/>\nhost=dynamic<br \/>\ncontext=recebe_chamadas<br \/>\nallow=ualaw<\/p>\n<p>[realiza_chamadas]<\/p>\n<p>exten => _x.,1,Dial(IAX2\/MATRIZ:teste@192.168.254.254\/${EXTEN})<\/p>\n<p>Lembrar de dar um reload do iax no asterisk ap\u00f3s modifica\u00e7\u00f5es!<\/p>\n<p>Esse trunk esta testado e funcionando.<br \/>\n:)<\/p>\n<p>[photopress:SDC10016.JPG,resized,centered]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Abaixo segue um trunk funcional entre dois servers asterisk. Serie de vantagens fechando trunk iax entre dois servers qndo necess\u00e1rio! Primeiramente uma introdu\u00e7\u00e3o do trunk iax retirado de voip-info: IAX The IAX revision 2 protocol is used by the Asterisk VOIP PBX and FreeSwitch Softswitch&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts\/15"}],"collection":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15"}],"version-history":[{"count":0,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}