Is there any other way to retrieve CDRs from Kami other than dialog/acc modules and writing CDRs to syslog only?
Thanks.
The dialog+acc can also write the cdrs to database, afaik. If documentation says different, maybe it was forgotten to be updated.
Or you look for something different than using dialog+acc?
Cheers, Daniel
On 03.04.19 13:27, Yu Boot wrote:
Is there any other way to retrieve CDRs from Kami other than dialog/acc modules and writing CDRs to syslog only?
Thanks.
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Thanks for a reply
I need CDR easily "greppable", so it must be in regular text file. Very easy to parse, generate stats, and again, it can be "tail-f'ed".
And I want time in human readable format.
Now iI use acc/dialog, result is horrible syslog output which is 50% meaningless syslog stuff.
Show me right way. Or "Kamailio-way" to get CDR.
03.04.2019 15:01, Daniel-Constantin Mierla пишет:
The dialog+acc can also write the cdrs to database, afaik. If documentation says different, maybe it was forgotten to be updated.
Or you look for something different than using dialog+acc?
Cheers, Daniel
On 03.04.19 13:27, Yu Boot wrote:
Is there any other way to retrieve CDRs from Kami other than dialog/acc modules and writing CDRs to syslog only?
Thanks.
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
You can direct the syslog messages printed by acc module by setting the parameter:
- https://www.kamailio.org/docs/modules/5.2.x/modules/acc.html#acc.p.log_facil...
to a specific value and then configure the syslog application to write the messages with that facility to a specific file. In this way you can get acc records in a dedicated file, not together with the rest of logs printed by kamailio. See also:
- https://www.kamailio.org/wiki/tutorials/3.2.x/syslog
You can also look at acc_json, you can construct a way to push the acc records to your own backend where you can do whatever suits better for your needs.
Cheers, Daniel
On 03.04.19 14:31, Yu Boot wrote:
Thanks for a reply
I need CDR easily "greppable", so it must be in regular text file. Very easy to parse, generate stats, and again, it can be "tail-f'ed".
And I want time in human readable format.
Now iI use acc/dialog, result is horrible syslog output which is 50% meaningless syslog stuff.
Show me right way. Or "Kamailio-way" to get CDR.
03.04.2019 15:01, Daniel-Constantin Mierla пишет:
The dialog+acc can also write the cdrs to database, afaik. If documentation says different, maybe it was forgotten to be updated.
Or you look for something different than using dialog+acc?
Cheers, Daniel
On 03.04.19 13:27, Yu Boot wrote:
Is there any other way to retrieve CDRs from Kami other than dialog/acc modules and writing CDRs to syslog only?
Thanks.
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
You didn't catch my idea. Here's what Kami writes to syslog:
NOTICE: acc [acc_cdr.c:352]: log_write_cdr(): start_time=1554295999.014; end_time=1554296092.164; duration=93.150; src_user=4956885645; src_domain=65.181.181.218; src_ip=65.181.181.218; dst_ouser=9956885645; dst_user=6004440; dst_domain=181.188.186.32
1. I want to get rid from junk in beginning of CDR string, and ideally, remove params names.
2. I want end_time in human-readable format
3 and last little problem - I want call duration will be always integer.
Is anything of it attainable with Kami? These CDRs issues is a last thing that keep me from using Kami instead of Yate as a SBC.
03.04.2019 15:43, Daniel-Constantin Mierla пишет:
You can direct the syslog messages printed by acc module by setting the parameter:
- https://www.kamailio.org/docs/modules/5.2.x/modules/acc.html#acc.p.log_facil...
to a specific value and then configure the syslog application to write the messages with that facility to a specific file. In this way you can get acc records in a dedicated file, not together with the rest of logs printed by kamailio. See also:
- https://www.kamailio.org/wiki/tutorials/3.2.x/syslog
You can also look at acc_json, you can construct a way to push the acc records to your own backend where you can do whatever suits better for your needs.
Cheers, Daniel
On 03.04.19 14:31, Yu Boot wrote:
Thanks for a reply
I need CDR easily "greppable", so it must be in regular text file. Very easy to parse, generate stats, and again, it can be "tail-f'ed".
And I want time in human readable format.
Now iI use acc/dialog, result is horrible syslog output which is 50% meaningless syslog stuff.
Show me right way. Or "Kamailio-way" to get CDR.
03.04.2019 15:01, Daniel-Constantin Mierla пишет:
The dialog+acc can also write the cdrs to database, afaik. If documentation says different, maybe it was forgotten to be updated.
Or you look for something different than using dialog+acc?
Cheers, Daniel
On 03.04.19 13:27, Yu Boot wrote:
Is there any other way to retrieve CDRs from Kami other than dialog/acc modules and writing CDRs to syslog only?
Thanks.
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Anyone? I can't believe that nobody of Kami users don't have these problems with CDR.
03.04.2019 16:03, Yu Boot пишет:
You didn't catch my idea. Here's what Kami writes to syslog:
NOTICE: acc [acc_cdr.c:352]: log_write_cdr(): start_time=1554295999.014; end_time=1554296092.164; duration=93.150; src_user=4956885645; src_domain=65.181.181.218; src_ip=65.181.181.218; dst_ouser=9956885645; dst_user=6004440; dst_domain=181.188.186.32
- I want to get rid from junk in beginning of CDR string, and
ideally, remove params names.
- I want end_time in human-readable format
3 and last little problem - I want call duration will be always integer.
Is anything of it attainable with Kami? These CDRs issues is a last thing that keep me from using Kami instead of Yate as a SBC.
03.04.2019 15:43, Daniel-Constantin Mierla пишет:
You can direct the syslog messages printed by acc module by setting the parameter:
- https://www.kamailio.org/docs/modules/5.2.x/modules/acc.html#acc.p.log_facil...
to a specific value and then configure the syslog application to write the messages with that facility to a specific file. In this way you can get acc records in a dedicated file, not together with the rest of logs printed by kamailio. See also:
- https://www.kamailio.org/wiki/tutorials/3.2.x/syslog
You can also look at acc_json, you can construct a way to push the acc records to your own backend where you can do whatever suits better for your needs.
Cheers, Daniel
On 03.04.19 14:31, Yu Boot wrote:
Thanks for a reply
I need CDR easily "greppable", so it must be in regular text file. Very easy to parse, generate stats, and again, it can be "tail-f'ed".
And I want time in human readable format.
Now iI use acc/dialog, result is horrible syslog output which is 50% meaningless syslog stuff.
Show me right way. Or "Kamailio-way" to get CDR.
03.04.2019 15:01, Daniel-Constantin Mierla пишет:
The dialog+acc can also write the cdrs to database, afaik. If documentation says different, maybe it was forgotten to be updated.
Or you look for something different than using dialog+acc?
Cheers, Daniel
On 03.04.19 13:27, Yu Boot wrote:
Is there any other way to retrieve CDRs from Kami other than dialog/acc modules and writing CDRs to syslog only?
Thanks.
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi,
As Daniel said, you may want to look to the Dialog module here. You can use an xlog statement, database call, api, or whatever you would like to customize this for your needs.
This list isn’t to do the work for you, but to steer you in the right direction.
It may be helpful to tell the list what you have tried...
-- Fred direct/sms +1 (224) 334-3733
On Apr 4, 2019, at 02:20, Yu Boot yu@yu-boot.ru wrote:
Anyone? I can't believe that nobody of Kami users don't have these problems with CDR.
03.04.2019 16:03, Yu Boot пишет:
You didn't catch my idea. Here's what Kami writes to syslog:
NOTICE: acc [acc_cdr.c:352]: log_write_cdr(): start_time=1554295999.014; end_time=1554296092.164; duration=93.150; src_user=4956885645; src_domain=65.181.181.218; src_ip=65.181.181.218; dst_ouser=9956885645; dst_user=6004440; dst_domain=181.188.186.32
I want to get rid from junk in beginning of CDR string, and ideally, remove params names.
I want end_time in human-readable format
3 and last little problem - I want call duration will be always integer.
Is anything of it attainable with Kami? These CDRs issues is a last thing that keep me from using Kami instead of Yate as a SBC.
03.04.2019 15:43, Daniel-Constantin Mierla пишет:
You can direct the syslog messages printed by acc module by setting the parameter:
https://www.kamailio.org/docs/modules/5.2.x/modules/acc.html#acc.p.log_facil...
to a specific value and then configure the syslog application to write the messages with that facility to a specific file. In this way you can get acc records in a dedicated file, not together with the rest of logs printed by kamailio. See also:
You can also look at acc_json, you can construct a way to push the acc records to your own backend where you can do whatever suits better for your needs.
Cheers, Daniel
On 03.04.19 14:31, Yu Boot wrote: Thanks for a reply
I need CDR easily "greppable", so it must be in regular text file. Very easy to parse, generate stats, and again, it can be "tail-f'ed".
And I want time in human readable format.
Now iI use acc/dialog, result is horrible syslog output which is 50% meaningless syslog stuff.
Show me right way. Or "Kamailio-way" to get CDR.
03.04.2019 15:01, Daniel-Constantin Mierla пишет:
The dialog+acc can also write the cdrs to database, afaik. If documentation says different, maybe it was forgotten to be updated.
Or you look for something different than using dialog+acc?
Cheers, Daniel
On 03.04.19 13:27, Yu Boot wrote: Is there any other way to retrieve CDRs from Kami other than dialog/acc modules and writing CDRs to syslog only?
Thanks.
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
OK, to begin with, *time params of acc module do nothing with call_start and call_end fields in resulting CDR, they're still in unixtime. :(
04.04.2019 14:29, Fred Posner пишет:
Hi,
As Daniel said, you may want to look to the Dialog module here. You can use an xlog statement, database call, api, or whatever you would like to customize this for your needs.
This list isn’t to do the work for you, but to steer you in the right direction.
It may be helpful to tell the list what you have tried...
-- Fred direct/sms +1 (224) 334-3733
On Apr 4, 2019, at 02:20, Yu Boot yu@yu-boot.ru wrote:
Anyone? I can't believe that nobody of Kami users don't have these problems with CDR.
03.04.2019 16:03, Yu Boot пишет:
You didn't catch my idea. Here's what Kami writes to syslog:
NOTICE: acc [acc_cdr.c:352]: log_write_cdr(): start_time=1554295999.014; end_time=1554296092.164; duration=93.150; src_user=4956885645; src_domain=65.181.181.218; src_ip=65.181.181.218; dst_ouser=9956885645; dst_user=6004440; dst_domain=181.188.186.32
I want to get rid from junk in beginning of CDR string, and ideally, remove params names.
I want end_time in human-readable format
3 and last little problem - I want call duration will be always integer.
Is anything of it attainable with Kami? These CDRs issues is a last thing that keep me from using Kami instead of Yate as a SBC.
03.04.2019 15:43, Daniel-Constantin Mierla пишет:
You can direct the syslog messages printed by acc module by setting the parameter:
-
https://www.kamailio.org/docs/modules/5.2.x/modules/acc.html#acc.p.log_facil...
to a specific value and then configure the syslog application to write the messages with that facility to a specific file. In this way you can get acc records in a dedicated file, not together with the rest of logs printed by kamailio. See also:
- https://www.kamailio.org/wiki/tutorials/3.2.x/syslog
You can also look at acc_json, you can construct a way to push the acc records to your own backend where you can do whatever suits better for your needs.
Cheers, Daniel
On 03.04.19 14:31, Yu Boot wrote: Thanks for a reply
I need CDR easily "greppable", so it must be in regular text file. Very easy to parse, generate stats, and again, it can be "tail-f'ed".
And I want time in human readable format.
Now iI use acc/dialog, result is horrible syslog output which is 50% meaningless syslog stuff.
Show me right way. Or "Kamailio-way" to get CDR.
03.04.2019 15:01, Daniel-Constantin Mierla пишет:
The dialog+acc can also write the cdrs to database, afaik. If documentation says different, maybe it was forgotten to be updated.
Or you look for something different than using dialog+acc?
Cheers, Daniel
> On 03.04.19 13:27, Yu Boot wrote: > Is there any other way to retrieve CDRs from Kami other than > dialog/acc modules and writing CDRs to syslog only? > > > Thanks. > > > _______________________________________________ > Kamailio (SER) - Users Mailing List > sr-users@lists.kamailio.org > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
The time params for acc are related to writing the event-based (transaction) accounting records -- the native mode for acc module (with no dialog involved).
The cdrs are controlled by dialog module, call_start being stored in the dialog structure and with that is also computed the call_end.
I haven't coded nor used dialog based cdrs, but probably one has to write some c code to add an option about the format for the time values there -- likely not something complex.
As I use (and wrote code for) the event-based accounting, I know about that part of acc.
For comma separated values, db_flatstore module can write like that, but each process will have its own output file.
Daniel
On 05.04.19 14:25, Yu Boot wrote:
OK, to begin with, *time params of acc module do nothing with call_start and call_end fields in resulting CDR, they're still in unixtime. :(
04.04.2019 14:29, Fred Posner пишет:
Hi,
As Daniel said, you may want to look to the Dialog module here. You can use an xlog statement, database call, api, or whatever you would like to customize this for your needs.
This list isn’t to do the work for you, but to steer you in the right direction.
It may be helpful to tell the list what you have tried...
-- Fred direct/sms +1 (224) 334-3733
On Apr 4, 2019, at 02:20, Yu Boot yu@yu-boot.ru wrote:
Anyone? I can't believe that nobody of Kami users don't have these problems with CDR.
03.04.2019 16:03, Yu Boot пишет:
You didn't catch my idea. Here's what Kami writes to syslog:
NOTICE: acc [acc_cdr.c:352]: log_write_cdr(): start_time=1554295999.014; end_time=1554296092.164; duration=93.150; src_user=4956885645; src_domain=65.181.181.218; src_ip=65.181.181.218; dst_ouser=9956885645; dst_user=6004440; dst_domain=181.188.186.32
- I want to get rid from junk in beginning of CDR string, and
ideally, remove params names.
- I want end_time in human-readable format
3 and last little problem - I want call duration will be always integer.
Is anything of it attainable with Kami? These CDRs issues is a last thing that keep me from using Kami instead of Yate as a SBC.
03.04.2019 15:43, Daniel-Constantin Mierla пишет:
You can direct the syslog messages printed by acc module by setting the parameter:
- https://www.kamailio.org/docs/modules/5.2.x/modules/acc.html#acc.p.log_facil...
to a specific value and then configure the syslog application to write the messages with that facility to a specific file. In this way you can get acc records in a dedicated file, not together with the rest of logs printed by kamailio. See also:
- https://www.kamailio.org/wiki/tutorials/3.2.x/syslog
You can also look at acc_json, you can construct a way to push the acc records to your own backend where you can do whatever suits better for your needs.
Cheers, Daniel
On 03.04.19 14:31, Yu Boot wrote: Thanks for a reply
I need CDR easily "greppable", so it must be in regular text file. Very easy to parse, generate stats, and again, it can be "tail-f'ed".
And I want time in human readable format.
Now iI use acc/dialog, result is horrible syslog output which is 50% meaningless syslog stuff.
Show me right way. Or "Kamailio-way" to get CDR.
03.04.2019 15:01, Daniel-Constantin Mierla пишет: > The dialog+acc can also write the cdrs to database, afaik. If > documentation says different, maybe it was forgotten to be updated. > > Or you look for something different than using dialog+acc? > > Cheers, > Daniel > >> On 03.04.19 13:27, Yu Boot wrote: >> Is there any other way to retrieve CDRs from Kami other than >> dialog/acc modules and writing CDRs to syslog only? >> >> >> Thanks. >> >> >> _______________________________________________ >> Kamailio (SER) - Users Mailing List >> sr-users@lists.kamailio.org >> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
You can always export the cdr table periodically. Take a look at siremis. And when the trigger fires every 5 minutes to create the cdrs, just export them.
Also, as it’s been said, you can use the dialog and when the call ends gather all the info and just print it out. You can direct it to rsyslog to save it anywhere you want.
On Fri, 5 Apr 2019 at 13:54, Daniel-Constantin Mierla miconda@gmail.com wrote:
The time params for acc are related to writing the event-based (transaction) accounting records -- the native mode for acc module (with no dialog involved).
The cdrs are controlled by dialog module, call_start being stored in the dialog structure and with that is also computed the call_end.
I haven't coded nor used dialog based cdrs, but probably one has to write some c code to add an option about the format for the time values there -- likely not something complex.
As I use (and wrote code for) the event-based accounting, I know about that part of acc.
For comma separated values, db_flatstore module can write like that, but each process will have its own output file.
Daniel
On 05.04.19 14:25, Yu Boot wrote:
OK, to begin with, *time params of acc module do nothing with call_start and call_end fields in resulting CDR, they're still in unixtime. :(
04.04.2019 14:29, Fred Posner пишет:
Hi,
As Daniel said, you may want to look to the Dialog module here. You can use an xlog statement, database call, api, or whatever you would like to customize this for your needs.
This list isn’t to do the work for you, but to steer you in the right direction.
It may be helpful to tell the list what you have tried...
-- Fred direct/sms +1 (224) 334-3733
On Apr 4, 2019, at 02:20, Yu Boot yu@yu-boot.ru wrote:
Anyone? I can't believe that nobody of Kami users don't have these problems with CDR.
03.04.2019 16:03, Yu Boot пишет:
You didn't catch my idea. Here's what Kami writes to syslog:
NOTICE: acc [acc_cdr.c:352]: log_write_cdr(): start_time=1554295999.014; end_time=1554296092.164; duration=93.150; src_user=4956885645; src_domain=65.181.181.218; src_ip=65.181.181.218; dst_ouser=9956885645; dst_user=6004440; dst_domain=181.188.186.32
- I want to get rid from junk in beginning of CDR string, and
ideally, remove params names.
- I want end_time in human-readable format
3 and last little problem - I want call duration will be always integer.
Is anything of it attainable with Kami? These CDRs issues is a last thing that keep me from using Kami instead of Yate as a SBC.
03.04.2019 15:43, Daniel-Constantin Mierla пишет:
You can direct the syslog messages printed by acc module by setting the parameter:
-
https://www.kamailio.org/docs/modules/5.2.x/modules/acc.html#acc.p.log_facil...
to a specific value and then configure the syslog application to write the messages with that facility to a specific file. In this way you can get acc records in a dedicated file, not together with the rest of logs printed by kamailio. See also:
- https://www.kamailio.org/wiki/tutorials/3.2.x/syslog
You can also look at acc_json, you can construct a way to push the acc records to your own backend where you can do whatever suits better for your needs.
Cheers, Daniel
> On 03.04.19 14:31, Yu Boot wrote: > Thanks for a reply > > > I need CDR easily "greppable", so it must be in regular text file. > Very easy to parse, generate stats, and again, it can be > "tail-f'ed". > > And I want time in human readable format. > > Now iI use acc/dialog, result is horrible syslog output which is 50% > meaningless syslog stuff. > > > Show me right way. Or "Kamailio-way" to get CDR. > > > 03.04.2019 15:01, Daniel-Constantin Mierla пишет: >> The dialog+acc can also write the cdrs to database, afaik. If >> documentation says different, maybe it was forgotten to be updated. >> >> Or you look for something different than using dialog+acc? >> >> Cheers, >> Daniel >> >>> On 03.04.19 13:27, Yu Boot wrote: >>> Is there any other way to retrieve CDRs from Kami other than >>> dialog/acc modules and writing CDRs to syslog only? >>> >>> >>> Thanks. >>> >>> >>> _______________________________________________ >>> Kamailio (SER) - Users Mailing List >>> sr-users@lists.kamailio.org >>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla -- www.asipto.com www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio World Conference - May 6-8, 2019 -- www.kamailioworld.com
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
How to make something on dialog event? Just can't figure it out after reading module docs :(
06.04.2019 2:09, David Villasmil пишет:
You can always export the cdr table periodically. Take a look at siremis. And when the trigger fires every 5 minutes to create the cdrs, just export them.
Also, as it’s been said, you can use the dialog and when the call ends gather all the info and just print it out. You can direct it to rsyslog to save it anywhere you want.
Hello,
some starting points:
- use dlg_manage() or set a dialog flag in the cfg to start dialog tracking
- setup the dialog event routes (section 11 in README) and put your logging logic there
Best regards,
Henning
Am 06.04.19 um 11:29 schrieb Yu Boot:
How to make something on dialog event? Just can't figure it out after reading module docs :(
06.04.2019 2:09, David Villasmil пишет:
You can always export the cdr table periodically. Take a look at siremis. And when the trigger fires every 5 minutes to create the cdrs, just export them.
Also, as it’s been said, you can use the dialog and when the call ends gather all the info and just print it out. You can direct it to rsyslog to save it anywhere you want.
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hello,
i was working on a similar problem. I followed the acc-dialog -> (r)syslog approach. In rsyslog I piped the message to a script, which appends the message as a xml-record to a file in "/var/log/kamailio-call.log“. (This script might be useful for you to adapt to your needs.)
module(load="omprog“) local6.* action(type="omprog" binary="/etc/rsyslog-cdr-script.sh")
and my script looks like
#! /bin/ash Log=/var/log/kamailio-call.log read fromstdin; while read fromstdin; do echo $fromstdin | sed -e "s/^[^;]* (.*=)/\1/" -e "s/(time=[0-9]*).[0-9]*/\1/g" -e "s/([^=;]*)=([^;]*(;[^ ][^=]*=[^;]*)*); / <\1>\2</\1>; /g" -e "s/ ([^=;]*)=([^;]*(;[^ ][^=]*=[^;]*)*)$/ <\1>\2</\1>/" | awk 'BEGIN {FS=";"; printf "<call>"} { i = 1; while(i < NF){if(index($i,"time>")>0) { time_value = $i; gsub("<[^>]*>","",time_value); sub(">[^<]*", strftime(">%Y-%m-%dT%H:%M:%S", time_value), $i); } printf $i; i = i+1;} } END {print "</call>"}' >> $Log done
Here a little explanation that might be helpful to understand the commands: The sed-command *) removes the front syslog-stuff *) trunks all the post dot digit from any entry that names ends with „time" and *) converts it to xml-syntax (one extra for the last entry)
The awk command converts the (trunked) timestamps into a "human-readable“ format and adds the enclosing „call“ syntax. (If you exactly know what your syslog entry syntax is, you might simplify the script statements a lot … )
I hope this helps a little.
Regards Jan-Hendrik
Am 07.04.2019 um 12:42 schrieb Henning Westerholt hw@skalatan.de:
Hello,
some starting points:
use dlg_manage() or set a dialog flag in the cfg to start dialog tracking
setup the dialog event routes (section 11 in README) and put your
logging logic there
Best regards,
Henning
Am 06.04.19 um 11:29 schrieb Yu Boot:
How to make something on dialog event? Just can't figure it out after reading module docs :(
06.04.2019 2:09, David Villasmil пишет:
You can always export the cdr table periodically. Take a look at siremis. And when the trigger fires every 5 minutes to create the cdrs, just export them.
Also, as it’s been said, you can use the dialog and when the call ends gather all the info and just print it out. You can direct it to rsyslog to save it anywhere you want.
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Henning Westerholt - https://skalatan.de/blog/ Kamailio services - https://skalatan.de/services
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Thanks you!
10.04.2019 10:28, Jan-Hendrik Dörner пишет:
Hello,
i was working on a similar problem. I followed the acc-dialog -> (r)syslog approach. In rsyslog I piped the message to a script, which appends the message as a xml-record to a file in "/var/log/kamailio-call.log“. (This script might be useful for you to adapt to your needs.)
module(load="omprog“) local6.* action(type="omprog" binary="/etc/rsyslog-cdr-script.sh")
and my script looks like
#! /bin/ash Log=/var/log/kamailio-call.log read fromstdin; while read fromstdin; do echo $fromstdin | sed -e "s/^[^;]* (.*=)/\1/" -e "s/(time=[0-9]*).[0-9]*/\1/g" -e "s/([^=;]*)=([^;]*(;[^ ][^=]*=[^;]*)*); / <\1>\2</\1>; /g" -e "s/ ([^=;]*)=([^;]*(;[^ ][^=]*=[^;]*)*)$/ <\1>\2</\1>/" | awk 'BEGIN {FS=";"; printf "<call>"} { i = 1; while(i < NF){if(index($i,"time>")>0) { time_value = $i; gsub("<[^>]*>","",time_value); sub(">[^<]*", strftime(">%Y-%m-%dT%H:%M:%S", time_value), $i); } printf $i; i = i+1;} } END {print "</call>"}' >> $Log done
Here a little explanation that might be helpful to understand the commands: The sed-command *) removes the front syslog-stuff *) trunks all the post dot digit from any entry that names ends with „time" and *) converts it to xml-syntax (one extra for the last entry)
The awk command converts the (trunked) timestamps into a "human-readable“ format and adds the enclosing „call“ syntax. (If you exactly know what your syslog entry syntax is, you might simplify the script statements a lot … )
I hope this helps a little.
Regards Jan-Hendrik
Am 07.04.2019 um 12:42 schrieb Henning Westerholt <hw@skalatan.de mailto:hw@skalatan.de>:
Hello,
some starting points:
- use dlg_manage() or set a dialog flag in the cfg to start dialog
tracking
- setup the dialog event routes (section 11 in README) and put your
logging logic there
Best regards,
Henning
Am 06.04.19 um 11:29 schrieb Yu Boot:
How to make something on dialog event? Just can't figure it out after reading module docs :(
06.04.2019 2:09, David Villasmil пишет:
You can always export the cdr table periodically. Take a look at siremis. And when the trigger fires every 5 minutes to create the cdrs, just export them.
Also, as it’s been said, you can use the dialog and when the call ends gather all the info and just print it out. You can direct it to rsyslog to save it anywhere you want.
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Henning Westerholt - https://skalatan.de/blog/ Kamailio services - https://skalatan.de/services
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users