[asterisk-users] how to use a database (was: figuring out what happened to a call)

hw hw at gc-24.de
Wed Dec 5 08:31:38 CST 2018


On 12/05/2018 01:19 PM, Antony Stone wrote:
> On Wednesday 05 December 2018 at 13:04:57, hw wrote:
> 
>> On 12/04/2018 07:07 PM, Antony Stone wrote:
>>> On Tuesday 04 December 2018 at 16:11:39, hw wrote:
>>>> On 12/01/2018 05:30 PM, Marcelo Terres wrote:
>>>>> Queue_log
>>>>
>>>> Thanks!
>>>>
>>>> That's not really it; however, how do I make it so that asterisk writes
>>>> this information right away into a mariadb database instead of into a
>>>> file so that I could actually use it?
>>>
>>> Send your queue_log entries to odbc?
>>
>> odbc?  Seriously?
> 
> Yes, it's the preferred method of talking to databases from Asterisk.

After reading some documentation, anything else but odbc appears to be 
more or less deprecated :/

> If you want to use the MySQL-specific driver / connector, you can still use
> that for some things, but Voicemail in a database can only be done via ODBC,
> for example.
> 
>>> It's a setting in extconfig.conf.
>>
>> Does mysql not work?  It's mentioned there, too.
> 
> By all means try it - if it's mentioned, it'll probably work, but ODBC is the
> more generic and better-supported way of using databases with Asterisk.

Since it really seems to be the most reasonable choice, I've set up an 
odbc connection and used alembic to create tables in a database for 
asterisk.

Now how is this managable?  Is there a tool that reads the files I have 
and enters the configuration into the database?  And when changes are to 
be made, editing configuration files is tremendously easier than going 
through the tables in the database and try to make the changes there.

For now, can I make it so that only the queue_log is written into the 
database?  I don't see a table for that.

How dynamic are changes made in the database?  For example, if I want to 
have an extension 'foobar' and want to ring different devices depending 
on some factors (like time of day, for example), can I modify the entry 
in the database for the device to ring from 'bar' to 'baz', and baz will 
ring instead of bar from thereon?  That seems to be what this is 
intended for; in any case, it's what I'm going to need, which is why I 
went to all these lengths to connect to a database.

Is it possible to use configuration from both the database and the files 
at the same time?  That would save me converting all the entries in the 
files for now.



More information about the asterisk-users mailing list