[SR-Users] Digest authentication

Carsten Bock carsten at ng-voice.com
Tue Sep 20 22:03:16 CEST 2011


Hi Morten,

The method is not "SIP/2.0". You should try the used method (e.g.
REGISTER or INVITE).
Hope that helps, everything else looks allright; if it is still not
okay, you could compare it to the rfc2617.c of modules/auth-Module:

http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=blob;f=modules/auth/rfc2617.c;h=aaba262c40b8c746c2f3163ddef4dec0c022c0cb;hb=HEAD

Venlig hilsen,
Carsten

2011/9/20 Morten Isaksen <misak at misak.dk>:
> Hi,
>
> Sorry for the slightly off topic question, but I am trying to debug a
> buggy PBX and want to check if the digest information is correct.
>
> I have this perl script.
>
> #!/usr/bin/perl
>
> use strict;
> use Digest::MD5  qw(md5 md5_hex md5_base64);
>
> my $uri = 'sip:sip1.uni-tel.dk';
> my $method = "SIP/2.0";
> my $username = "69102208";
> my $password = "password";
> my $nonce = "4e78d2b0a72196d9123be7c88d093bd74c77f35e";
> my $realm = "sip1.uni-tel.dk";
>
> my $a1 = "$username:$realm:$password";
> my $ha1 = md5_hex($a1);
>
> my $a2 = "$method:$uri";
> my $ha2 = md5_hex($a2);
>
> print "A1  : $a1\n";
> print "A2  : $a2\n";
>
> my $response = md5_hex("$ha1:$nonce:$ha2");
>
> print "\nRES : $response\n\n";
>
> I registered with a softphone and entered the above values from the
> Authentication header, but I cannot get the response to match.
>
> Any help would be appreciated.
>
> --
> Morten Isaksen
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>



-- 
Carsten Bock
CEO (Geschäftsführer)

ng-voice GmbH i. Gr.
Schomburgstr. 80
D-22767 Hamburg / Germany

http://www.ng-voice.com
mailto:carsten at ng-voice.com

Mobile +49 179 2021244
Office +49 40 34927219
Fax +49 40 34927220



More information about the sr-users mailing list