[SR-Users] Kamailio - Nonce validity between Register and Invite

patrice.bodeven at orange.com patrice.bodeven at orange.com
Wed Aug 22 10:51:26 CEST 2012


Hello,

I am working on Kamailio 3.2.2. There is no traffic, only functional test done.

Based on the SIP Client used until now (Xlite), the INVITE is systematically authenticated by 407 as there is no Proxy-Authorization in the initial INVITE. Expected/normal behavior.

But when using an internal SIP client, the initial INVITE is generated with a Proxy-Authorization containing the nonce value used by the successful registration.
In Authorization of Register (the answer is 200OK)
Digest username="+33296488922 at ims.v0.pftest.net", realm="sip:ims.v0.pftest.net", nonce="UDP43lAzpH7SjicT6+9/KDDloW4OTfTXoGWlZurBVut0JV604jox/QY+tVeA", uri="sip:ims.v0.pftest.net", response="4ed51b8e62cf769b19f8c4771e068ad3", cnonce="06440000000529330fe1", qop=auth, nc=00000011

In Proxy-Authorization of Invite
Digest username="+33296488922 at ims.v0.pftest.net", realm="sip:ims.v0.pftest.net", nonce="UDP43lAzpH7SjicT6+9/KDDloW4OTfTXoGWlZurBVut0JV604jox/QY+tVeA", uri="sip:0157361149 at ims.v0.pftest.net", response="b247052d6d5b37e0b6677c816390cb77", cnonce="06440000000529330fe1", qop=auth, nc=00000012

As the nonce expire is high (see nonce_expire), I don't understand why Kamailio requests the Authentication of the INVITE by 407.
407 with Proxy-Authenticate: Digest realm="ims.v0.pftest.net", nonce="UDP6pVAzpkWDF+jSlP3zzVYcuNPhY8NQBj62WIA=", qop="auth", stale=true

Does it mean that the REGISTER and INVITE are using different Nonce value ?

==> Information on my configuration file.

modparam("auth_db", "db_url", DBURLAUTH)
modparam("auth", "auth_checks_register", 6) # callid and From TAG
modparam("auth", "qop", "auth")    # enable qop=auth
modparam("auth", "nonce_count", 1) # enable nonce_count support
modparam("auth", "nonce_expire", 21600)   # Set nonce_expire to 6 hours

For register, I do
                 if (!www_authorize("$ru", "subscriber"))
                {
                   if($? == -2 || $? == -3) {
                      sl_send_reply("403","Forbidden auth ID");
                     exit;
                   }
                   else {
                        www_challenge("$ru", "17");
                        exit;
                   }
                }

For invite, I do
           if (!proxy_authorize("$fd", "subscriber"))
           {
               if($? == -2 || $? == -3) {
                  sl_send_reply("403","Forbidden auth ID");
                  exit;
               }
              else {
                   proxy_challenge("$fd", "17");
                   xlog("L_INFO","INVITE challenged by 407 to :$di:$dp \n");
                   exit;
                }
           }

Followed by consume_credentials();

Thanks in advance for your support.
Patrice B


_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
France Telecom - Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, France Telecom - Orange is not liable for messages that have been modified, changed or falsified.
Thank you.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20120822/757acf71/attachment-0001.htm>


More information about the sr-users mailing list