[asterisk-bugs] [Asterisk 0017006]: [patch] func_odbc query is limited to 15 characters
Asterisk Bug Tracker
noreply at bugs.digium.com
Thu Mar 11 11:39:04 CST 2010
The following issue has been UPDATED.
======================================================================
https://issues.asterisk.org/view.php?id=17006
======================================================================
Reported By: viniciusfontes
Assigned To:
======================================================================
Project: Asterisk
Issue ID: 17006
Category: Functions/func_odbc
Reproducibility: always
Severity: minor
Priority: normal
Status: new
Asterisk Version: 1.6.1.17
JIRA: SWP-1065
Regression: No
Reviewboard Link:
SVN Branch (only for SVN checkouts, not tarball releases): N/A
SVN Revision (number only!):
Request Review:
======================================================================
Date Submitted: 2010-03-11 08:58 CST
Last Modified: 2010-03-11 11:39 CST
======================================================================
Summary: [patch] func_odbc query is limited to 15 characters
Description:
You can't have a query string longer than 15 characters passed to
ODBC_[NAME] functions. The query string is trimmed to the first 15
characters.
There's a patch to solve this included.
======================================================================
----------------------------------------------------------------------
(0119269) viniciusfontes (reporter) - 2010-03-11 11:39
https://issues.asterisk.org/view.php?id=17006#c119269
----------------------------------------------------------------------
That's anything but right. I made the patch because the feature wasn't
working as intended.
Here's my setup and the CLI output:
extensions.conf:
[teste]
exten => 2,1,Set(TEMP=${ODBC_PGSQL("SELECT id,billed,uniqueid,userfield
FROM cdr WHERE id = 2")})
exten => 2,n,NoOp(TEMP = ${TEMP})
exten => 2,n,Hangup()
func_odbc.conf:
[PGSQL]
dsn=asterisk
readsql=${ARG1}
ch-corretora*CLI> console dial 2 at teste
[Mar 11 14:34:21] WARNING[4466]: chan_oss.c:492 setformat: Unable to
re-open DSP device /dev/dsp: No such file or directory
[Mar 11 14:34:21] NOTICE[4466]: console_video.c:133 console_video_start:
voice only, console video support not present
[Mar 11 14:34:21] ERROR[4468]: func_odbc.c:343 acf_odbc_read: Unable to
execute query [SELECT id,bille]
-- Executing [2 at teste:1] Set("Console/dsp", "TEMP=") in new stack
-- Executing [2 at teste:2] NoOp("Console/dsp", "TEMP = ") in new stack
-- Executing [2 at teste:3] Hangup("Console/dsp", "") in new stack
== Spawn extension (teste, 2, 3) exited non-zero on 'Console/dsp'
<< Hangup on console >>
As you can see, the value passed to the ODBC engine is precisely 15
characters. If the "real" bug is somewhere else I really don't know. What I
know is I found a bug I didn't created but fixed it anyway.
Issue History
Date Modified Username Field Change
======================================================================
2010-03-11 11:39 viniciusfontes Note Added: 0119269
2010-03-11 11:39 viniciusfontes Status closed => new
2010-03-11 11:39 viniciusfontes Resolution no change required =>
reopened
======================================================================
More information about the asterisk-bugs
mailing list