[asterisk-dev] ODBCquery trouble

Alexandr Olekhnovich a.olekhnovich at gmail.com
Sun Oct 8 23:47:39 MST 2006


Hello,
I have a trouble with ODBCquery mod. I am using it from
http://asterisk.junyks.cz/
I've installed it and it works properly, but there is a problem.
1. I run Asterisk.
2. I connect a phone to Asterisk.
3. It works
*-- Executing Set("SIP/2222-08b28d70", "tempbal=0") in new stack
-- Executing ODBCquery("SIP/2222-08b28d70", "tempbal=SELECT balance FROM
sip_buddies WHERE name=2222") in new stack
-- odbcquery: varname=tempbal, query=SELECT balance FROM sip_buddies WHERE
name=2222
-- SIP Seeding peer from astdb: '2222' at 2222 at 192.168.7.169:29000 for 3600
> app_odbcexec: Query Successful!
-- odbcquery: set variable tempbal to 10
*4.But when I push redial on my X-Lite phone it doesn't work, see
*-- Executing Set("SIP/2222-08b28d70", "tempbal=0") in new stack
-- SIP Seeding peer from astdb: '2222' at 2222 at 192.168.7.169:29000 for 3600
-- Executing ODBCquery("SIP/2222-08b28d70", "tempbal=SELECT balance FROM
sip_buddies WHERE name=2222") in new stack
-- odbcquery: varname=tempbal, query=SELECT balance FROM sip_buddies WHERE
name=2222
> app_odbcexec: Error in PREPARE -1
-- odbcquery: Value not found in database.*
So I need to restart my asterisk for good work.
That's the part of my context
*[mycontext]
..........
exten => _X.,1,Set(tempbal=0)
exten => _X.,2,ODBCquery(tempbal=SELECT balance FROM sip_buddies WHERE
name=${CALLERIDNUM})
exten => _X.,3,GotoIf($[${tempbal} = 0]?30:7)
.............
*May be this code is buggy or I do something wrong.*
**
*Best Regards
Alexandr Olekhnovich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20061008/f14bb903/attachment.htm


More information about the asterisk-dev mailing list