[asterisk-users] MySQL cmd % pattern matching

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


Ah, I found the solution to my problem:

I slashed out the ' to give:

    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})

Kind Regards
Garth




Garth van Sittert wrote:
> Hi All
>
> Does anyone know how to use the MySQL cmd in Asterisk with LIKE and % 
> in the query?
>
> I have:
>
>    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})
>
> But there seems to be a problem with the % sign and I don't know how 
> to hash it out.
> It works without the % sign.
>
> Thanks
>
> Kind Regards
> Garth
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users


More information about the asterisk-users mailing list