login | register
Fri 22 of Aug, 2008 [00:25 UTC]

voip-info.org

Discuss [5] History

Asterisk sip conf from mysql

Created by: flavour,Last modification on Mon 21 of Jan, 2008 [14:03 UTC] by batchman
There is a script in contrib/scripts called:
retrieve_sip_conf_from_mysql.pl

Another example is attached with this post.
Image


This can be used to write a file to be #included in sip.conf
(by default it's called sip_additional.conf)

Create database (NB The username specified in the script only needs to have SELECT priviliges on this 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)
);

Each user has several records which are linked by sharing the same 'id'
One of these records must have
keyword: 'account'
data: username to be written out as [username]
Normally the minimal other record would be one with keyword: 'secret'

Records with id: '0' are applied to all users.

If flags is set to 1, then that record is not included in the output file


Asterisk needs to be reloaded after running this script in order to see the changes activated.


Back to Asterisk configuration from database



Comments

Comments Filter
222

333Another PERL-script to use if you have all data in a single row...

by batchman, Monday 21 of January, 2008 [13:58:35 UTC]
I initially posted another example as a comment, but now it is an attachment to the post instead.
222

333

by thebugslayer, Wednesday 03 of October, 2007 [14:11:29 UTC]
I found it inside the source package
asterisk-1.4.11/contrib/scripts/retrieve_sip_conf_from_mysql.pl

222

333

by duca03, Tuesday 02 of October, 2007 [06:55:57 UTC]
Hi there i am having some trouble getting this script to work with my database and asterisk, can i please get some assistance from someone who has gotten this script to work???
222

333Re: retrieve_sip_conf_from_mysql.pl

by rahulb, Monday 03 of September, 2007 [07:58:50 UTC]
just do updatedb on ur linux machine......... and u'll find that
222

333retrieve_sip_conf_from_mysql.pl

by parttimejesus, Monday 28 of May, 2007 [04:19:35 UTC]
I am a little lost regarding this process because I cannot locate the script "retrieve_sip_conf_from_mysql.pl".
Where can I get this file from? Have I missed an expansion module or something?
Advice greatly appreciated!