Problem With Realtime Mysql I Can’t Seem To Resolve

Home » Asterisk Users » Problem With Realtime Mysql I Can’t Seem To Resolve
Asterisk Users 1 Comment

Hello

I have already several Asterisk servers running with similar configuration, but now I stumble into a problem.

I have mysql configuration res_config_mysql.conf :

[MyAsteriskDB]
dbhost = 127.0.0.1
dbname = MyAsteriskDB
dbuser = astadmin dbpass = mysecret dbport = 3306
dbsock = /var/lib/mysql/mysql.sock requirements=warn ; or createclose or createchar

Realtime seems to be loaded :

*CLI> realtime mysql status general configured for asterisk on socket file /var/lib/mysql/mysql.sock with username asterisk. MyAsteriskDB connected to MyAsteriskDB@127.0.0.1, port 3306 with username astadmin for 12 minutes.
[May 22 10:32:02] ERROR[11269]: res_config_mysql.c:1599 mysql_reconnect:
MySQL RealTime: Failed to connect database server asterisk on
/var/lib/mysql/mysql.sock (err 1045). Check debug for more info.
*CLI>

However, SIP-registration for SIP peer can not be found :

[May 22 10:32:50] NOTICE[11077]: chan_sip.c:24957
handle_request_register: Registration from
‘ failed for ‘11.22.33.44:5060’ – No matching peer found

Debug logs say :

[May 22 10:48:06] DEBUG[11077] res_config_mysql.c: MySQL RealTime:
Connection okay.
[May 22 10:48:06] DEBUG[11077] res_config_mysql.c: MySQL RealTime:
Retrieve SQL: SELECT * FROM sip_buddies WHERE name = ‘testacc66’ AND
host = ‘dynamic’
[May 22 10:48:06] DEBUG[11077] res_config_mysql.c: MySQL RealTime:
Connection okay.
[May 22 10:48:06] DEBUG[11077] res_config_mysql.c: MySQL RealTime:
Retrieve SQL: SELECT * FROM sip_buddies WHERE name = ‘testacc66’

But sip peer testacc66 really exists in my database in table sip_buddies. It can not be found ?!

What else is there for me to investigate ? Can u help me ?

Thanks !

Jonas.

One thought on - Problem With Realtime Mysql I Can’t Seem To Resolve

  • Does MySQL work ok from the console with those parameters?

    I.E. mysql -u astadmin -p (then type mysecret)

    The debug logs and the normal logs don’t match in time – do you have some that do?