[asterisk-bugs] [Asterisk 0015317]: func_odbc is broken in 1.4.25

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Jun 29 14:36:58 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15317 
====================================================================== 
Reported By:                alexh
Assigned To:                tilghman
====================================================================== 
Project:                    Asterisk
Issue ID:                   15317
Category:                   Functions/func_odbc
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Target Version:             1.4.27
Asterisk Version:           1.4.25 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-06-12 06:15 CDT
Last Modified:              2009-06-29 14:36 CDT
====================================================================== 
Summary:                    func_odbc is broken in 1.4.25
Description: 
I upgraded from 1.4.23 to 1.4.25 and now func_odbc is broken. The first
query returns a result, but with a superfluous backslash at the end. The
second query returns nothing.

The following dialplan an log snippets demonstrate the problem:

[to-customer]
; Retrieve accountname
exten = _X.,1,Set(account=${CRM_GET_ACCOUNT(${EXTEN})})
exten = _X.,n,Verbose(account=${account})
; If account is empty, try again
exten = _X.,n,Set(account=${IF($[ "${account}" = ""
]?${CRM_GET_ACCOUNT(${EXTEN})}:${account})})
exten = _X.,n,Verbose(account=${account})

log:

VERBOSE[3472] logger.c:     -- Executing [1234567890 at from-proxy:2]
Goto("SIP/proxy-081db9d0", "to-customer|1234567890|1") in new stack
VERBOSE[3472] logger.c:     -- Goto (to-customer,1234567890,1)
DEBUG[3472] pbx.c: Function result is '1234567890'
DEBUG[3472] pbx.c: Function result is 'testaccount\'
DEBUG[3472] pbx.c: Launching 'Set'
VERBOSE[3472] logger.c:     -- Executing [1234567890 at to-customer:1]
Set("SIP/proxy-081db9d0", "account=testaccount\") in new stack
DEBUG[3472] pbx.c: Launching 'Verbose'
VERBOSE[3472] logger.c:     -- Executing [1234567890 at to-customer:2]
Verbose("SIP/proxy-081db9d0", "account=testaccount") in new stack
VERBOSE[3472] logger.c: account=testaccount
DEBUG[3472] pbx.c: Expression result is '0'
DEBUG[3472] pbx.c: Function result is '1234567890'
DEBUG[3472] pbx.c: Function result is 'testaccount\'
DEBUG[3472] pbx.c: Function result is ''
DEBUG[3472] pbx.c: Launching 'Set'
VERBOSE[3472] logger.c:     -- Executing [1234567890 at to-customer:3]
Set("SIP/proxy-081db9d0", "account=") in new stack
DEBUG[3472] pbx.c: Launching 'Verbose'
VERBOSE[3472] logger.c:     -- Executing [1234567890 at to-customer:4]
Verbose("SIP/proxy-081db9d0", "account=") in new stack
VERBOSE[3472] logger.c: account=


The SQL function in func_odbc.conf always returns exactly 1 result:

[SQL](!)
dsn=telephony
prefix=CRM

[GET_ACCOUNT](SQL)
readsql=SELECT `username` FROM `extensions` WHERE `extension` =
'${SQL_ESC(${ARG1})}' ORDER BY `extension` DESC LIMIT 1

====================================================================== 

---------------------------------------------------------------------- 
 (0107159) svnbot (reporter) - 2009-06-29 14:36
 https://issues.asterisk.org/view.php?id=15317#c107159 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 204171

_U  trunk/

------------------------------------------------------------------------
r204171 | tilghman | 2009-06-29 14:36:57 -0500 (Mon, 29 Jun 2009) | 9
lines

Blocked revisions 204170 via svnmerge

........
  r204170 | tilghman | 2009-06-29 14:36:01 -0500 (Mon, 29 Jun 2009) | 3
lines
  
  Revision 189537 was supposed to make 1.4 more correct.  Instead, it
broke func_odbc.  Reverting.
  (closes issue https://issues.asterisk.org/view.php?id=15317, issue
https://issues.asterisk.org/view.php?id=14614)
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=204171 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-06-29 14:36 svnbot         Checkin                                      
2009-06-29 14:36 svnbot         Note Added: 0107159                          
======================================================================




More information about the asterisk-bugs mailing list