[asterisk-users] More SQL Querys in dialplan
Thorsten Göllner
tg at ovm-group.com
Tue Jul 5 04:34:04 CDT 2011
Executing the query in MySQL-CLI is fine?
Am 05.07.2011 11:25, schrieb Ulrich Meckel:
> Hi List
>
> I tried to use SQL Query in my diaplan. If i only use one or two there
> is no Problem but if i try to start the third one after the other it
> hangup after the 2nd clear
>
> exten => _123.,1,MYSQL(Connect connid host user pw db_name)
>
> exten => _123.,n,MYSQL(Query resultid ${connid} SELECT value1 FROM
> table1 WHERE sp=${var})
> exten => _123.,n,MYSQL(Fetch fetchid ${resultid} var1)
> exten => _123.,n,MYSQL(Clear ${resultid})
>
> exten => _123.,n,MYSQL(Query resultid ${connid} SELECT value2 FROM
> table2 WHERE sp='name')
> exten => _123.,n,MYSQL(Fetch fetchid ${resultid} var2)
> exten => _123.,n,NoOp(var2 = ${var2})
> exten => _123.,n,MYSQL(Clear ${resultid})
>
> exten => _123.,n,MYSQL(Query resultid ${connid} SELECT value3 FROM
> table2 WHERE sp='loc')
> exten => _123.,n,MYSQL(Fetch fetchid ${resultid} var3)
> exten => _123.,n,NoOp(var3 = ${var3})
> exten => _123.,n,MYSQL(Clear ${resultid}
>
> exten => _123.,n,MYSQL(Disconnect ${connid})
>
> CLI :
> -- Executing [03514138123 at btsctrl:6] MYSQL("lcr/5", "Fetch fetchid
> 2 var2") in new stack
> -- Executing [03514138123 at btsctrl:7] NoOp("lcr/5", "var2= 49") in
> new stack
> -- Executing [03514138123 at btsctrl:8] MYSQL("lcr/5", "Clear 2") in
> new stack
> -- Executing [03514138123 at btsctrl:9] Hangup("lcr/5", "") in new stack
More information about the asterisk-users
mailing list