[asterisk-users] Feature request: What about a new DB_IFEXISTS function ?

Satish Barot satish4asterisk at gmail.com
Wed Apr 10 02:12:18 CDT 2013


On Tue, Apr 9, 2013 at 7:56 PM, Olivier <oza_4h07 at yahoo.fr> wrote:

>
> Hello,
>
> What about having a new DB_IFEXISTS function in Asterisk ?
>
> It would accept two arguments : one being family/Key just as DB function,
> and the other being a default value which would be returned if family/key
> value does not exist.
>
> Thoughts ?
>
> Regards
>

You can achieve the same functionality using IF function. Something like,
...
same => n,Set(foo=${IF($[ "${DB(family/key)}" =
""]?defaultval:${DB(family/key)})})

--Satish Barot
Ahmedabad, India.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20130410/467abbc5/attachment.htm>


More information about the asterisk-users mailing list