[asterisk-bugs] [Asterisk 0010872]: need to change the SQL Query

noreply at bugs.digium.com noreply at bugs.digium.com
Wed Oct 3 17:55:15 CDT 2007


The following issue has been CLOSED 
====================================================================== 
http://bugs.digium.com/view.php?id=10872 
====================================================================== 
Reported By:                falves11
Assigned To:                Corydon76
====================================================================== 
Project:                    Asterisk
Issue ID:                   10872
Category:                   PBX/pbx_realtime
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Asterisk Version:           1.4.11  
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
Resolution:                 no change required
Fixed in Version:           
====================================================================== 
Date Submitted:             10-02-2007 14:41 CDT
Last Modified:              10-03-2007 17:55 CDT
====================================================================== 
Summary:                    need to change the SQL Query
Description: 
I need to change the query that is sent to SQL Server to look for a real
time extension, to include the variable ${EXTEN} and also to remove the \
from '\_%' because SQL Server does not escape that character. In fact, the
precise SQL Statement should be moved to *.conf file, because every SQL
plataform is a little different. 
I need to know how to access the variable ${EXTEN} at the place where this
code is executed

if (!var) {
		cfg = ast_load_realtime_multientry(table, "exten LIKE", "\\_%",
"context", context, "priority", pri, NULL);	
in pbx_realtime.c

The SQL Statement that hits SQL Server should look like:
SELECT * FROM extensions_table WHERE @p1 LIKE exten + '%'  AND context =
@P2 AND priority >= @P3 ORDER BY priority

of course the variable @p1 should ve varchar(20) like the table column,
not CHAR(3) and also the content of @P1 should be ${EXTEN}




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

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-03-07 17:55  Corydon76      Status                   feedback => closed  
10-03-07 17:55  Corydon76      Resolution               open => no change
required
======================================================================




More information about the asterisk-bugs mailing list