[asterisk-users] MySQL cmd % pattern matching

Doug Lytle support at drdos.info
Mon Dec 4 05:55:36 MST 2006


Garth van Sittert wrote:
>    exten => s,5,Set(query=SELECT name from contacts where tel like 
> %${number})
>    exten => s,6,MySQL(Connect connid hostname username password dbname)
>    exten => s,7,MySQL(Query resultid ${connid} ${query})
>
This is how I would do it:

exten => s,5,MYSQL(Query resultid ${connid} SELECT name FROM contacts 
WHERE tel = ${number})
exten => s,6,MYSQL(Fetch fetchid ${resultid} contact.name)
exten => s,7,MYSQL(Disconnect ${connid})
exten => s,8,MYSQL(Clear ${resultid})

Doug

-- 
 
Ben Franklin quote:

"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."




More information about the asterisk-users mailing list