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

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Jun 12 06:15:07 CDT 2009


The following issue has been SUBMITTED. 
====================================================================== 
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:                     assigned
Asterisk Version:           1.4.25 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-06-12 06:15 CDT
Last Modified:              2009-06-12 06:15 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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-06-12 06:15 alexh          New Issue                                    
2009-06-12 06:15 alexh          Status                   new => assigned     
2009-06-12 06:15 alexh          Assigned To               => tilghman        
2009-06-12 06:15 alexh          Asterisk Version          => 1.4.25          
2009-06-12 06:15 alexh          Regression                => No              
2009-06-12 06:15 alexh          SVN Branch (only for SVN checkouts, not tarball
releases) => N/A             
======================================================================




More information about the asterisk-bugs mailing list