Yes, it's possible in spite of what ManxPower and others have said on the #asterisk channel! They mean well, it isn't fun and it won't work with all routers.
So here is is. I have a WRT54G at home with the following connected to this router:
- 1 BT102 SIP phone
- 1 IAXy
- multiple SIP softphones on PC and laptop
Asterisk is running at the office on a Linksys WAG54G at 192.168.1.5.
Let's start with the port forwarding on the asterisk router:
- 5060 (sip) UDP/TCP to 192.168.1.5
- 10000-10100 UDP to 192.168.1.5 - (same ports in rtp.conf)
- 4569 (IAX2) UDP to 192.168.1.5
- 22 (ssh) to 192.168.1.5
The client side configs (on the home router):
Port protocol device
- 5060 UDP/TCP BT102
- 10000-10049 UDP BT102
- 5061 UDP/TCP Softphone1
- 10050-10100 Softphone1
- 4569 UDP IAXy - I need this to reprovision from a dynamic asterisk server ip
Set the Grandstream to begin using RTP ports at 10000.
Set Softphone1 to use 10050
Set Softphone1 to sip.yourserver.com:5061
That's all I've done. When someone else got a phone to put on his DSL connection, he forwarded 5060 to the phone, set it to use 10000 for rtp and it worked right away.
Also, in sip.conf I have nat=yes in the general section with externip= and localnet= filled in.
In all type=friend entries that are behind NAT are also
nat=yes
canreinvite=no
hth
