asterisk18 – realtime/mysql – take 3

Home » Asterisk Users » asterisk18 – realtime/mysql – take 3
Asterisk Users 1 Comment

Still a couple of questions……

I did configure extconfig.conf

;iaxusers => odbc,asterisk
;iaxpeers => odbc,asterisk
;sipusers => odbc,asterisk
sipusers => mysql,asterisk,sip_devices
sippeers => mysql,asterisk,sip_devices
;sippeers => odbc,asterisk
;sipregs => odbc,asterisk
;voicemail => odbc,asterisk
;extensions => odbc,asterisk
;meetme => mysql,general
;queues => odbc,asterisk
;queue_members => odbc,asterisk
;musiconhold => mysql,general
;queue_log => mysql,general
So only defining sipusers & sippeers for mysql

And noticed two files for configuring mysql-stuff:
file: res_config_mysql.conf
database access config: host, user, pwd

file: res_odbc.conf
in section [mysql2]: mysql database config: host, user, pwd

So, i configured them both…

Quick check:kc3054*CLI> sip show users
Username Secret Accountcode Def.Context ACL ForcerPort
j.witvliet geheim default No Yes
00000277611 25b06d3a0b5ef73 default No Yes

kc3054*CLI> sip show peers
Name/username Host Dyn Forcerport ACL Port Status Realtime
00000277611 (Unspecified) D N 0 Unmonitored
j.witvliet (Unspecified) D N 0 Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2
offline] kc3054*CLI>

Here i see at for both users and peers ONLY the statis entries from
sip.conf file, nothing from mysql…

kc3054*CLI> realtime mysql status
general connected to asterisk@, port 3306 with username
voipadmin for 5 seconds.
=>No warnings/errors but nothing else either…

kc3054*CLI> realtime mysql cache
=>No warnings/errors but nothing else either…

the module is loaded,

Try todo something else:
kc3054*CLI> realtime update sipusers set SET port = 4343 WHERE name =
00000277611 Failed to update. Check the debug log for possible SQL
related entries.
Command ‘realtime update sipusers set SET port = 4343 WHERE name =
00000277611′ failed.
[May 18 18:47:16] WARNING[16718]: res_config_mysql.c:559 update_mysql:
MySQL RealTime: Invalid database specified: ‘asterisk’ (check
res_mysql.conf) kc3054*CLI>

==> here the system talkes about _another_ config file! < ==
So which file should i configure:
A) res_config_mysql.conf
B) res_odbc.conf
C) res_mysql.conf
But even when i put my credentials in all three of them, still no show!

DB check:
mysql -h localhost -u voipadmin -p
Enter password:
Server version: 5.0.67 SUSE MySQL RPM
mysql> use asterisk; select name,username,secret,host,nat from
Database changed
| name | username | secret | host | nat |
| 00000031756 | 00000031756 | geheim | dynamic | Yes |
1 row in set (0.00 sec)

According to *,TDG, page 349:
Also filled the file /etc/unixODBC/odbcinst.ini, and the command
odbcinst -q -d produced the required result: “[MySQL]”
I presume i made a silly mistake/omission, but i fail to see how i can
detect that, or other steps to test the correct configuration of ARA.
So it looks that i’m stuck.

Can not imagine that i’m the first here!
But even from “the definitive guide”, chapter 16 and onwards, it isn’t
clear if you should use the mysql-stuff directly of through the

One thought on - asterisk18 – realtime/mysql – take 3

  • change the sipusers & sippeers line to the following:
    sipusers => mysql,general,sip_devices
    sippeers => mysql,general,sip_devices

    notice it’s the context name in stead of the database
    name in the 2nd parameter.

    since you’re using mysql connection type, you can get rid of
    the res_odbc.conf file.

    they’ll show up only if the phone successfully


    i believe 1.8.x uses res_config_mysql.conf for mysql realtime.
    you can get rid of res_mysql.conf & res_odbc.conf