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.
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/a...
Venlig hilsen, Carsten
2011/9/20 Morten Isaksen misak@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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hi Carsten,
Thanks, that solved the problem.
/Morten
On Tue, Sep 20, 2011 at 10:03 PM, Carsten Bock carsten@ng-voice.com wrote:
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/a...
Venlig hilsen, Carsten
2011/9/20 Morten Isaksen misak@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@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@ng-voice.com
Mobile +49 179 2021244 Office +49 40 34927219 Fax +49 40 34927220
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users