Tomasz Zieleniewski
2007-Nov-20 09:42 UTC
[asterisk-users] Realtime - mysql query gives wrong results??
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
Tony Plack
2007-Nov-20 14:29 UTC
[asterisk-users] Realtime - mysql query gives wrong results??
Two things: 1. Set the context 2. Set the port> 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 > > _______________________________________________ > --Bandwidth and Colocation Provided by http://www.api-digital.com-- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users