[Home]

Summary:ASTERISK-23677: [res_odbc] Syntax error in peer registration
Reporter:Jan Svoboda (jan.svoboda)Labels:
Date Opened:2014-04-27 14:01:55Date Closed:2014-04-28 13:25:45
Priority:MajorRegression?Yes
Status:Closed/CompleteComponents:Resources/res_odbc
Versions:12.2.0 Frequency of
Occurrence
Constant
Related
Issues:
is caused byASTERISK-23459 [patch]Incorrect check for key field and NULL column values in update_odbc
duplicatesASTERISK-23675 [patch] Segmentation Fault on first SIP registration using res_config_odbc
Environment:Linux CentOS 6.5 unixODBC 2.2.14-12.el6_3Attachments:
Description:When a peer using SIP realtime registers, the following error is shown:
{noformat}
   -- Registered SIP 'device-name' at 12.34.56.78:57765
[Apr 27 20:42:49] NOTICE[21939]: chan_sip.c:24130 handle_response_peerpoke: Peer 'device-name' is now Reachable. (16ms / 2000ms)
[Apr 27 20:42:49] WARNING[21939]: res_odbc.c:655 ast_odbc_prepare_and_execute: SQL Execute returned an error -1: HY000: [unixODBC][SQLite]near "WHERE": syntax error (1) (48)
{noformat}

The SQL query that is being executed:
{noformat}
UPDATE sip_devices SET  WHERE name=E'81'
{noformat}

Also, when reading through the SQL log, noticed the following query:
{noformat}
UPDATE sip_devices SET fullcontact=E'12.34.56.78', useragent=E'sip:device-name@192.168.1.22:53187^3Bob', regseconds=E'-1' WHERE name=E'Telephone 1.1.4'
{noformat}

The value of the 'name' column in the SQL clause is actually the useragent string, not device name and the useragent being set is not an useragent string.
Comments:By: Michael L. Young (elguero) 2014-04-28 13:17:30.192-0500

Please try the patch on ASTERISK-23675 and report there.