ast_mongo icon indicating copy to clipboard operation
ast_mongo copied to clipboard

cdr custom field, is it possible?

Open cusco opened this issue 6 years ago • 9 comments

Hello. I'm testing this and once built, configuration seems simple.

However I would like to add some cdr custom fields the same way I've been doing with sql/odbc

Basically, in teh dialplan I use something like: Set(CDR(recording)=/path/to/recording.gsm); and the column 'recording' on the database gets populated with /path/to/recording

I tried adding a custom field but it is not in the cdr collection.

Is there a way to do this?

cusco avatar Jun 04 '19 11:06 cusco

I was just reading through: https://github.com/minoruta/ast_mongo/blob/1d7f21d52bd8a724d2b8722a1cbba4dcadfa6613/src/cdr_mongodb.c

Seems like the fields are static - hardcoded. Could it be changed to loop for every set cdr->variable ? Other backends support this...

cusco avatar Jun 04 '19 11:06 cusco

The custom fields is not supported now. However, let me look into the code.

minoruta avatar Jun 06 '19 12:06 minoruta

The custom fields is not supported now. However, let me look into the code.

Thanks. It would be nice to have this functionality in the future, like other backends

cusco avatar Jun 11 '19 11:06 cusco

Thanks. I couldn't get any good idea from ./cdr/cdr_odbc.c, need more studying.

minoruta avatar Jun 12 '19 03:06 minoruta

Currently we use cdr adaptative odbc to use MS SQL Server as a backend. It supports this. MySQL also supports this as we have used it in the past

We need to change the table and add column X, in the dialplan set CDR(X)=value and reload the cdr odbc/mysql module

Perhaps looking at cdr_adaptive_odbc.c ?

cusco avatar Jun 13 '19 09:06 cusco

Yes, thanks, it's helpful. Can I see your cdr_adaptive_odbc.conf for Set(CDR(recording)=/path/to/recording.gsm); for example.

minoruta avatar Jun 14 '19 00:06 minoruta

As stated, we do not specify custom columns in the conf.

Currently our conf has: [mssql] connection=perfpbx loguniqueid = yes alias end => ended

We add the column "recording" to the table. Then in the dialplan Set(CDR(recording)=/path/to/recording.gsm);

cusco avatar Jun 14 '19 10:06 cusco

Wow, it's what I want to know;

We add the column "recording" to the table.

Thanks a lot.

minoruta avatar Jun 14 '19 22:06 minoruta

Wow, it's what I want to know;

We add the column "recording" to the table.

Thanks a lot.

Worth mentioning that I need to reload the module for asterisk to recognise the new column.

I thank you, for looking into this!

cusco avatar Jun 17 '19 09:06 cusco