login | register
Sat 17 of May, 2008 [10:49 UTC]

voip-info.org

Search with Google
Search this site with Google. Results may not include recent changes.
 
Google Ads
Shoutbox
  • Juan Ortega, Thu 15 of May, 2008 [10:33 UTC]: Hi everybody, I'm Juan, an ITCom student, and I need to know what basic elements I need to create a VoIP network. Can anybody helpme, please?,Thank you very much
  • gineta, Wed 14 of May, 2008 [03:58 UTC]: any here not fine the configuration of firewall juniper -screem for VOIP asterisk????
  • Anoop Prabhakaran, Tue 13 of May, 2008 [12:16 UTC]: I am developing Asterisk IVR, Whenever i make a internation call to the IVR system, the DTMF is not getting detected properly, this happens only for the first time, second call onwards system works fine. why this is happening
  • joe, Mon 12 of May, 2008 [04:27 UTC]: Is there an opensource browser based softphone, or a system like Busta where everything is not manages through their website?
  • Nick Barnes, Fri 09 of May, 2008 [11:36 UTC]: Christopher - yesterday I tried an Asterisk install on a CentOS 5.1 box with stock GUI and it all worked fine. Sorry I can't help.
  • aero, Fri 09 of May, 2008 [08:20 UTC]: can someone help me out on this, i tried to play some sound files on my asterisk box and this is the error message i got. WARNING[4429]: format_wav.c:169 check_header: Unexpected freqency 22050 May 8 11:17:39 WARNING[4433]: codec_gsm.c:194 gsmtolin_fra
  • Christopher Faust, Thu 08 of May, 2008 [14:15 UTC]: I beleive that I may have to change something in the xserver configuration. Please advise
  • Christopher Faust, Thu 08 of May, 2008 [14:14 UTC]: Everything was perfect. In the bios I have increased the memory allocated Still receive input not supported on my display.
  • Christopher Faust, Thu 08 of May, 2008 [14:13 UTC]: This would not be my main box. I am doing some testing to see if I can install zaptel and asterisk 1.4 on a full centos 5.1 box with development software Its bizzare, because before I went through the asterisk and zaptel installation everything was perfe
  • Nick Barnes, Thu 08 of May, 2008 [13:44 UTC]: Christopher - I can't see any way in which an Asterisk installation would muck your GUI, but remember that it is advised not to use a GUI on an Asterisk box anyway.
Server Stats
  • Execution time: 0.45s
  • Memory usage: 2.26MB
  • Database queries: 33
  • GZIP: Disabled
  • Server load: 1.38

Asterisk RealTime

The Asterisk RealTime Architecture


ARA, the Asterisk Realtime Architecture is one of the major new features in Asterisk version 1.2.

Background Information

From docs/README.extconfig


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 other 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.

Olle explains the world

In the new RealTime architecture, all database specific code is moved to database specific drivers. The channel just calls a generic routine to do database lookup. Much cleaner, simpler and manageable from a coding standpoint.

The database is accessed with three functions:
  • STATIC: This is used to load static configuration when a module is loaded
  • REALTIME: This is used to lookup objects during a call (or another event)
  • UPDATE: This is used to update objects

The database support in the channel is not changed. There are "normal" static peers/users and database peers/users. The static ones, regardless if these are loaded from a text file or a database configuration, are kept in-memory and in the SIP channel we provide them with NAT traversal support and message waiting indication if needed.

The database peers/users are not kept in memory. These are only loaded when we have a call and then deleted, so there's no support for NAT keep-alives (qualify=) or voicemail indications for these peers.
NOTE: If you enable RealTime caching in your sip.conf, Voicemail MWI works and so does 'sip show peers' - see rtcachefriends=yes. The downside to this is that if you change anything in the database, you need to do a 'sip reload' (for major changes) or 'sip prune realtime PEERNAME' (for single peer changes) before they become active.


In laymans terms

In the Stable 1.0.X branch of Asterisk, database storage of configuration files and parameters was done mostly by hardcoding connection and query code directly into the application. The best example of this is in app_voicemail, where you can see MySQL code and PostgreSQL code all meshed with the app_voicemail code.

This method of database retrevial proves to be ugly as all the asterisk code is now crammed with database specific code that is irrelevant to the function of the application at hand. Thus RealTime was developed as a means to remove the code and replace it with a unified (abstracted) database retrevial method.

Terminology/Files


There are 2 methods of using RealTime: ODBC and MySQL. Yes, you can use ODBC to connect to MySQL and many other ODBC supported databases. (Being an avid MySQL user and advocate, I didn't want to bother with ODBC so I wrote the RealTime MySQL driver over the weekend.)


How to configure RealTime - ODBC Method

(This paragraph assumes you have ODBC already running and installed on your box.)
When you start to compile Asterisk, the Makefile inside res/ should detect if you have ODBC properly installed and if so compile the res_config_odbc.so module for you (as long as you have the unixODBC-dev libraries installed - http://sourceforge.net/project/showfiles.php?group_id=1544&package_id=122072).
Go into /etc/asterisk/res_odbc.conf and configure your ODBC connections. Some sample configs are supplied in asterisk/configs/res_odbc.conf.sample NOTE: res_config_odbc.conf is deprecated and will not be loaded.

Skip to 'Extconfig'

How to configure RealTime - MySQL Method

(This page assumes you have the MySQL client libraries/headers installed on your box.)
Check out asterisk-addons from CVS:

cd /usr/src/
svn co http://svn.digium.com/svn/asterisk-addons/trunk asterisk-addons


Go into asterisk-addons and 'make; make install'. (This will also compile and install the other stuff in addons so if you don't want/need it, just run 'make' and manually copy res_config_mysql.so to your modules directory.)
Copy asterisk-addons/configs/res_mysql.conf.sample to /etc/asterisk/res_mysql.conf
Edit this file to your liking. At this time, the MySQL drivers supports multiple databases on only one server.

Now edit /etc/asterisk/extconfig.conf


Extconfig - Static Configs

Static configuration is where you can store regular *.conf files into the database. These configurations are read at Asterisk startup/reload. Some modules may also re-read this info upon their own reload (Ex. sip reload).
Here is the format for a static config:

[settings]

<conf filename> => <driver>,<databasename>[,table_name]
queues.conf => odbc,asterisk,ast_config
sip.conf => mysql,asterisk
iax.conf => ldap,MyBaseDN,iax


Above we have 3 examples. The first example will bind 'queues.conf' to the table 'ast_config' located in the database context 'asterisk' using the ODBC driver. — NOTE (LN): this is NOT the database you specified in /etc/odbc.ini, rather it's the context in /etc/asterisk/res_odbc.conf that you are using to connect to the ODBC driver!
The second example will bind 'sip.conf' to the table 'sip.conf' (because we ommited the table name, it defaults to the file name) in the database 'asterisk' using the MySQL driver.
The 3rd one will bind iax.conf to the 'table' iax.conf in the ldap database using LDAP driver; MyBaseDN is the base DN for the query.
Using the above examples, now, when app_queue.so loads, the RealTime ODBC driver will execute a query and get the information it needs. The same is true for chan_sip.so, but with MySQL and chan_iax.so with LDAP.


Extconfig - RealTime

RealTime configuration is where configuration values are read/updated in real time.

Example: Lets say you have 2 SIP users defined in your sip.conf and you want to add a 3rd. You add them to the file then execute the command 'sip reload'. This re-reads your sip.conf and allows the 3rd to register.
With RealTime, all you do is add 1 new record to the table that sipusers has been bound to. No reloading necessary.

RealTime maps take the following fomat:

[settings]

<family name> => <driver>,<database name>[,table_name]
sippeers => mysql,asterisk,sip_peers
sipusers => mysql,asterisk,sip_users
queues => mysql,asterisk,queue_table
queue_members => mysql,asterisk,queue_member_table
meetme => mysql,asterisk,meetme_table
voicemail => mysql,asterisk


Above we have four examples. The first example will bind the family name "sippeers" to the table "sip_peers" in the database "asterisk" using the MySQL driver. The last example will bind the family name "voicemail" to the table "voicemail" (because we ommited the table name, it defaults to the family name) in the database "test" using the MySQL driver.

It is worth noting that sipusers and sippeers may both refer to the same table, if you wish.

NOTE: extconfig.conf is parsed each time you connect to the asterisk CLI.


Now that you have created all the necessary binds, it is time to create the tables. Since the tables are different to each family, I've broken the Wiki pages down to eliminate 1 huge RealTime page. Scroll down to the bottom to find the individual family pages.



:: NOTE: If you are setting up only IAX users (no peers), both iaxusers and iaxpeers entries in the above file need to be either included (uncommented) for iax users/peers to be loaded from the database.


Conclusions

RealTime is great. With a nice web interface you can allow customers limited ability to edit their own dialplan without needing a reload.

RealTime support is currently available for the following families:
  • sippeers
  • sipusers
  • iaxpeers
  • iaxusers
  • voicemail
  • queues and queue_members (used together for the Queue application).
  • extensions NOTE: The family name for RealTime extensions can be whatever you want. Please read Asterisk RealTime Extensions for more info.

More information will be posted as more apps become RealTime enabled.




See Also


Go back to Asterisk
Created by utdrmac, Last modification by Gavin Henry on Tue 29 of Apr, 2008 [09:57 UTC]

Comments Filter

The question of "missing" mysql engine

by Chen-Yu Yen on Wednesday 16 of April, 2008 [06:55:51 UTC]
Hello,
I have the same problem too.
I step by step
./configure --with-mysqlclient=/usr
make menuselect
             unselected the already installed addons 
make
make install

When I enter ./configure --with-mysqlclient=/usr it have some question about haven't mysql_config.
I don't know how to solve this question.
Can anybody peslaehelp me with that??


trixbox static realtime problem

by Ahmed M on Tuesday 19 of February, 2008 [12:48:30 UTC]
Hello,
I am a bit new to linux and i don't fully understand some of the explanations in the tutorial.
I installed Trixbox 2.4.0 and i went step by step through the tutorial and the comments but i still didnt get the "static realtime" to work.
The problem is that i dont find a res_mysql.so although there is a res_mysql.conf ,, there is an res_odbc.so but no res_odbc.conf ...
can anybody please help me with that??

by Ahmed M on Tuesday 19 of February, 2008 [12:47:51 UTC]
Hello,
I am a bit new to linux and i don't fully understand some of the explanations in the tutorial.
I installed Trixbox 2.4.0 and i went step by step through the tutorial and the comments but i still didnt get the "static realtime" to work.
The problem is that i dont find a res_mysql.so although there is a res_mysql.conf ,, there is an res_odbc.so but no res_odbc.conf ...
can anybody please help me with that??

realtime problem with trixbox

by Ahmed M on Tuesday 19 of February, 2008 [12:47:26 UTC]
Hello,
I I'm a bit new to linux and i don't fully understand some of the explanations in the tutorial.
I installed Trixbox 2.4.0 and i went step by step through the tutorial and the comments but i still didnt get the "static realtime" to work.
The problem is that i dont find a res_mysql.so although there is a res_mysql.conf ,, there is an res_odbc.so but no res_odbc.conf ...
can anybody please help me with that??

Re: Solution for "missing" mysql engine

by Stoyan Mihaylov on Friday 01 of February, 2008 [21:43:25 UTC]
I had simmilar problem but with iaxpeers.
My modules.conf now is:
modules
autoload=yes
preload => res_config_mysql.so
preload => app_addon_sql_mysql.so
........
This solved problem with IAX peers.

by Paul M on Wednesday 16 of January, 2008 [15:16:53 UTC]
Erm, K Anderson... what exactly are you recompiling with addons there? I'm now 3 days into trying to make Asterisk and OpenSER talk to each other and I'm actually overloaded. If anybody has a copy of "How to install Asterisk 1.4 with OpenSER 1.3" let me know ;o)

Re: Solution for

by Andrew on Sunday 12 of August, 2007 [05:21:15 UTC]
Thanks K Anderson!!

You have probably saved me at least a weeks worth of frustration also! :)

Solution for "missing" mysql engine.

by K Anderson on Saturday 30 of June, 2007 [22:34:25 UTC]
I have been trying to get realtime working on FC6 asterisk 1.2 and 1.4 after installing MySQL with YUM but I get the error message bellow:

WARNING5918: config.c:1059 find_engine: Realtime mapping for 'sippeers' found to engine 'mysql', but the engine is not available

My resolution was to compile the addons using
./configure --with-mysqlclient=/usr
make menuselect
              unselected the already installed addons
make
make install

AND IT WORKS FINALY!!!

This one was a weeks worth of fustration....

by Enrique Leon on Tuesday 17 of October, 2006 [20:21:48 UTC]
I followed every step to configure RealTime but something is not working properly; the warning I am geting is:

WARNING5918: config.c:1059 find_engine: Realtime mapping for 'sippeers' found to engine 'mysql', but the engine is not available
Oct 17 14:19:12

NOTICE5918: chan_sip.c:13889 handle_request_register: Registration from '<sip:30106@voixtel-presario.homelinux.net;user=phone>' failed for '190.37.241.158' - No matching peer found

Mysql is working properly, I test it using the parameters included in res_mysql.conf.

Is there a way of checking the asterisk conection to the database manually?
How can I check that the driver was installed properly from the addonss?
Any idea, suggestion?

Regars, Enrique Leon

by Enrique Leon on Tuesday 17 of October, 2006 [18:36:09 UTC]
I followed every step to configure RealTime but something is not working properly; the warning I am geting is:

WARNING5918: config.c:1059 find_engine: Realtime mapping for 'sippeers' found to engine 'mysql', but the engine is not available
Oct 17 14:19:12

NOTICE5918: chan_sip.c:13889 handle_request_register: Registration from '<sip:30106@voixtel-presario.homelinux.net;user=phone>' failed for '190.37.241.158' - No matching peer found

Mysql is working properly, I test it using the parameters included in res_mysql.conf.

Is there a way of checking the asterisk conection to the database manually?
How can I check that the driver was installed properly from the addonss?
Any idea, suggestion?

Regars, Enrique Leon

Please update this page with new information, just login and click on the "Edit" or "Add Comment" button above. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

Sponsored by:

Terms of Service Privacy Policy
© 2003-2008 VOIP-Info.org LLC

Powered by bitweaver