On 11-01-22 08:46 PM, Sherwood McGowan wrote:
> Gentlemen,
> 
> I have googled, searched the mailing list archives, and even spoke on
> the IRC channel, but have not found an answer to the following
> problem. I am attempting to retrieve multiple columns in an ODBC query
> using ARRAY per the solutions offered by many individuals. My dialplan
> code is as follows:
> 
Here is some code I use on Asterisk 1.8:

extensions.conf
---
[SQL_CheckCallback]
exten => s,1,CELGenUserEvent(ODBC, ${CONTEXT})
    same =>
n,Set(ARRAY(SCHEDULEID,CALLDATE,CONTACTID)=${ODBC_CHECKCALLBACK(${ARG1})})
    same => n,Return(${ISNULL(${SCHEDULEID})})

func_odbc.conf
---
[CHECKCALLBACK]
dsn=asterisk
readsql=SELECT s.Id, c.CallDate, c.Id FROM Schedules s, ListContacts c
WHERE s.user='${SQL_ESC(${ARG1})}' AND s.Contact=c.Id AND s.Active=True

Hope it helps.

-- 
Paul Belanger
Digium, Inc. | Software Developer
twitter: pabelanger | IRC: pabelanger (Freenode)
Check us out at: http://digium.com & http://asterisk.org

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to