Phone-to-phone behind the same NAT


#1

Hi,

I have no problem of multiple phones behind the same NAT, registering with an asterisk server outside NAT (Pubic Address). Phones can call PSTN via Asterisk, or other phones behind other NATs with no problem.

But these phones can’t speak to each other. They can ring each other (sip working). But when you pickup the phone, there are no audio (RTP not working). I can see the RTP packets are dropped on the NAT device with icmp port unreachable error. The source & destination RTP ports are correct. The NAT device can’t forward these packets to the phone on its inside interface.

Does this surpose to work? i.e. phone-to-phone behind the same NAT device, with asterisk service outside NAT.

Thanks,

Wei


#2

not sure but maybe it’s something liek the fact that to the remote asterisk box the source and destination address are the same?

just a tought?


#3

Solution ::
If you use asterisk as a sip & rtp proxy it could work. But if you use this as only sip proxy your rtp should not work because the SDP message tell the phone to send voice peer to peer but wrong port. But if use do not want every voice packet send via asterisk use should use STUN.


#4

[quote=“thotsaphon07”]Solution ::
If you use asterisk as a sip & rtp proxy it could work. But if you use this as only sip proxy your rtp should not work because the SDP message tell the phone to send voice peer to peer but wrong port. But if use do not want every voice packet send via asterisk use should use STUN.[/quote]

what do you mean “use asterisk as rtp proxy” ?

How do you do that?

Im having sip and rtp nat problem with audio on one side and this may be the solution.

Thx!


#5

If I understand right your problem, a solution can be to put canreinvite=no in each of this phone in sip.conf. That way, asterisk will be keep in media path and fix the problem you experience. This may be not the better solution, but it’s working for me, I never really find other solution.

Hope this help !


#6

[quote=“Stegie”]If I understand right your problem, a solution can be to put canreinvite=no in each of this phone in sip.conf. That way, asterisk will be keep in media path and fix the problem you experience. This may be not the better solution, but it’s working for me, I never really find other solution.

Hope this help ![/quote]

I tried doing that but no luck so far.

The scenario I have is this, I have my asterisk server behind a NAT and Im port forwarding ports 4569 5004 5060 and 10000-20000 to that asterisk box.

From the outside I have some sip phones connecting to asterisk, they can connect ok but I have audio on one side only.

Here is an example of my sip.conf

[test]
callerid=Test <101>
language=sp
type=friend
host=dynamic
secret=xxxx
dtmfmode=info
context=xxxxx
nat=yes
canreinvite=no
;incominglimit=1
callgroup=1
pickupgroup=1
disallow=all
allow=alaw
allow=ulaw
qualify=1000


#7

for weihu: I “think” , therefore i am not a expert , just trying to help

because ur softphone clients are behind the NAT router and ur asterisk is a public address. When one of the client want to connect to asterisk , it must contact asterisk and register itself with asterisk. Thus asterisk see the ip address as [$IP_address_1]. But when the second phone connects to asterisk , it is still [$IP_address_1] logged in asterisk when registered. There is will be a slight problem in RTP packets as the packets now have to go out of the NAT router and back to the NAT router to the second client. There are 2 potential problem for this. There is a problem as the NAT wont known whose RTP packet it is for. (usually case for SIP behind NAT). And another problem is the NAT firewall problem where the destination of the outgoing packet is the actual ip of the router, the router might reject the outgoing packet due to security. The router see that the first client is contacting the router with it external ip address instead of its internal 192.168.1.1(presumed) address. The Nat might drop it.

Not sure if this helps. I am no expert but just trying to share. For the transverse of packet thru NAT for SIP, you can try to use a STUN server or try IAX instead of SIP. For the Firewall , look to change the configuration for the router box.


#8

for akrall: I “think” also , therefore i am no expert

Your SIP phones are behind another NAT? For Asterisk to be behind a NAT, the solution was always to forward the ports out to the nat like u have done. Having audio oneway is a common occurance of SIP behind NAT problem. You had tried a Stun Server?

not sure u tried this page?

http://www.voip-info.org/tiki-index.php?page=Asterisk+SIP+NAT+solutions


#9

[quote=“Weiqiang”]for akrall: I “think” also , therefore i am no expert

Your SIP phones are behind another NAT? For Asterisk to be behind a NAT, the solution was always to forward the ports out to the nat like u have done. Having audio oneway is a common occurance of SIP behind NAT problem. You had tried a Stun Server?

not sure u tried this page?

http://www.voip-info.org/tiki-index.php?page=Asterisk+SIP+NAT+solutions[/quote]

I was able to fix the problem using STUN and some sip.conf but I still have one problem with 2 asterisk trying to talk to each other, its weird!