Ticket #1735 (closed Patches: worksforme)

Opened 5 years ago

Last modified 5 years ago

Illegal chars in CID in trunks

Reported by: Boot Assigned to:
Priority: blocker Milestone: 2.3
Component: Core - Trunks/Routing Version: 2.2
Keywords: Cc:
Confirmation: SVN Revision (if applicable): 3851
Backend Engine: All Backend Engine Version:

Description

When entering a CID in inbound route with " arround it like "Unknovn" or "12345678" it is impossible to delete or edit it afterwards and the following message will show:

SELECT * FROM incoming WHERE cidnum = ""Unknown"" AND extension = "xxxxxxxx" AND channel = "" [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Unknown"" AND extension = "xxxxxxxx" AND channel = ""' at line 1]

A solution could be to check contents of any string for illegal chars before passing it to the database.

Attachments

freepbx-trunk.bug1735.rev3851+.patch (1.0 kB) - added by nicotine on 03/09/07 09:18:15.
New patch with better understanding of q()

Change History

03/07/07 08:56:39 changed by nicotine

  • type changed from Bugs to Patches.
  • svn_rev set to 3851.

(in reply to: ↑ description ) 03/07/07 08:59:10 changed by nicotine

Added patch to resolve this issue. Patch needs testing - should work on SVN checkout of trunk 2.2 or HEAD.

03/09/07 06:42:24 changed by Boot

-hmmm I applyed the patch to /usr/src/freepbx/amp_conf/htdocs/admin/modules/core/functions.inc.php with no luck. I can add a trunk with "'s in CID but I get same error as before I patched when I try to delete it.

03/09/07 06:46:08 changed by nicotine

Thanks for the report. I'll get a VMWare installation setup here shortly so I can further debug exactly what is happening.

03/09/07 09:18:15 changed by nicotine

  • attachment freepbx-trunk.bug1735.rev3851+.patch added.

New patch with better understanding of q()

(follow-up: ↓ 6 ) 03/09/07 09:19:26 changed by nicotine

Boot: Please try with the new patch - I tested on a SVN checkout of the 1.2 trunk, and it is now working correctly.

(in reply to: ↑ 5 ; follow-up: ↓ 7 ) 03/09/07 20:43:54 changed by Boot

Replying to nicotine:

Boot: Please try with the new patch - I tested on a SVN checkout of the 1.2 trunk, and it is now working correctly.

-still no luck, would you happen to know how I delete it manualy somehow ?

(in reply to: ↑ 6 ) 03/09/07 21:43:54 changed by Boot

-still no luck, would you happen to know how I delete it manualy somehow ?

[root@asterisk1 ~]# mysql -u root -p asteriskcdrdb

Enter password: passw0rd

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 32 to server version: 4.1.20

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use asterisk;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

mysql> DELETE FROM incoming WHERE destination = "app-blackhole,hangup,1";

Luckily destination was unique for the entry with " around .....

-i will always ask Google b4 asking stupid questions ;-)

07/30/07 04:45:45 changed by wvroger

  • status changed from new to closed.
  • resolution set to worksforme.