Sip conf mysql


#1

Hi all,

How i can retrive user information from mysql database instead of sip.conf and i don’t want to make very big file for this sip. so always when the client want to register Asterisk the AGI perl script will look in DB if all information is correct it give permission to register on Asterisk.


#2

An AGI is not called during a register but upon a ‘call’ event. The way to retrieve information on configuration from a database is:

voip-info.org/wiki-Asterisk+ … m+database

There are several options.


#3

HI MuppetMaster,

Thank you for your reply, i got this file retrieve_sip_conf_from_mysql.pl in asterisk contrlib folder and i read the manual. but i am still confiused which file i should include in sip.conf.

Can i include retrieve_sip_conf_from_mysql.pl it self at the end of of sip.conf file like:
#included retrieve_sip_conf_from_mysql.p
or i have to include someothers file. becuase the following instruction is not clear for me which i got from voip-info.org web

here is a script in contrib/scripts called:
retrieve_sip_conf_from_mysql.pl

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

Please help for my confiusion.


#4

[quote=“abdulzu”]Can i include retrieve_sip_conf_from_mysql.pl it self at the end of of sip.conf file like:
#included retrieve_sip_conf_from_mysql.p
[/quote]
No. You can’t include a perl script in a config file.

Also, the keyword is #include - not “#included”.

[quote]
here is a script in contrib/scripts called:
retrieve_sip_conf_from_mysql.pl

This can be used to write a file to be #included in sip.conf
(by default it’s called sip_additional.conf)[/quote]

Ok. What that means is you put the following entry in sip.conf :

#include sip_additional.conf

Then you run retrieve_sip_conf_from_mysql.pl which will create the file /etc/sip_additional.conf .

Any time you do this, you must do a sip reload in Asterisk - then it will re-read sip.conf and sip_additional.conf .


#5

HI,

Using this include method we have to always load the sip configuration. How i can load this sip configuration while some agents are already connected to the server using perl script?

Is there any new application in new release to retrive realtime information from DB. because if we have lot of agents it can make some problem for asterisk.


#6

Can anyone send me a link to a tutorial on setting up asterisk with mySQL ? Thanks.


#7

voip-info.org/wiki-Asterisk+RealTime