Chad Sawyer
2004-Feb-27 14:39 UTC
[Asterisk-Users] retrieve_sip_conf_from_mysql.pl data format
In the contrib/scripts directory I have been trying to figure out the format of the entries in the MySQL table. I had seen several posts from a while back, but everyone seemed to understand what I am not getting. The info in the file itself (retrieve_sip_conf_from_mysql.pl) says to make a very simple table with four fields, id, keyword, data, flags. However, there is also a sip-friends.sql file in the folder that makes a table that makes more sense to me. Hate to be stupid, but where do the individual accounts data go? I assume data, but what format? I enter in info just to see what is getting written, but it keeps telling me "no sip users defined". Maybe this info could be added to the wiki. It would be very nice to control sip users from a DB. Chad -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20040227/dff757ee/attachment.htm
Fran Boon
2004-Feb-28 02:26 UTC
[Asterisk-Users] retrieve_sip_conf_from_mysql.pl data format
On Fri, 2004-02-27 at 21:39, Chad Sawyer wrote:> In the contrib/scripts directory I have been trying to figure out the > format of the entries in the MySQL table.-CUT- There are 3 different approaches to storing users in a database. The first is dynamic - the user details are read directly from the database. This is used for SIP & IAX friends & also for Voicemail: http://voip-info.org/tiki-index.php?page=Asterisk+sip+mysql+peers http://voip-info.org/tiki-index.php?page=Asterisk+voicemail+database However the number of options supported by this 'MySQL friends' system is currently very limited. The other possibility is to store all the details in the database & when changes are made, write out new versions of the conf files. This is the approach taken by res_config: http://voip-info.org/wiki-Asterisk+res_config & also by the contrib scripts, such as: retrieve_sip_conf_from_mysql.pl Obviously, the disadvantage of such systems is that Asterisk needs to be reloaded to see these changes, which can be disruptive to calls in progress, or may never get the chance to happen 'when convenient' on a busy system. Olle's chan_sip2 introduces a 3rd possibility: Using templates & autocreate peers for the majority of user options & storing just the passwords in the MYSQL database. For me, the ideal would be to hack the code to extend the functionality of MySQL friends...however I'm not a C programmer. I am currently starting work on the 2nd option since I want to expose as many options within a web-based GUI as possible. Any suggestions on how to minimise impact on the running system during reload are welcome :) Best Wishes, Fran.
Fran Boon
2004-Feb-28 08:58 UTC
[Asterisk-Users] retrieve_sip_conf_from_mysql.pl data format
On Fri, 2004-02-27 at 21:39, Chad Sawyer wrote:> In the contrib/scripts directory I have been trying to figure out the > format of the entries in the MySQL table.It isn't at all obvious is it? I've now worked out what it does & have written this up on the Wiki, along with my previous post about database integration in general: http://voip-info.org/tiki-index.php?page=Asterisk+sip+conf+from+mysql http://voip-info.org/wiki-Asterisk+configuration+from+database Now back to the task of getting a workable UI for my specific situation's needs ;) F