RES: [AsteriskBrasil] Dúvidas | Aterisk + Linux Fedora + Trunk SIP da operadora T Mais + NAT com Iptables

Moacir O. de Souza Junior - Personalsoft Sistemas Ltda. moacir em personalsoft.inf.br
Quarta Dezembro 27 19:42:56 BRST 2006


Pessoal, em especial ao Bernardo.

Encontrei a minha solução em
http://www.asteriskguru.com/tutorials/sip_nat_oneway_or_no_audio_asterisk.ht
ml

O problema estava acontecendo pelo seguinte motivo (depois q eu achei a
solução fiquei até com vergonha.. Heheh):

No arquivo sip.conf em /etc/asterisk existem uma variavel chamada "NAT" (que
no meu caso não se encontrava no arquivo, assumindo assim o valor padrão
"rfc3581"), bastou colocar NAT=yes, reiniciar o asterisk e funcionou!

Obrigado Pessoal!

Codialmente, 

Moacir O. de Souza Junior


----------------------------------------------------------------------------
-------------------
Nat=

->This option determines the type of setting for users trying to connect to
an asterisk server.


Possible values:



a) NAT=Yes, true, y, t, 1, on

All these values have the same behaviour, a combination of the options Route
+ rfc3581.


b) Nat=route:


Asterisk will send the audio to the port and ip where its receiving the
audio from. Instead of relying on the addresses in the SIP and SDP messages.

This will only work if the phone behind nat send and receive audio on the
same port and if they send and receive the signaling on the same port. (The
signaling port does not have to be the same as the RTP audio port).


c) NAT=rfc3581

This is the default behaviour, is no nat=… line is found for that user, this
is the option used.

Asterisk will add an rport to the via header of the SIP messages, as
described in rfc3581 (see http://www.faqs.org/rfcs/rfc3581.html), this will
allow a client to request that the server send the response back to the
source IP address and port where the request came from. The "rport"
parameter is analogous to the "received" parameter in the VIA line, except
"rport" contains a port number, not the IP address.


d) NAT=never

This will cause asterisk not to add an rport "rport" in the VIA line of the
sip invite header, as introduced in rfc3581. (see
http://www.faqs.org/rfcs/rfc3581.html) as some sip ua’s seem to have
problems with them. (one of those UAs being the Uniden SIP phone UIP200 –
Olle E. Johanson.)
----------------------------------------------------------------------------
-------------------



-----Mensagem original-----
De: asteriskbrasil-bounces em listas.asteriskbrasil.org
[mailto:asteriskbrasil-bounces em listas.asteriskbrasil.org] Em nome de
Bernardo Vieira
Enviada em: quarta-feira, 27 de dezembro de 2006 16:52
Para: asteriskbrasil em listas.asteriskbrasil.org
Assunto: Re: [AsteriskBrasil] Dúvidas | Aterisk + Linux Fedora + Trunk SIP
da operadora T Mais + NAT com Iptables

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Procura no voip-info.org por one way audio, esse é um problema clássico de
sip atrás de nat.

Moacir O. de Souza Junior - Personalsoft Sistemas Ltda. wrote:
> Pessoal,
> 
> Boa tarde!
> 
> Sou novo na área e no assunto. 
> 
> Tenho uma estrutura da seguinte maneira:
> 
> '---------------------------------------------'
> |Firewall/Roteador Linux (Fedora) com IPTABLES| Neste equipamento eu 
> |tenho
> contato com o mundo - INTERNET
> '---------------------------------------------'
> 
> '-------------------------'
> |Asterisk com Linux Fedora| Meu servidor de Asterisk
> '-------------------------'
> 
> '---------------------------------'
> |Estações de Trabalho com SoftFone| Minhas Estações de Trabalho -
> (r)WindowsXP com X-Lite
> '---------------------------------'
> 
> Seguinte,
> 
> Montamos a estrutura do Asterisk e tudo funcionou perfeitamente (aqui 
> interno em nossa rede), quando eu fui colocar alguns SoftFones 
> externos (fora de nossa rede - pela internet) eu pesquisei com o NAT 
> para o protocolo SIP e vi que tinha de carregar mais alguns módulos 
> para o IPTables (ip_conntrack_sip e ip_nat_sip), continuei pesquisando 
> e vi sobre os redirecionamentos necessários das portas UDP (dois 
> ranges, da 5060 a 5070 para o SIP e da 8766 a 35000 para o RTP). Feito 
> o carregamento dos módulos e o direcionamento das portas os nossos 
> usuários externos funcionaram normalmente. Batalha Vencida.
> 
> O meu problema apareceu quando eu configurei um tronco SIP (da 
> operadora T Mais). Eu (como usuário INTERNO aqui da minha rede) falo, 
> mas a pessoa do outro lado não escuta. Acredito que tenha algo a ver com o
NAT.
> 
> Caso alguém tenha alguma dica ou que já tenha passado por este 
> problema e queira compartilhar a solução, ficarei muito grato.
> 
> Cordialmente,
> 
> Moacir O. de Souza Junior
> 
> ----------------------------------------
> Estação VoIP 2006
> 5 e 6 Dezembro
> Curitiba PR
> http://www.estacaovoip.com.br
> 
> _______________________________________________
> LIsta de discussões AsteriskBrasil.org 
> AsteriskBrasil em listas.asteriskbrasil.org
> http://listas.asteriskbrasil.org/mailman/listinfo/asteriskbrasil
> 
> _______________________________________________
> Acesse o  wiki AsteriskBrasil.org:
> http://www.asteriskbrasil.org
> 
> 

- --
"What most profoundly divides two men is a different sense and degree of
cleanliness. What help is all honesty and mutual utility, what help is all
the good will for each other: in the end the fact remains-they can't stand
each other?s smell!"

- - Nietzsche
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFksCz2QVs8jsa1mQRAoMuAJ9mihO7Xq/8XEsNFh6JRBSm2EYzFACfSFbQ
4aN86jyu1dy1IzCXX+m+5Ug=
=5J7f
-----END PGP SIGNATURE-----
----------------------------------------
Estação VoIP 2006
5 e 6 Dezembro
Curitiba PR
http://www.estacaovoip.com.br

_______________________________________________
LIsta de discussões AsteriskBrasil.org
AsteriskBrasil em listas.asteriskbrasil.org
http://listas.asteriskbrasil.org/mailman/listinfo/asteriskbrasil

_______________________________________________
Acesse o  wiki AsteriskBrasil.org:
http://www.asteriskbrasil.org



Mais detalhes sobre a lista de discussão AsteriskBrasil