[asterisk-users] func_odbc and hash problem

Giedrius Augys voipas at gmail.com
Tue Dec 2 01:21:46 CST 2008


Hello,

  Now I'm testing func_odbc and hash. My configurations are:

func_odbc.conf
[GETNUMBER]
dsn=sqlserver
;mode=multirow
;rowlimit=10
readsql=SELECT number,real_number1,real_number2,status FROM ivr.dbo.numbers
WHERE number=${SQL_ESC(${ARG1})}

extensions.conf
exten => s,1,Ringing
exten => s,n,Wait(4)
exten => s,n,Answer
exten => s,n,Set(NUMERIS=37037210602)
exten => s,n,Set(HASH(RESULTATAS)=${ODBC_GETNUMBER(${NUMERIS})})
exten => s,n,Verbose(1, Number is  ${HASH(RESULTATAS, number)}.)
exten => s,n,Verbose(1, Realus 1  ${HASH(RESULTATAS, real_number1)}.)
exten => s,n,Verbose(1, Realus 2  ${HASH(RESULTATAS, real_number2)}.)
exten => s,n,Verbose(1, Statusas  ${HASH(RESULTATAS, status)}.)

And asterisk output is:

== Using SIP RTP CoS mark 5
    -- Executing [555 at from-trunk:1] Goto("SIP/sip.call.lt-01993050",
"odbc-test,s,1") in new stack
    -- Goto (odbc-test,s,1)
    -- Executing [s at odbc-test:1] Ringing("SIP/sip.call.lt-01993050", "") in
new stack
    -- Executing [s at odbc-test:2] Wait("SIP/sip.call.lt-01993050", "4") in
new stack
    -- Executing [s at odbc-test:3] Answer("SIP/sip.call.lt-01993050", "") in
new stack
    -- Executing [s at odbc-test:4] Set("SIP/sip.call.lt-01993050",
"NUMERIS=111") in new stack
    -- Executing [s at odbc-test:5] Set("SIP/sip.call.lt-01993050",
"HASH(RESULTATAS)=111,222,333,2") in new stack
    -- Executing [s at odbc-test:6] Verbose("SIP/sip.call.lt-01993050", "1,
Number is  .") in new stack
  Number is  .
    -- Executing [s at odbc-test:7] Verbose("SIP/sip.call.lt-01993050", "1,
Realus 1  .") in new stack
  Realus 1  .
    -- Executing [s at odbc-test:8] Verbose("SIP/sip.call.lt-01993050", "1,
Realus 2  .") in new stack
  Realus 2  .
    -- Executing [s at odbc-test:9] Verbose("SIP/sip.call.lt-01993050", "1,
Statusas  .") in new stack
  Statusas  .
    -- Auto fallthrough, channel 'SIP/sip.call.lt-01993050' status is
'UNKNOWN'


As I read documentation, function hash gives posibility to get values using
column name. But my test was unsuccessful. Maybe somebody can help...

Thanks

-- 
Pagarbiai  / Best Regards,
Giedrius Augys
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20081202/c992d0fa/attachment.htm 


More information about the asterisk-users mailing list