[asterisk-users] MySQL cmd % pattern matching

Garth van Sittert garth at bitco.co.za
Mon Dec 4 07:17:55 MST 2006


I have it working as your example, Doug, but unfortunately I need the 
like phrase as the numbers all contain spaces or sometimes even brackets.

Garth

Doug Lytle wrote:
> 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
>


More information about the asterisk-users mailing list