login | register
Sun 20 of Jul, 2008 [07:45 UTC]

voip-info.org

Discuss [3] History

Asterisk configuration from database

Created by: flavour,Last modification on Wed 03 of May, 2006 [05:10 UTC] by chrissnell

Configuration from database

Asterisk configurations can be stored in a database. This is useful since it allows easy creation of web-based UIs. There are different approaches to storing users in a database.

1. Asterisk RealTime (Asterisk v1.2)

Asterisk RealTime
The Asterisk external configuration engine is the result of work by Anthony Minessale II, Mark Spencer, and Constantine Filin. It is designed to provide a flexible, seamless integration between Asterisk's internal configuration structure and external SQL databases (maybe even LDAP one day).

External configuration is configured in /etc/asterisk/extconfig.conf allowing you to map any configuration file (static mappings) to be pulled from the database, or to map special runtime entries which permit the dynamic creation of objects, entities, peers, etc. without the necessity of a reload.

Generally speaking, the columns in your tables should line up with the fields you would specify in the given entity declaration. If an entry would appear more than once, in the column it should be separated by a semicolon.

A Tutorial on how to install and configure Asterisk Realtime can be found here:

2. Dynamic 'friends' (Asterisk v1.0.*)

The user details are read directly from the database. This is used for SIP & IAX friends:
Voicemail:
and also for MeetMe:

However the number of options supported by this 'MySQL_Friends' system is currently very limited: You can't specify nat= or host=dynamic nor accountcode= and the like. It appears that these restrictions made ast_data appear (see above and bug 1086).
Question: Does this entirely replace the peer entries in sip.conf, or does this add to manual entries in sip.conf?

3. Load configuration from database on startup (Asterisk v1.0.*)

Obviously, the disadvantage of such systems is that Asterisk needs to be reloaded to see these changes. This can be done from a shell script using

  asterisk -r -x reload

or by using the Manager interface.
An example of this approach is: Asterisk GUI phpMyEdit

3a: res_config

All the details are stored in the database. When changes are made, asterisk has to be reloaded to load the new configuration in memory. This is the approach taken by:

3b: contrib scripts

This can be used to write a file to be #included in sip.conf or extensions.conf, which means you can nicely mix database-based setup with .conf file setup:

4. Templates & MySQL_AUTH

This is available in Olle's chan_sip2:

Templates can be used to store the different user options and peers can be 'autocreated' when they register. Only the passwords are stored in the MySQL database.

Option 4 can also benefit from the use of Templates.

See also




Comments

Comments Filter
222

333help with mysql database on a different server

by klaffkas, Tuesday 14 of August, 2007 [21:45:06 UTC]
Hi! I'm not really sure where to post this question, but if anyone can be of help, I'd greatly greatly appreciate it! Has anyone tried to set up a MySQL server running on a different server? I'm trying to set everything up and all of the info I can find is focused on the db being ON the Asterisk server. This is all very new to me and very much outside of my comfort zone. So, if anyone can help me out, I'd greatly appreciate it. Right now I have MySQL up and running on a separate server and Asterisk running and tested with config files (not realtime). I installed the add-ons by simply copying all of the required .h files over to the asterisk server. But, due to a conditional, some of the .so files are not being built. Please give me some guidance. Thank you in advance!
222

333ASTERISK +CVS HEAD

by agarcia, Thursday 26 of May, 2005 [14:47:45 UTC]
Hi all.

I have installed the 1.0.5 asterisk release with xorcom, why we cannot have the realtime with the normal install of asterisk?

How can y install CVS-HEAD on my asterisk ?

Thanks for your response


222

333ast_data?

by axelm, Tuesday 27 of July, 2004 [16:25:19 UTC]
It seems to me that "ast_data" should be mentioned in the "dynamic" section - unfortunately i do not know enough about it's current status.