use of multiple templates and output files with mod_cdr_csv
Hello folks, I would be interested in using mod_cdr_csv to log CDRs in multiple files using different templates for each file. Is this currently possible? It would be used for example to export to more than one database tables having different fields and used for different purposes (billing, debug, ...). Thank you, François.
On Thu, Aug 12, 2010 at 2:25 AM, François Delawarde < fdelawarde@wirelessmundi.com> wrote:
Hello folks,
I would be interested in using mod_cdr_csv to log CDRs in multiple files using different templates for each file. Is this currently possible?
Look at the accountcode channel variable: http://wiki.freeswitch.org/wiki/Mod_cdr_csv#accountcode
-MC
This will allow to log to 2 CDR files (Master.csv + one specific to accountcode), no more. Correct me if I am wrong. François, what I would do is to log all the fields you need to Master.csv, and then do selective imports of the fields you require depending on the usage. mysqlimport (LOAD DATA INFILE) allows that if you put a dummy variable (@dummy) instead of a column name. David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34 Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur. Le 12/08/2010 à 20:56, Michael Collins a écrit :
On Thu, Aug 12, 2010 at 2:25 AM, François Delawarde <fdelawarde@wirelessmundi.com
wrote: Hello folks,
I would be interested in using mod_cdr_csv to log CDRs in multiple files using different templates for each file. Is this currently possible?
Look at the accountcode channel variable: http://wiki.freeswitch.org/wiki/Mod_cdr_csv#accountcode
-MC
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On Thu, Aug 12, 2010 at 12:18 PM, David Ponzone <david.ponzone@ipeva.fr>wrote:
This will allow to log to 2 CDR files (Master.csv + one specific to accountcode), no more. Correct me if I am wrong.
Yes, sort of. It does log to Master.csv and ${accountcode}.csv However, if you have a template in cdr_csv.conf.xml with the same name as the value in accountcode then it will use that template when creating the ${accountcode}.csv file. HTH, MC
Thanks for the answers,
Look at the accountcode channel variable: http://wiki.freeswitch.org/wiki/Mod_cdr_csv#accountcode
I initially wanted to use the accountcode variable as an account code for billing and not for template selection, but I guess I can use it for template and create another variable (ex: realaccountcode) for the actual account code. Only thing would be that I'd be limited to two templates. Say I want to log to CSV and a couple of database tables with different fields, well I'll have to do it "manually".
what I would do is to log all the fields you need to Master.csv, and then do selective imports of the fields you require depending on the usage. mysqlimport (LOAD DATA INFILE) allows that if you put a dummy variable (@dummy) instead of a column name.
Nice idea thanks, I could also have my own CDR script listening for hangup events, or to log everything to say an sqlite db and use a cron script to create other logs out of it, but the LOAD DATA INFILE method seems quite cool. Last question: Is there any way to load this module more than one time with different base directories to make it simpler? Thanks again, François.
I don't think you can load the same module twice. I would suggest you take a look at mod_xml_cdr. It dumps a whole lot of information, which can be very useful for debugging as well. You're already using an external program to parse the CSV files. Just need it to parse the XML output, and you've got access to a whole lot more! Regards HASSAN On Fri, Aug 13, 2010 at 14:27, François Delawarde < fdelawarde@wirelessmundi.com> wrote:
Thanks for the answers,
Look at the accountcode channel variable: http://wiki.freeswitch.org/wiki/Mod_cdr_csv#accountcode
I initially wanted to use the accountcode variable as an account code for billing and not for template selection, but I guess I can use it for template and create another variable (ex: realaccountcode) for the actual account code.
Only thing would be that I'd be limited to two templates. Say I want to log to CSV and a couple of database tables with different fields, well I'll have to do it "manually".
what I would do is to log all the fields you need to Master.csv, and then do selective imports of the fields you require depending on the usage. mysqlimport (LOAD DATA INFILE) allows that if you put a dummy variable (@dummy) instead of a column name.
Nice idea thanks, I could also have my own CDR script listening for hangup events, or to log everything to say an sqlite db and use a cron script to create other logs out of it, but the LOAD DATA INFILE method seems quite cool.
Last question: Is there any way to load this module more than one time with different base directories to make it simpler?
Thanks again, François.
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Indeed, there is no way to load a module multiple times. Modules register various api and app commands. Loading a module twice would register the same command twice, then how does fs know which module you mean? I would agree with Hassan - mod_xml_cdr is far more versatile, as the web server can read the account variable and use that to determine what to do with the cdr. Steve on iPhone On 14 Aug 2010, at 21:42, Nyamul Hassan <mnhassan@usa.net> wrote:
I don't think you can load the same module twice.
I would suggest you take a look at mod_xml_cdr. It dumps a whole lot of information, which can be very useful for debugging as well. You're already using an external program to parse the CSV files. Just need it to parse the XML output, and you've got access to a whole lot more!
Regards HASSAN
On Fri, Aug 13, 2010 at 14:27, François Delawarde <fdelawarde@wirelessmundi.com> wrote: Thanks for the answers,
Look at the accountcode channel variable: http://wiki.freeswitch.org/wiki/Mod_cdr_csv#accountcode
I initially wanted to use the accountcode variable as an account code for billing and not for template selection, but I guess I can use it for template and create another variable (ex: realaccountcode) for the actual account code.
Only thing would be that I'd be limited to two templates. Say I want to log to CSV and a couple of database tables with different fields, well I'll have to do it "manually".
what I would do is to log all the fields you need to Master.csv, and then do selective imports of the fields you require depending on the usage. mysqlimport (LOAD DATA INFILE) allows that if you put a dummy variable (@dummy) instead of a column name.
Nice idea thanks, I could also have my own CDR script listening for hangup events, or to log everything to say an sqlite db and use a cron script to create other logs out of it, but the LOAD DATA INFILE method seems quite cool.
Last question: Is there any way to load this module more than one time with different base directories to make it simpler?
Thanks again, François.
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (5)
-
David Ponzone
-
François Delawarde
-
Michael Collins
-
Nyamul Hassan
-
Steven Ayre