[Asterisk-Dev] ast_data, mysql, md5secret

Gunnar Schaller linux at nowin.de
Tue Jun 15 11:37:12 MST 2004


I am running asterisk cvs version patched with newest ast_data. My
database is in MySQL, and there is my problem. Anything works fine,
but the passwords for the sipfriends are in plain text. Because of
security reasons I would like to have them in md5. In other words, I
want so have the "md5secret" from sip.conf in MySQL.
So I had a look in the asterisk-source. I modified the file
asterisk/data/data_mysql.c and added following around line 1070 and
the same around line 1865:

   if (!strcasecmp(fname, "md5secret")) {
      ast_data_add_string(response, ASTDATA_ATTR_MD5PASSWORD, fvalue);
   }

Next I added the fild md5secret to my database and filled in a
md5-hash for a test-user. For testing I changed the field secret of
that user, but don't changed it in the sip-client.
After recompiling asterisk it doesn't work. It looks like chan_sip
don't get the md5secret (I played around in chan_sip.c and displayed
the md5secret on asterisk-console - for a user in sip.conf it worked).
Can anybody give me hints? It would be fine to have a md5secret in the
database.


Thanks,
Gunnar Schaller




More information about the asterisk-dev mailing list