[asterisk-users] Realtime - mysql query gives wrong results??
Tomasz Zieleniewski
tzieleniewski at gmail.com
Tue Nov 20 03:42:37 CST 2007
Hi,
I am using Realtime for sip configuration.
When there is an INVITE which arrives at asterisk
asterisk makes the following selects:
Nov 20 10:37:10] DEBUG[31852]: res_config_mysql.c:651 mysql_reconnect:
MySQL RealTime: Everything is fine.
[Nov 20 10:37:10] DEBUG[31852]: res_config_mysql.c:138 realtime_mysql:
MySQL RealTime: Retrieve SQL: SELECT * FROM sip_conf WHERE name =
'tzl'
[Nov 20 10:37:10] DEBUG[31852]: res_config_mysql.c:651
mysql_reconnect: MySQL RealTime: Everything is fine.
[Nov 20 10:37:10] DEBUG[31852]: res_config_mysql.c:138 realtime_mysql:
MySQL RealTime: Retrieve SQL: SELECT * FROM sip_conf WHERE host =
'192.168.0.74' AND port = '5060'
[Nov 20 10:37:10] DEBUG[31852]: res_config_mysql.c:651
mysql_reconnect: MySQL RealTime: Everything is fine.
[Nov 20 10:37:10] DEBUG[31852]: res_config_mysql.c:138 realtime_mysql:
MySQL RealTime: Retrieve SQL: SELECT * FROM sip_conf WHERE ipaddr =
'192.168.0.74' AND port = '5060'
[Nov 20 10:37:10] DEBUG[31852]: res_config_mysql.c:651
mysql_reconnect: MySQL RealTime: Everything is fine.
[Nov 20 10:37:10] DEBUG[31852]: res_config_mysql.c:258
realtime_multi_mysql: MySQL RealTime: Retrieve SQL: SELECT * FROM
sip_conf WHERE host = '192.168.0.74' ORDER BY host
[Nov 20 10:37:10] DEBUG[31852]: res_config_mysql.c:651
mysql_reconnect: MySQL RealTime: Everything is fine.
[Nov 20 10:37:10] DEBUG[31852]: res_config_mysql.c:258
realtime_multi_mysql: MySQL RealTime: Retrieve SQL: SELECT * FROM
sip_conf WHERE ipaddr = '192.168.0.74' ORDER BY ipaddr
Found no matching peer or user for '192.168.0.74:5060'
as seen above there is no result for this select although I have such
record in the database:
mysql> SELECT * FROM sip_conf WHERE host = '192.168.0.74' ORDER BY host;
+----+-----------------------+-------------+----------+-----------+------------+-------------+---------+-----------+----------+----------+------------+-------------+--------------+----------+----------+---------+-----------+-----+------+--------+------+-------------+------+---------+-------------+------------+----------------+--------+------+----------+----------+-------------------------+-------------+------------+--------+----------+----------------+--------+
| id | name | accountcode | amaflags | callgroup |
callerid | canreinvite | context | defaultip | dtmfmode | fromuser |
fromdomain | fullcontact | host | insecure | language |
mailbox | md5secret | nat | deny | permit | mask | pickupgroup | port
| qualify | restrictcid | rtptimeout | rtpholdtimeout | secret | type
| username | disallow | allow | musiconhold |
regseconds | ipaddr | regexten | cancallforward | setvar |
+----+-----------------------+-------------+----------+-----------+------------+-------------+---------+-----------+----------+----------+------------+-------------+--------------+----------+----------+---------+-----------+-----+------+--------+------+-------------+------+---------+-------------+------------+----------------+--------+------+----------+----------+-------------------------+-------------+------------+--------+----------+----------------+--------+
| 3 | outbound-voip.touk.pl | NULL | NULL | NULL |
TouK S.K.A | no | NULL | NULL | NULL | NULL |
NULL | NULL | 192.168.0.74 | NULL | NULL | NULL
| NULL | no | NULL | NULL | NULL | NULL | | NULL
| NULL | NULL | NULL | NULL | peer |
| all | g729;ilbc;gsm;ulaw;alaw | NULL | 0 |
| | yes | |
+----+-----------------------+-------------+----------+-----------+------------+-------------+---------+-----------+----------+----------+------------+-------------+--------------+----------+----------+---------+-----------+-----+------+--------+------+-------------+------+---------+-------------+------------+----------------+--------+------+----------+----------+-------------------------+-------------+------------+--------+----------+----------------+--------+
Why does realtime select give no results??
Cheers
tomasz
More information about the asterisk-users
mailing list