Asterisk: niente audio sui client sip remoti e firewall Sonicwall.

mercoledì 17 dicembre 2008, 22:20
Ste73 Ste73 · 2 Commenti


Il nostro centralino Asterisk è ormai ad un eccellente livello di funzionalità. Ogni giorno impariamo cose nuove e siamo ormai praticamente pronti al test da qualche cliente ed alla commercializzazione del pacchetto (vedremo, a breve, di costruire un’offerta commerciale).

Oggi, però, abbiamo riscontrato (nuovamente) un problema già visto in passato: i softphone (usiamo eyebeam) connessi da reti remote si autenticano correttamente sul centralino, ma l’audio non passa.
“Sniffando” il traffico (sul ns. server linux il comando è: tcpdump -i eth0 -n -v not port 22 (not port 22 serve per evitare che ci si autosniffi essendo collegati in ssh)) si scopre che i pacchetti RPT (Real Time Transport Protocol) vengono mandati da asterisk all’ip privato del softphone.

Si apre quindi il tema, annoso, del VOIP su reti nattate. Premesso che il centralino non è nattato ma ha un ip pubblico sulla scheda di rete, il client non è nella stessa situazione e viene nattato dal router della connessione dietro cui si trova.

La soluzione standard, “banalmente” è quella di aggiungere una riga al file sip.conf:

nat = yes

o, se come noi usate l’ottimo voiceone (ne parleremo a breve), potete anche impostare il nat direttamente sulle singole estensioni che userete fuori dalla rete dell’ufficio (non che non lo si possa fare senza voiceone, ma con quest’ultimo è, evidentemente, tutto più semplice)

Questo, di per sè, sistema le cose … a patto … di non avere un firewall Sonicwall con attivo il flag su ” Enable SIP Transformations”, perché in quel caso, il sonic ci metterà uno zampino malefico e non funzionerà nulla!!!

In effetti, dal manuale, è chiaro che il firewall con quell’opzione attiva si occupa di cambiare l’ip scritto dentro i pacchetti ma, secondo logica, dovrebbe farlo correttamente, non al contrario (l’esempio, a onor del vero, è per il caso opposto: sip client in lan nattato e proxy asterisk remoto non nattato):

Selecting Enable SIP Transformations transforms SIP messages between LAN (trusted) and WAN/DMZ (untrusted). You need to check this setting when you want the SonicWALL security appliance to do the SIP transformation. If your SIP proxy is located on the public (WAN) side of the SonicWALL and SIP clients are on the LAN side, the SIP clients by default embed/use their private IP address in the SIP/Session Definition Protocol (SDP) messages that are sent to the SIP proxy, hence these messages are not changed and the SIP proxy does not know how to get back to the client behind the SonicWALL. Selecting Enable SIP Transformations enables the SonicWALL to go through each SIP message and change the private IP address and assigned port. Enable SIP Transformation also controls and opens up the RTP/RTCP ports that need to be opened for the SIP session calls to happen. NAT translates Layer 3 addresses but not the Layer 7 SIP/SDP addresses, which is why you need to select Enable SIP Transformations to transform the SIP messages.
Tip: In general, you should check the Enable SIP Transformations box unless there is another NAT traversal solution that requires this feature to be turned off. SIP Transformations works in bi- directional mode, meaning messages are transformed going from LAN to WAN and vice versa.

Tags: voip

2 risposte ↓

  • 1 Cristina // dic 18, 2008 at 13:18

    lo so che non sono in tema ,ma auguri per un buon Natale e Felice Anno Nuovo a tutta direte ed a chi legge il blog.

  • 2 Ste73 // nov 10, 2009 at 12:58

    E aggiungiamo pure che se mettiamo un limite alle porte udp usate per l’RPT è meglio (ed apriamo solo quelle)

    file rtp.conf -> rtpstart=10000 and rtpstop=20000

Lascia qui il tuo commento

Testo del commento

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

DiRete soc. coop. - Via G. Di Vittorio, 85 - 25015 Desenzano del Garda (BS) - t 030 9902701 / 2056109 f 030 9111872 - P.IVA e C.F. 02452020981 - email
*EOLO è un marchio di NGI SPA