Dan Zhou
2005-Jan-30 14:21 UTC
[Asterisk-Users] One way call when the * server and phone in a local network
Hi everyone, I started playing with Asterisk server a few days ago. So far, I only have made it 50% work. Here is my situation, IP phone A and Asterisk server are in a same local network behind an ADSL router (public ip = a.b.c.d), and the * server is set as the DMZ host of the router. IP phone B is in another network. IP phone A (10916) ---> ADSL router<-->internet<--> Rotuer2<--IP phone B asterisk server a.b.c.d (10920) (192.168.1.2, DMZ host) I can place call from phone A(10916) to B(10920) without any trouble. But I cannot make a phone call from B to A. I tried "sip debug peer 10920" to check the SIP message flow, and found a problem. Here is part of the log: ..... From: "10920" <sip:10920@a.b.c.d>;tag=zrgrUBMCJ7bVPtqC To: "10916" <sip:192.168.1.2@a.b.c.d> .... SIP/2.0 404 Not Found .... It figures out a wrong target sip address "10916" <sip:192.168.1.2@a.b.c.d>" for some reason. "sip:10916@a.b.c.d" would be better? When place call from 10916 to 10920, it looks fine: ...... From: "10916" <sip:10916@192.168.1.2>;tag=vmu4DFbjvCRUAuD8 To: "10920" <sip:10920@192.168.1.2> ...... I reckon because the * server is the DMZ host, which may affect the traffic to phone A that sits in the same network. Is that the case? Any advice would be grealty appreciated! Thanks. Cheers, Dan p.s my sip.conf [general] context=default ; Default context for incoming calls port=5060 ; UDP Port to bind to (SIP standard port is 5060) bindaddr=192.168.1.2 ; IP address to bind to (0.0.0.0 binds to all) srvlookup=yes ; Enable DNS SRV lookups on outbound calls tos=0x18 disallow=all allow=g729 allow=gsm allow=ulaw allow=alaw allow=all ;If one is willing to forward some ports to the machine running asterisk, adding the following ;lines to the [general] section of sip.conf has been known to work; nat=yes qualify=yes externip=a.b.c.d localnet=192.168.1.0/255.255.255.0 ;canreinvite=no ;the IP phone at home [10916] type=friend secret=lucy host=dynamic callerid=Lucy <10916> disallow=all allow=g729 allow=ulaw allow=alaw nat=yes qualify=yes canreinvite=no ;the IP phone in friend's home [10920] type=friend secret=dan host=dynamic callerid=Dan2 <10920> disallow=all allow=g729 allow=ulaw allow=alaw ;allow=gsm nat=yes qualify=yes canreinvite=no _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar – get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/