Asterisk sip conf from mysql

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


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


Created by: flavour, Last modification: Mon 21 of Jan, 2008 (14:03 UTC) by batchman
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+