No voice with SIP phones in the WAN

I have a Asterisk SVR in my LAN and which is up & running. it is mapped to a public address by configuring a Static NAT in my Cisco 805 router.
All my sip phones in the LAN is working without aproblem within the LAN, voice quality is also good. But in the WAN (Beyond my router) the SIP phones are even registered with my Asterisk SVR without any problem, you can ring each other, But when you pick the phone there’s no voice is coming in both sides. Also the ring-back tone could only be only hear from the SIP phone side only.

Here’s my specific places of SIP.conf file.
Please help me to solve this problem.

[general]

context=sip_tute ;My Default context for incoming calls
port=5060

bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes
;When Asterisk is in behind a NAT

externip = xx.xx.xx.xx. ;//Our router’s serial interface
; Address that we’re going to put in outbound SIP messages

localnet=172.22.4.0/255.255.255.0

[adslrouter]
type=friend
username=adslrouter
secret=adslrouter123
host=dynamic
context=sip_tute

nat=yes

canreinvite=no
dtmfmode=rfc2833

;Qualify=yes

disallow=all
allow=ulaw
allow=alaw
allow=g729
allow=gsm

you are obviously tunneling the SIP packets (port 5060), but i’ll bet your forgot the RTP packets (10000-20000 or so?) udp. another reason why SIP sucks behind a firewall, compared to IAX…

What do you mean? I didn’t get it.

I have given the range 10000-20000 in my rtp.conf

Do i have to modify that?

i don’t think so. i just wondered if that was it, since you didn’t say you’d port forwarded the rtp range too.

Another problem you can have is where the internal IP address of your SIP phone is in the same subnet address range as the internal IP address of your Asterisk box.

As far as I can tell from debugging the SIP packets that get sent in this scenario, Asterisk sees the incoming packets labelled with what, to it, appear to be a local IP address, so it puts its local IP address in the outbound packets instead of the value of externalip. The symptoms exhibited in this scenario are SIP phones registering and then immediately being labelled UNREACHABLE because the SIP OPTIONS message being sent to the phone is being sent with the wrong IP address in the headers.

If you use nat=always, I believe this forces Asterisk to use the source IP address and port of the packets rather than the IP address and port in the SIP headers, although you may still find you have to put your SIP phone on a different subnet.

good point, mike!

Yeah, I think i have the exact problem scenario you have mentioned. My SIP phones that are outside the LAN soon after registering, immediately being labelled UNREACHABLE.

My Sip phone and the Asterisk SVR are in different subnet ranges as well. And I have tried with nat=always, nat=yes, nat=route options one by one in my sip.conf but not succeeded anyway.

Following is my RTP entry in rtp.conf.
rtpstart=10000
rtpend=20000

Could someone please guide me?

Do you have externalip set in sip.conf? This should be set to the external IP address of your router (ie. public IP address).

Yes i have already put that properly. You can see my sip.conf at the begining of this forum question.

Yesterday I have tested with an IAX soft phone with Asterisk. That works fine in both LAN and WAN.

But I have to work with SIP phones, 'cos I have certain SIP phones that has to be configured with my Asterisk SVR in WAN. I hav no choice rather than working with SIP somehow. As IAX is workin…of course my SIP phones are working nicely in the LAN…I wonder my problem is with NAT… But i have even tried by port forwarding my SIP and RTP ports in my router… But it also didn’t help.

Pls help…

Do some one know any IAX hard phones that works on gsm or g729 for cheaper prices?

Hey, I was having the same problem as you did…

What i did:

nat=allways

and i have removed externhost and localnet, and outgoing sound works… Now the incoming, i’m working on that too…

Please let me know if you have any progress…
Can you please forward me a snap shot of your current sip.conf. and the rtp range in the rtp.conf.

Regards…
Himidiri

Dear Sypher,

Yes…at last it’s working…but only one way round…exactly as your’s.
Anyway thanks a lot…

Here’s the scenario, My Asterisk side voice is coming… But SIP phone side no voice… Now me too, working on that.

If you have any progress please let me know…

Thanks a lot…, once again.

Himidiri.

Yes… At last I’m able to fix this voice problem with your help.
Now my sip phones in the WAN are working cool, but there’s still a little noise in the Asterisk side FXS lines…sip phone side it is almost perfect…Now i’m trying to reduce this noise problem as well. If you have any idea please inform me.

What i had done was downloaded a new sip phone which has some additional features…i guess. This phone is known as “Express Talk”. In order to obtain this windows softphone you can download it for free from nch.com.au/talk/index.html.

And i have came to know that some devices can easily be configured with this NAT=allways option and some are NOT.

Regards…