[asterisk-dev] SIP Registration Issue

Damien voip at facts.com.au
Mon Feb 27 13:46:41 MST 2006


Hi, new to the list.

I'm having an issue with registration to a new sip provider in 
Australia. I don't pretend to understand all the SIP RFC's, but from my 
understanding it may be an issue on both sides. I currently have a 
stable registration, but have had to do a small "hack" to chan_sip.c to 
get it working. The problem is with re-registration, that is, the first 
registration works, but subsequent registrations fail.

Without the hack, this is the sequence (SIP message type, auth headers only)

Initial Registration:
=> SIP REGISTER (no headers)
<= SIP 407 (Proxy-Authenticate)
=> SIP REGISTER (Proxy-Authorization)
<= SIP 200 OK

Re-registration (after expiry)
=> SIP REGISTER (Authorization - old credentials)
<= SIP 401 (WWW-Authenticate - new credentials)
=> SIP REGISTER (Authorization - new credentials)
(last two lines loop indefinately)

The hack is simple, on re-registration, I send Proxy-Authorization 
instead of Authorization header, initial registration is the same as 
above, but the re-registration now works fine and looks like this:

=> SIP REGISTER (Proxy-Authorization - old credentials)
<= SIP 407 (Proxy-Authenticate - new credentials)
=> SIP REGISTER (Proxy-Authorization - new credentials)
<= SIP 200 OK

I understand that it is okay for a SIP proxy to send old credentials, 
but should asterisk send an Authorization header in a re-register 
message if it has never used an Authorization header or ever been 
requested to send this header? If it has only sent a Proxy-Authenticate 
to a certain provider, shouldn't it send a Proxy-Authenticate on 
subsequent registrations?

The provider is not being overly helpful with this one and I am not sure 
whether the issue is with the provider, asterisk, or both. Any comments 
greatly appreciated.

Damien



More information about the asterisk-dev mailing list