Thomas Hoellriegel
2005-Jan-01 16:52 UTC
[Asterisk-Users] Problems to use asterisk with mysql /odbc
hi, i.m. newbie in asterisk. asterisk 1.0.3 is my current version.
i like to store usernames and passwords in a sql database.
i like to log failed authentification-passwords, to create a blacklist for
securityreasons.
i thingk a sql-database is a good way to log these actions.
i don.t find debugging-options to output invalid login-passwords.
Ok, i have made the following:
debian is my OS. mysql is installed and working.
i has compiled astersk as follows:
Modefying:
/usr/src/asterisk-1.0.3/channels/Makefile
USE_MYSQL_FRIENDS=1
USE_SIP_MYSQL_FRIENDS=1
make, and: make install are correctly.
i have probed many choises:
chois1:
i has create a database sipfriends:
mysqladmin create sipfriends
the database:
CREATE TABLE Sipfriends (
Name varchar(40) NULL default '',
Secret varchar(40) NULL default '',
Context varchar(40) NULL default '',
Username varchar(40) default '',
paddr varchar(20) NULL default '',
Port int(6) NULL default '0',
Regseconds int(11) NULL default '0',
PRIMARY KEY (Name)
) TYPE=MyISAM;
i setting up:
/usr/asterisk/etc/asterisk/res_odbc.conf
[mysql]
dsn => sipfriends
username => root
password =>
pre-connect => yes
it is not sql-password set. i have only access to this machine.
asterisk can't authenficate users from the database.
chois2:
i copy from asterisk-sources:
contrib/scripts/retrieve_sip_conf_from_mysql.pl
in my /usr/asterisk/etc/asterisk directory.
i create a mysql database:
mysqladmin create sip
i pasted the table:
CREATE TABLE sip (
id INT(11) DEFAULT -1 NOT NULL,
keyword VARCHAR(20) NOT NULL,
data VARCHAR(50) NOT NULL,
flags INT(1) DEFAULT 0 NOT NULL,
PRIMARY KEY (id,keyword)
);
in the database.
i add the following line in sip.conf:
#include = retrieve_sip_conf_from_mysql.pl
asterisk say:
== Parsing '/usr/asterisk/etc/asterisk/sip.conf': Found
== Parsing '/usr/asterisk/etc/asterisk/=
retrieve_sip_conf_from_mysql.pl': Not
found (No such file or directory)
mysql auth is not working in asterisk.
what can i do please? thankx for your help
---------------
tel : 089 2500 7676
homepage: http://www.blindi.net
blinde-misc mailingliste f?r blinde. anmeldung unter:
http://www.blindi.net/mailman/listinfo/blinde-misc
Thomas Hoellriegel
2005-Jan-03 15:06 UTC
[Asterisk-Users] how can setup mysql in sip.conf?
Hi, i have a problem:
asterisk 1.0.3 is my current version.
i copy from asterisk-sources:
contrib/scripts/retrieve_sip_conf_from_mysql.pl
in my /usr/asterisk/etc/asterisk directory. I edit this script and remove
-T -option
#!/usr/bin/perl -w
i create the mysql database:
mysqladmin create sip
i pasted the example-table in the database:
CREATE TABLE sip (
id INT(11) DEFAULT -1 NOT NULL,
keyword VARCHAR(20) NOT NULL,
data VARCHAR(50) NOT NULL,
flags INT(1) DEFAULT 0 NOT NULL,
PRIMARY KEY (id,keyword)
);
i settingup res_odbc.conf as follows:
[mysql]
dsn => sip
username => root
password =>
pre-connect => yes
i add the following line in the sip.conf file:
#include = "retrieve_sip_conf_from_mysql.pl"
Asterisk is started with: -vvvvc
the asterisk output is:
== Parsing '/usr/asterisk/etc/asterisk/sip.conf': Found
== Parsing '/usr/asterisk/etc/asterisk/=
retrieve_sip_conf_from_mysql.pl': Not
found (No such file or directory)
why can't find asterisk the perl-script?
mysql authentification is not working in asterisk.
what can i do please?
mysql and the template-database are success installed.
thankx for your help.
---------------
tel : 089 2500 7676
homepage: http://www.blindi.net
blinde-misc mailingliste f?r blinde. anmeldung unter:
http://www.blindi.net/mailman/listinfo/blinde-misc