[OpenSIPS-Users] How to recalculate ha1 and ha1b
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Fri Jul 10 17:40:28 CEST 2009
Hi Dioris,
Could you upload this on the web site (TIPS section) for other people
benefit ? See: http://www.opensips.org/Resources/Documentation#toc4
If you create an account on the web site, you are free to edit the content.
Thanks and regards,
Bogdan
Dioris Moreno wrote:
> When you change the domain column in the subscriber table, you have to
> recalculate ha1 and ha1b fields. In order to do that you must have the
> password of each subscriber. It is stored in the 'password' column if
> you have set STORE_PLAINTEXT_PW=1 in opensipsctlrc (default).
>
> HA1 is a MD5 hash of "username:domain:password". For example, if you
> have created a SIP account 1000 at mydomain.com
> <mailto:1000 at mydomain.com> using password 123456, then HA1 is the MD5
> hash of "1000:mydomain.com:123456 <http://mydomain.com:123456>"
> (without quotes). On the other hand HA1B is the MD5 hash of
> "username at domain:domain:password"; so using the same example above,
> HA1B would be the MD5 hash of "1000 at mydomain.com:mydomain.com:123456
> <http://ydomain.com:123456>" (without quotes).
>
> So, to recalculate and update ha1 and ha1b columns in the subscriber
> table, just execute the following sql statement in mysql:
>
> update subscriber
> set ha1 = md5(concat(username, ':', domain, ':', password)),
> ha1b = md5(concat(username, '@', domain, ':', domain, ':', password))
>
> I hope this could be useful.
>
> Regards,
>
> Dioris
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
More information about the Users
mailing list