[Asterisk-Dev] possible bug in checking SIP authentication ?

Luigi Rizzo rizzo at icir.org
Mon May 30 08:19:23 MST 2005


Hi,
I have spent a few hours trying to figure out what's wrong here,
and there are two things I do not understand.

I have two asterisk nodes, 'home' (dynamic IP) and 'office' (static IP)
with the config below:

    home: sip.conf
            register => bob:xxxyyyzzz at office/123456
       [office]
       type=peer
       host=12.34.56.78 ; actually, office's real IP!
       secret=xxxyyyzzz

    office: sip.conf
       [bob]
       type=friend
       secret=xxxyyyzzz
       host=dynamic

    office: extensions.conf
       [my_friends]
       exten => bob,1,Dial(SIP/${EXTEN})


'home' registers with 'office' correctly. The REGISTER message has

        Proxy-Authorization: Digest username="bob", ...

and this is the username used to compute hashes. Pretty much what I expected.

'home' can Dial(SIP/someexten at office) correctly. The INVITE message has

        Proxy-Authorization: Digest username="bob", ...

and this is the username used to compute hashes. Pretty much what I expected.

If 'office' tries to call bob at my_friends, registration fails.
"sip debug" shows that the INVITE message from 'office' has

        Proxy-Authorization: Digest username="123456", ...

which seems a bit odd, given that the '123456' comes from the
peer record, where there is also a username="bob" record.

The second odd thing is that 'home' tries to compute the hashes with

        username="office"

(in this particular case, the code matches a peer, and line 6157
in chan_sip.c calls check_user_full() with peer->name as username.
Once again, peer has a username field which i would expect to be used.

So, are both intended behaviours or should I file a bug report ?

        cheers
        luigi




More information about the asterisk-dev mailing list