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

Olivier oza_4h07 at yahoo.fr
Wed Apr 10 04:05:05 CDT 2013


2013/4/10 Satish Barot <satish4asterisk at gmail.com>

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

Yes, of course, but having a dedicated function for frequent pattern is
convenient.




>
> --Satish Barot
> Ahmedabad, India.
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>                http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20130410/57cae796/attachment-0001.htm>


More information about the asterisk-users mailing list