Hi All, I'm looking for a way to filter the AstDB cidname family to show only those entries with a specified area code in the Asterisk CLI. If this were a SQL database it would be something like: SELECT number, name FROM cidname WHERE number LIKE '1234%' I've tried "database show cidname 1234*" and substituted "%", "$", "-" for the wildcard character. I also tried "?" but the Asterisk CLI wouldn't let me type question marks. Does AstDB support wildcard characters in this way? BTW, I know that I can do asterisk -rx "database show cidname" | grep <area code> at the Linux shell prompt, but I'm looking for a way to do this without leaving the Asterisk CLI. TIA, -- Geoff
Geoff Lane wrote:> asterisk -rx "database show cidname" | grep <area code> > at the Linux shell prompt, but I'm looking for a way to do this > without leaving the Asterisk CLI. >I don't believe it does. Doug -- Ben Franklin quote: "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
On Mon, 2009-02-16 at 15:14 +0000, Geoff Lane wrote:> I'm looking for a way to filter the AstDB cidname family to show only > those entries with a specified area code in the Asterisk CLI.I don't think this is possible with the current AstDB code.> If this > were a SQL database it would be something like: > SELECT number, name FROM cidname WHERE number LIKE '1234%' > I've tried "database show cidname 1234*" and substituted "%", "$", "-" > for the wildcard character. I also tried "?" but the Asterisk CLI > wouldn't let me type question marks. > > Does AstDB support wildcard characters in this way?If you have that many items in a database and want to do those types of filters, why not stick them in a SQL database and use func_odbc to retrieve them from your SQL database inside the dialplan? -- Jared Smith Digium, Inc. | Training Manager