[asterisk-users] Function to query ASTDB families

Tilghman Lesher tlesher at digium.com
Thu Sep 10 09:36:30 CDT 2009


On Tuesday 08 September 2009 16:33:20 Olivier wrote:
> Asterisk database is made of <family><key> records such as:
> fam  key1  val1
> fam  key2  val2
> ...
> fam  key100  val100
>
> I'm looking for the smartest way to iterate among different keys associated
> to a given family.
>
> One way to do this is to parse "database show fam" response.
> Is there something smarter ?
> Something like ${DBKEYS(fam)} which would evaluate to "key1 key2  ...
> key100".

I think the smarter way, once you've gotten to this level of complexity, is to
start using a real external database, such as Postgres, configure the ODBC
driver, and use func_odbc to interface to it.  AstDB was never meant to be
such a general purpose database (indeed, queries to it are processed serially,
not in parallel, as in real databases).

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-users mailing list