[Freeswitch-users] where to put perl code to add cdr info

Steven Ayre steveayre at gmail.com
Sat Sep 25 02:52:59 PDT 2010


Just load both mod_xml_cdr and mod_cdr_csv at the same time.

Both modules will generate a cdr for each call, mod_xml_cdr submitting
to the webserver or writing to a .xml file and mod_cdr_csv writing a
CDR for the same call to the .csv

-Steve


On 24 September 2010 09:29,  <covici at ccs.covici.com> wrote:
> OK, thanks for that -- so am I correct that the XML will appear as
> standard input to the script?  And I guess I will have to write out the
> .csv myself which will be a pain, but its really convenient to have
> that.
>
> Thanks again.
>
> Steven Ayre <steveayre at gmail.com> wrote:
>
>> Too early, the call hangs up then enters the reporting stage where it will
>> write CDRs.
>>
>> 3 approaches I can think of:
>>
>> - Write a perl daemon that monitors the file for filesize/mtime changes and
>> runs if it sees the file change. You could look at either a periodic stat
>> with a sleep smaller than cron allows or using inotify.
>> - Make the CSV a FIFO with your perl daemon at the other end (I'd be wary of
>> that - there's no other copy for backup and if your daemon isn't running the
>> FIFO can fill up and lose CDRs)
>> - Move to mod_xml_cdr which is actually designed for that. You can either
>> use your perl code as a CGI or under apache+mod_perl so you don't have to do
>> a complete rewrite.
>>
>> I'd say mod_xml_cdr is the best approach.
>>
>> -Steve
>>
>>
>>
>> On 23 September 2010 12:29, <covici at ccs.covici.com> wrote:
>>
>> > I would like to  insert the cdr information when the call hangsup,
>> > rather than some kron job or something -- is there a way I can use
>> > hangup_api_hook to execute the perl code, or is this too early for
>> > cdr_csv to have populated the variables?
>> >
>> > Thanks.
>> >
>> > --
>> > Your life is like a penny.  You're going to lose it.  The question is:
>> > How do
>> > you spend it?
>> >
>> >         John Covici
>> >         covici at ccs.covici.com
>> >
>> > _______________________________________________
>> > FreeSWITCH-users mailing list
>> > FreeSWITCH-users at lists.freeswitch.org
>> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> > http://www.freeswitch.org
>> >
>>
>> ----------------------------------------------------
>> Alternatives:
>>
>> ----------------------------------------------------
>> _______________________________________________
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>
> --
> Your life is like a penny.  You're going to lose it.  The question is:
> How do
> you spend it?
>
>         John Covici
>         covici at ccs.covici.com
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>



More information about the FreeSWITCH-users mailing list