Asterisk Realtime

I am having trouble getting Asterisk Realtime to work with mysql

I have setup all of the config files so that Asterisk tries to look for the info from mysql.

In the terminal asterisk is giving the error:

*CLI> [Jan 25 23:45:36] WARNING[22635]: config.c:1333 find_engine: Realtime mapping for ‘sippeers’ found to engine ‘mysql’, but the engine is not available
[Jan 25 23:45:36] WARNING[22635]: config.c:1333 find_engine: Realtime mapping for ‘sippeers’ found to engine ‘mysql’, but the engine is not available
[Jan 25 23:45:36] NOTICE[22635]: chan_sip.c:15699 handle_request_register: Registration from ‘sip:105@192.168.40.130;transport=UDP’ failed for ‘192.168.40.1’ - No matching peer found

I have installed Asterisk addons, and the latest 1.4.x.x build of asterisk

Any Ideas? I have google around and everyone just seems to say reinstall addons, which I have tried.

Is ur mysql server running? if so pls check that ur database table name match with ur extconfig.conf

Yes MySQL is running, and the tables match the extconfig

extconfig:
[settings]
sipusers => mysql,asterisk,sip_buddies
sippeers => mysql,asterisk,sip_buddies
extensions => mysql,asterisk,extensions
voicemail => mysql,asterisk,voicemessages
queues => mysql,asterisk,queues
queues_members => mysql,asterisk,queue_members

res_mysql:
[general]
dbhost = localhost
dbname = asterisk
dbuser = asterisk
dbpass =
dbport = 3306
dbsock = /var/lib/mysql/mysql.sock

When you do “module show like sql” from the asterisk CLI, do you see something like the following?

Module                             Description                              Use Count
cdr_addon_mysql.so          MySQL CDR Backend                        0
res_config_mysql.so          MySQL RealTime Configuration Driver 0
app_addon_sql_mysql.so   Simple Mysql Interface                       0
3 modules loaded

I get a response of 0 modules loaded

So how do I fix that?

Ah, okay. I think what happened here is you don’t have your asterisk add-ons all compiled properly.

I dealt with this about a year back in a 1.4.18 install. When I recompiled I noticed an error and was able to fix it from that. But, much to my shame at the moment, I can’t remember what the error was!!!

Anyhow, that’s the issue, the module is not loaded.
If you do the following, and have the modules, you should see the following:

[root@sx ~]# cd /usr/lib/asterisk/modules
[root@sx modules]# ls *sql*
app_addon_sql_mysql.so  cdr_addon_mysql.so  res_config_mysql.so

And in this, “ain’t never gonna happen” scenario, you should just be able to load them with the ‘module load XXXX’ command in the asterisk CLI.

If those files don’t appear. PANIC!!! Make a bath, put a toaster on the ledge… wait no… no. It’s not that bad. It just means you need to compile your asterisk addons. However, before you do… Go into:

/usr/src/asterisk-addons-1.4.7/config.log

(substitute in your own asterisk version and path if need be.)and search for ‘sql’ you should get a few errors that might point you in the right direction. Hope this all helps.

here is the config.log in relation to mysql does it mean anything to you?

configure:6245: checking for mysql_config
configure:6263: found /usr/bin/mysql_config
configure:6275: result: /usr/bin/mysql_config
configure:6307: checking for mysql_init in -lmysqlclient
configure:6342: gcc -o conftest -g -O2 conftest.c -lmysqlclient -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib -lssl -lcrypto >&5
/usr/bin/ld: cannot find -lmysqlclient

So I am guessing that when you run the command

You don’t get

/usr/lib/mysql/libmysqlclient_r.a /usr/lib/mysql/libmysqlclient.so /usr/lib/mysql/libmysqlclient.so.15 /usr/lib/mysql/libmysqlclient.a /usr/lib/mysql/libmysqlclient.so.15.0.0 /usr/lib/mysql/libmysqlclient_r.so.15.0.0 /usr/lib/mysql/libmysqlclient_r.so /usr/lib/mysql/libmysqlclient_r.so.15

If you don’t, it’s a MySQL issue! You need the mysql shared libs, and the easiest way of installing that, of course, is OS specific. But, you should be able to find plenty of help!

I’m pretty sure that with RedHat/CentOS you just drop

Mine comes back with this

Installed Packages mysql.i386 5.0.45-7.el5 installed mysql-devel.i386 5.0.45-7.el5 installed mysql-server.i386 5.0.45-7.el5 installed

Then you can just go get the one you need…

on your command prompt and watch it fly and then recompile the add-ons.

I have everything working now thanks!

Do you know if there is any way to side step having to define the contexts in the extensions.conf file?

So, what did it end up being?

And there’s lots of ways to do lots of things :smile:… if you have something specific, you might be best try out a few things and then make another post if you need help of something specific! :smile:

It ended up being that mysql did not have the deve pack, installed it, recompiled addons and all started working…

now the question i asked before is currently what I have found is that for each context which I want to use realtime for i have to make the following listing in the extensions.conf file

[ContextName]

switch => Realtime/@extensions

and then reload the dial plan into asterisk CLI

I was wondering if there is a way in which the realtime can just pick up on new extensions as they are placed within the DB and not have to update the extensions.conf

Hi

How can I find the version of an asterisk whicg is running on a redhut linux server?
So that I can install the correct add-ons.

Thanks in advance.

I also

[quote=“Mark_Logan”]Ah, okay. I think what happened here is you don’t have your asterisk add-ons all compiled properly.

I dealt with this about a year back in a 1.4.18 install. When I recompiled I noticed an error and was able to fix it from that. But, much to my shame at the moment, I can’t remember what the error was!!!

Anyhow, that’s the issue, the module is not loaded.
If you do the following, and have the modules, you should see the following:

[root@sx ~]# cd /usr/lib/asterisk/modules
[root@sx modules]# ls *sql*
app_addon_sql_mysql.so  cdr_addon_mysql.so  res_config_mysql.so

And in this, “ain’t never gonna happen” scenario, you should just be able to load them with the ‘module load XXXX’ command in the asterisk CLI.

If those files don’t appear. PANIC!!! Make a bath, put a toaster on the ledge… wait no… no. It’s not that bad. It just means you need to compile your asterisk addons. However, before you do… Go into:

/usr/src/asterisk-addons-1.4.7/config.log

(substitute in your own asterisk version and path if need be.)and search for ‘sql’ you should get a few errors that might point you in the right direction. Hope this all helps.[/quote]