[asterisk-users] Early media support for Asterisk behind NAT

Johansson Olle E oej at edvina.net
Tue Jan 8 10:24:35 CST 2008


8 jan 2008 kl. 07.41 skrev Mayur:

> Hi,
>    I have asterisk 1.4.16 behind a NAT-FW which is using a hosted  
> SIP trunk for PSTN calling. Asterisk is configured to support nat  
> with nat=yes in sip.conf. Now the hosted PSTN Gateway supports  
> symmetric RTP and early media using 183 Session Progress. So If I  
> call a PSTN number which has IVR message played before the call is  
> connected (via 183), those media RTP packets do not reach the  
> asterisk inside till asterisk sends out media packet to the PSTN  
> gateway. I have used rtpkeepalive option and set it to 1 sec. But it  
> seems that I drop rtp voice packets in the initial instructions  
> played by the IVR.
>
> How do I make sure that asterisk sends RTP packets (null rtp) to the  
> PSTN gateway just after receiving the media details in 183 SDP to  
> open the firewall port from inside?

That's a very interesting question. We are able to receive media as  
soon as we send the INVITE, but I am unsure on when we actually start  
sending media. Turn on RTP debugging in your asterisk to check. I  
would assume that if you have rtpkeepalive, we should start sending as  
soon as we get somewhere to send to, which in this case is when we get  
the SDP in the 183. There might be issues with some packets being sent  
at the same time as the gateway sends 183. With QoS priority for  
media, these may arrive to the NAT before the 183 SIP reply, which  
will be a problem in this NATted situation.

There's no way we can actually send anything before the 183, so there  
will always be time between SDP exchange and first functional media  
packet in NAT situations. I always consider this when playing prompts  
and wait at least a second before important audio begins.

/O



More information about the asterisk-users mailing list