[asterisk-dev] SIP register expiry timer

Mark Michelson mmichelson at digium.com
Tue May 4 10:27:14 CDT 2010


On 05/03/2010 10:41 PM, Joshua Foshee wrote:
> I have a Asterisk 1.6.2.6 box that is sip trunking with Broadvoice.
>
> Broadvoice says that I am sending in register request too many times and
> they are blocking my IP address from being able to register some times.
> I looked into it and I am registing every 30 sec.
>
> I have my sip.conf file setup with this settings.
>
> maxexpirey=3600
> defaultexpire=1800
> Asterisksiprtautoclear=no
> register =>
> 40523xxxxx at sip.broadvoice.com:xxxxxxxxx:40523xxxxxx at sip.broadvoice.com
>
> But it still regestes every 30 sec. I then did a debug and found that
> the SIP register statments from their boarder controller has this
>
> Retransmitting #1 (no NAT) to 206.15.140.221:5060:
> REGISTER sip:sip.broadvoice.com SIP/2.0
> Via: SIP/2.0/UDP 98.174.176.x:5060;branch=z9hG4bK577ca1b1;rport
> Max-Forwards: 70
> From:<sip:40523xxxxx at sip.broadvoice.com>;tag=as3964d4ae
> To:<sip:40523xxxxxx at sip.broadvoice.com>
> Call-ID: 0c12c7af3626edd018e8995631a059f2 at sip.broadvoice.com
> CSeq: 114 REGISTER
> User-Agent: Asterisk PBX 1.6.2.6
> Authorization: Digest username="40523xxxxxx", realm="BroadWorks",
> algorithm=MD5, uri="sip:sip.broadvoice.com",
> nonce="BroadWorksXg8ryetv1Tfxpv44BW",
> response="5dfb67f0e3826dd0549e6c331ef20fbc", qop=auth,
> cnonce="132c7d00", nc=0000000c
> Expires: 120
> Contact:<sip:s at 98.174.176.x>
> Content-Length: 0
>
> <--- SIP read from UDP:206.15.140.221:5060 --->
> SIP/2.0 200 OK
> Call-ID: 0c12c7af3626edd018e8995631a059f2 at sip.broadvoice.com
> CSeq: 114 REGISTER
> From:<sip:40523xxxx at sip.broadvoice.com>;tag=as3964d4ae
> To:<sip:40523xxxx at sip.broadvoice.com>
> Via: SIP/2.0/UDP 98.174.176.x:5060;branch=z9hG4bK577ca1b1
> Contact:<sip:s at 98.174.176.x>
> Expires: 30
> Content-Length:    0
>
> Retransmitting #2 (no NAT) to 206.15.140.221:5060:
> REGISTER sip:sip.broadvoice.com SIP/2.0
> Via: SIP/2.0/UDP 98.174.176.x:5060;branch=z9hG4bK577ca1b1;rport
> Max-Forwards: 70
> From:<sip:40523xxxxx at sip.broadvoice.com>;tag=as3964d4ae
> To:<sip:40523xxxxx at sip.broadvoice.com>
> Call-ID: 0c12c7af3626edd018e8995631a059f2 at sip.broadvoice.com
> CSeq: 114 REGISTER
> User-Agent: Asterisk PBX 1.6.2.6
> Authorization: Digest username="40523xxxxx", realm="BroadWorks",
> algorithm=MD5, uri="sip:sip.broadvoice.com",
> nonce="BroadWorksXg8ryetv1Tfxpv44BW",
> response="5dfb67f0e3826dd0549e6c331ef20fbc", qop=auth,
> cnonce="132c7d00", nc=0000000c
> Expires: 120
> Contact:<sip:s at 98.174.176.x>
> Content-Length: 0
>
> <--- SIP read from UDP:206.15.140.221:5060 --->
> SIP/2.0 200 OK
> Call-ID: 0c12c7af3626edd018e8995631a059f2 at sip.broadvoice.com
> CSeq: 114 REGISTER
> From:<sip:40523xxxxx at sip.broadvoice.com>;tag=as3964d4ae
> To:<sip:40523xxxxxx at sip.broadvoice.com>
> Via: SIP/2.0/UDP 98.174.176.x:5060;branch=z9hG4bK577ca1b1
> Contact:<sip:s at 98.174.176.x>
> Expires: 30
> Content-Length:    0
>
> So it looks like they are overriding my default timer. Is there a way to
> override their response so I only regester every 1800 sec?
>
> Thanks,
> Josh
>
>    

You can't really do anything once they have responded with their 200 OK. 
Unfortunately, registrars have the power of shortening your registration 
interval from your recommendation.

I noticed that Asterisk is only placing a 120 second Expires header in 
its outgoing REGISTERs. You can increase this to 1800 seconds in one of 
two ways. First, you can set the defaultexpiry option in sip.conf to 
1800 (you have "defaultexpire" in your message here). The other way is 
to add "~1800" to the end of your register line.

Mark Michelson



More information about the asterisk-dev mailing list