[Asterisk-bsd] One way calling... NetBSD, sipphone or NAT problem?

Jay Adelson jay at adelson.org
Mon Oct 11 20:20:35 CDT 2004


Hey folks...

I'm running asterisk on NetBSD 2.0.

My configuration is such that the box it is running on is also serving as
a router and NAT device.  I get a strange error (details below) when
the bindaddr is set to 0.0.0.0, where it tries to use my $HOST variable
and do a reverse lookup to find the IP to bind to.  If I hack it, and
put it in my locahosts file so it resolves, at least that problem appears to
go away.

Now, if it is set to my NAT interface IP, i get no error, and if it is set 
to my external IP, the phones on the inside won't register to it because 
asterisk isn't listening on the external IP.  For this reason, I wanted
the bindaddr to be 0.0.0.0.

When I place a call via sipphone, which registers fine, the remote users
gets the call and answers it without problem.  They can hear me fine.
However, even though we've run traces and the packets hit the asterisk box,
no packets go from the asterisk box to the phone.

I also get this error repeatedly, only when the bindaddr is 0.0.0.0:

Oct 11 16:55:22 ERROR[1262485504]: acl.c:265 ast_ouraddrfor: Error writing to routing socket: Invalid argument

Here are my configs.  Any thoughts?  Again, NetBSD 2.0.

For the sip.conf, it looks something like this:

[general]
port = 5060                     ; Port to bind to
bindaddr= 0.0.0.0		; This is supposed to work.
externip = 208.XXX.XXX.XXX      ; Address we're going to put in SIP messages
                                ; since we're behind a NAT
localnet = 192.168.168.0/255.255.255.0
context = from-sip              ; Default for incoming calls

;Register for sipphone.com:

register=1747XXXXXXX:password at proxy01.sipphone.com/1000

[sipphone]
type=friend
secret=password
username=1747XXXXXXX
host=proxy01.sipphone.com
dtmfmode=inband
disallow=all 
allow=ulaw 
allow=alaw 
allow=g729 
fromdomain=sipphone.com
callerid="Me <1747XXXXXXX>"
qualify=no
reinvite=no
canreinvite=no
nat=yes

[1000]
type=friend
;username=1000
;password=polycom
host=dynamic
defaultip=192.168.168.50  ;inside the NAT
mailbox=101
context=intern
canreinvite=no
dtmfmode=inband
nat=1

My extensions.conf file is essentially jtodd's... Like this:

[globals]

PHONE1=SIP/1000
PHONE1VM=1000
SIPPHONEUSERID=1747XXXXXXX

(removing a ton of stuff we've all seen before)

[intern]
exten => _.,1,NoOp
;exten => _.,1,Macro(record-on,${EXTEN},${CALLERIDNUM})
exten => _.,2,Goto(intern-post,${EXTEN},1)

; 
[intern-post]
; if someone dials "5" in front of their number, send out via sipphone (free)
include => sipphone-forced

[sipphone-forced]
; If the user is calling 5xxx... then we assume that they are calling
; a SIPPHONE extension, and send accordingly.
;
exten => _5.,1,SetCallerID(${SIPPHONEUSERID})
exten => _5.,2,SetCIDName(${MYNAME})
exten => _5.,3,Dial(SIP/${EXTEN:1}@proxy01.sipphone.com)
exten => _5.,4,Playback(invalid)
exten => _5.,5,Hangup

[from-sip]
exten => _.,1,NoOp
;exten => _.,1,Macro(record-on,${EXTEN},${CALLERIDNUM})
exten => _.,2,Goto(from-sip-post,${EXTEN},1)

; From sipphone...

exten => ${SIPPHONEUSERID},1,Dial(${PHONE1},30,Ttm)
exten => ${SIPPHONEUSERID},2,Playback(transfer)
exten => ${SIPPHONEUSERID},3,Macro(dialpstnout,${MYCELLPHONE},20)
exten => ${SIPPHONEUSERID},4,Voicemail(u${PHONE1VM})
exten => ${SIPPHONEUSERID},5,Hangup
exten => ${SIPPHONEUSERID},102,Voicemail(b${PHONE1VM})
exten => ${SIPPHONEUSERID},103,Hangup

[local]
; 1000 is my Polycom
;  
exten => 1000,1,Dial(${PHONE1},30,t)
exten => 1000,2,Playback(invalid)
exten => 1000,3,Hangup
exten => 1000,102,Voicemail(1000)
exten => 1000,103,Hangup


--


More information about the Asterisk-BSD mailing list