Sip registration timeouts to Broadvoice

I’ve done a bunch of searching on this forum, google, etc. and seen lots of posts and tried all of them (I think) but I still cannot get my asterisk server to register with broadvoice. I get the registration timeout error listed above. The only thing that I have not tried yet is putting the asterisk server outside of my nat firewall and connecting that way. I don’t think that is the problem, though, since I am able to connect to the demo at digium via IAX through the firewall without issue. I was also able to get an xlite phone to register with broadvoice with minimal tinkering. So, I am fairly sure that I am missing something in one of my config files.

I came across one posting from 2004 that stated that asterisk needed a patch to work with broadvoice but it seemed to indicate that the patch had been pulled into the stable branch some time ago. Does anyone know if that is the case?

The relevant sections of my sip.conf and extensions.conf are below as well as the exact error message. I am using asterisk 1.2.10 on debian sarge (asterisk compiled from source NOT the debian packages). Currently I’ve got nat turned off and I’ve got the firewall setup to forward traffic destined for port 5060 to the asterisk server. I’ve tried it both ways (NAT on, NAT off, port forwarding, etc. with no luck). Any pointers or links will be greatly appreciated.

Thanks,

Craig Russell
AirDigitalNetwork.com

[general]
context=default ; Default context for incoming calls
bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
domain=craig-russell.com ; Set default domain for this host
domain=asterisk
domain=192.168.1.13 ; Add IP address as local domain
autodomain=yes ; Turn this on to have Asterisk add local host
pedantic=no ; Enable slow, pedantic checking for Pingtel
videosupport=yes ; Turn on support for SIP video
disallow=all ; First disallow all codecs
allow=ulaw ; Allow codecs in order of preference
allow=ilbc ;
register => 8027121425@sip.broadvoice.com:password@sip.broadvoice.com/8027121425
externip = 64.192.35.61 ; Address that we’re going to put in outbound SIP messages
localnet=192.168.0.0/255.255.0.0; All RFC 1918 addresses are local networks
nat=no ; Global NAT settings (Affects all peers and users)
[8027121425]
; Turn off silence suppression in X-Lite (“Transmit Silence”=YES)!
; Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed
type=friend
context=default
callerid=“Craig Russell” <2000>
host=dynamic ; This device needs to register
user=8027121425
secret=craig
nat=yes ; X-Lite is behind a NAT router
canreinvite=no ; Typically set to NO if behind NAT
disallow=all
allow=gsm ; GSM consumes far less bandwidth than ulaw
allow=ulaw
allow=alaw

[sip.broadvoice.com]
type=peer
user=phone
host=sip.broadvoice.com
fromdomain=sip.broadvoice.com
fromuser=8027121425
username=8027121425
secret=password
insecure=very
context=default
authname=8027121425
dtmfmode=inband
dtmf=inband
canreinvite=no
qualify=no

exten => 8027121425,1,Answer()
exten => 8027121425,2,Playback(hello-world)
exten => 8027121425,3,Hangup()

Jul 21 11:04:28 NOTICE[2502]: chan_sip.c:5366 sip_reg_timeout: – Registration for '8027121425@sip.broadvoice.com@sip.broadvoice.com’ timed out, trying again (Attempt #19)

Retransmitting #2 (no NAT) to 147.135.20.128:5060:
REGISTER sip:sip.broadvoice.com SIP/2.0
Via: SIP/2.0/UDP 64.192.35.61:5060;branch=z9hG4bK19cc4fdb;rport
From: sip:8027121425@sip.broadvoice.com;tag=as4115312d
To: sip:8027121425@sip.broadvoice.com
Call-ID: 1fc8dc4f4de896927bd9f57f73355788@sip.broadvoice.com
CSeq: 123 REGISTER
User-Agent: Asterisk PBX
Max-Forwards: 70
Authorization: Digest username="8027121425@sip.broadvoice.com", realm=“BroadWorks”, algorithm=MD5, uri=“sip:sip.broadvoice.com”, nonce=“BroadWorksXepwqmx92Ttbzxr2BW”, response=“17a32254aea32e9377b8f6bee837545f”, opaque="", qop=auth, cnonce=“5d75975d”, nc=00000010
Expires: 120
Contact: sip:8027121425@64.192.35.61
Event: registration
Content-Length: 0

There are some things unallowed on your broadvoice setup. For example even if you connect you would not be able to dial out because you have videosupport enabled. You can use the setup below to register and extensions.conf.

sip.conf

[general]
context=default
pedantic=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
tos=reliability
maxexpiry=180
defaultexpiry=160
disallow=all
disallow=gsm
allow=ulaw
allow=alaw
musicclass=default
outgoinglimit=2
incominglimit=9999
externip=Your WAN or Public IP or Domain
localnet=local ip address/local subnet mask

register => phonenumber@sip.broadvoice.com:password:phonenumber@sip.broadvoice.com
;register => phonenumber@sip.broadvoice.com:password:phonenumber@sip.broadvoice.com ;if you have another sip account

;Definitions of locally connected SIP phones.

[2000]
type=friend
username=2000
secret=test
password=test
host=dynamic
context=global
nat=yes
canreinvite=no
qualify=yes
mailbox=2000@default

[2001]
type=friend
username=2001
secret=test
password=test
host=dynamic
context=global
nat=yes
canreinvite=no
qualify=yes
mailbox=2001@default

[out-bv] ;outbound context
type=peer
user=phone
host=sip.broadvoice.com
fromdomain=sip.broadvoice.com
fromuser=phonenumber
secret=password
username=phonenumber
insecure=very
context=sip.broadvoice.com
authname=phonenumber
dtmfmode=inband
dtmf=inband
canreinvite=no ;Disable canreinvite if you are behind a NAT
nat=yes

[sip.broadvoice.com] ;inbound context
type=user
user=phone
host=sip.broadvoice.com
fromdomain=sip.broadvoice.com
fromuser=phonenumber
secret=password
username=phonenumber
insecure=very
context=sip.broadvoice.com
authname=phonenumber
dtmfmode=rfc2833
dtmf=rfc2833
canreinvite=no
nat=yes

[out-bv2] ;another outbound context if you have more than 1 type=peer
user=phone
host=sip.broadvoice.com
fromdomain=sip.broadvoice.com
fromuser=phonenumber
secret=password
username=phonenumber
insecure=very
context=sip.broadvoice.com
authname=phonenumber
dtmfmode=inband
dtmf=inband
canreinvite=no ;Disable canreinvite if you are behind a NAT
nat=yes

[sip.broadvoice.com] ;inbound context
type=user
user=phone
host=sip.broadvoice.com
fromdomain=sip.broadvoice.com
fromuser=phonenumber
secret=password
username=phonenumber
insecure=very
context=sip.broadvoice.com
authname=phonenumber
dtmfmode=rfc2833
dtmf=rfc2833
canreinvite=no
nat=yes

extensions.conf

[general]

static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
priorityjumping=no

[globals]

include=>inbound
include=>outbound

[sip.broadvoice.com] ;This is going to be your inbound trunk, telling all incoming calls where to go

exten=>12345678900,1,Goto(from-pstn|s|1)
exten=>2345678900,1,Goto(from-pstn|s|1)
exten=>5678900,1,Goto(from-pstn|s|1)

[from-pstn]
exten=>s,1,Dial(SIP/200)

Thanks for the reply. I tried those config examples (literally, character for character) and I’m still getting the same registration timeout. I set my firewall back to the defaults (got rid of all of the port forwarding rules that I was trying) and still no joy. My next step is to put the asterisk server outside of my firewall and grab another public IP (I run the ISP so I can have as many as I need) and see if that helps at all. Since I was able to register the xlite phone from internally, I don’t think that is the problem but I’m at a loss as to what to try next now.

Definitely learning a lot about how asterisk works. So far, other than my difficulty getting broadvoice to work, I am extremely impressed with the software. Since I’ve seen others that are using broadvoice, I’m sure that this issue is something that I’m going to kick myself for when I finally figure it out.

Thanks

Craig Russell
AirDigitalNetwork.com

In that case, next thing you want to do is ping all of broadvoice’s sip proxies below and choose the next closest to you (lowest ms response time frame) insert the IP into your etc/hosts.conf like this (side by side with lots of space in between):
XXX.XXX.XXX.XXX sip.broadvoice.com
and try registering to it. I have gone through this myself and I had to try a different proxy. Proxies might reject registrations for different reasons.

proxy.lax.broadvoice.com
proxy.dca.broadvoice.com
proxy.mia.broadvoice.com
proxy.atl.broadvoice.com
proxy.chi.broadvoice.com
proxy.bos.broadvoice.com
proxy.nyc.broadvoice.com

Ok-
That did it. I’m not sure why a proxy with a longer round trip time would work better but it does. Registration works now (actually, instead of a time out, I got a authorization failed which led me to another problem, that was solvable, without help). So I guess my next question would be, is this a broadvoice issue, or something to expect from any voip provider. I had already done the testing of roundtrip times to each proxy and setup /etc/hosts for such (although I am new to phone systems and asterisk in particular, I’m not new to networking and system administration). In general, what types of things would cause a proxy to time out an authorization, regardless of network latency?

Anyway, I do appreciate the help and insight.

I am up and running now and looking forward to an interesting foray into the phone business.

Craig
AirDigitalNetwork.com