[Freeswitch-users] Pushing CDR Information into Zeromq
Neo Cheema
neo.cheema at gmail.com
Sat Jul 7 16:26:50 MSD 2012
I looked around, and mod_event_zmq does infact send "all" the events.
So I just need to filter the incoming messages like, hangup_complete
etc to generate CDR-like info at the other end. Ofcourse, the listener
should be up all the time at the other end. So enabling mod_cdr_csv
can handle disk persistence in case worker goes down.
But I also liked the idea of generating 'billsec' like variables
inside the script independently. Thanks for the inputs.
On Sat, Jul 7, 2012 at 4:26 PM, Michael Giagnocavo <mgg at giagnocavo.net> wrote:
> Regarding “safe” variables like billsec: The issue is that most of those
> things are not calculated and set until later on in the lifecycle of a
> request, well after your Lua script has run. You can access them in C by
> adding a state handler, but I don’t believe that’s easily exposed to “API”
> apps/scripts. Anthony humoured me a quite a bit trying to get that kind of
> stuff working, but (at least a while ago), it was just not feasible. I would
> suggest that your Lua script add in its own data variables that it would use
> in billing calculations, then let the full CDR get written, then pick up
> processing again, restore the vars from the CDR, and continue calculations.
> I know, it’s not the most elegant seeming approach, but it’s the only
> reliable way AFAIK.
>
> -Michael
>
>
>
> From: freeswitch-users-bounces at lists.freeswitch.org
> [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Avi
> Marcus
> Sent: Friday, July 06, 2012 4:02 AM
>
>
> To: FreeSWITCH Users Help
> Subject: Re: [Freeswitch-users] Pushing CDR Information into Zeromq
>
>
>
> I'm pretty sure there's a variable to have the CDR in the ESL events, but I
> can't find it.
>
>
>
> -Avi
>
>
>
> On Fri, Jul 6, 2012 at 12:42 PM, Neo Cheema <neo.cheema at gmail.com> wrote:
>
> Avi,
> Yea. That would work as well. I just thought it would be a
> 'nice-to-have' feature. Guess I'll go ahead with your model.
>
> Regards
>
>
> On Fri, Jul 6, 2012 at 2:07 PM, Avi Marcus <avi at avimarcus.net> wrote:
>> I process CDRs on the same machine and then replicate the DB elsewhere.
>> Or you could have a daemon processing the CDRs on the main machine and
>> doing
>> whatever with them.
>> The benefit is that then you'll have file persistence of the CDRs until
>> they
>> actually get processed...
>>
>> -Avi
>>
>>
>> On Fri, Jul 6, 2012 at 11:10 AM, Neo Cheema <neo.cheema at gmail.com> wrote:
>>>
>>> Avi,
>>>
>>> What I really want is to provide near-real time updates of CDRs on a
>>> webpage, the webserver not necessarily being on the same machine as
>>> Freeswitch. I would hate to continuously scan DB on freeswitch machine
>>> for latest CDR info.
>>>
>>> In a related issue, I read that the only reliable info on "call
>>> length", billsec etc should be read from CDRs.
>>>
>>> I mean, I can't do a getvariable on session in say a Lua script, to
>>> read call length, billsec session variables. Infact I tried it and got
>>> null responses, even after session hangup. Is there a way to get
>>> "correct" values of these variables in the Lua script itself? It would
>>> make my life simpler, because I can then just push the cdr info +
>>> custom values into any queue or webserver, without waiting for the
>>> Freeswitch to do it for me.
>>>
>>> Any Ideas?
>>>
>>>
>>> On Fri, Jul 6, 2012 at 1:18 PM, Avi Marcus <avi at avimarcus.net> wrote:
>>> > xml_cdr by default writes to disk, no web server required. You want to
>>> > skip
>>> > the disk, I presume..?
>>> >
>>> > -Avi
>>> >
>>> >
>>> > On Fri, Jul 6, 2012 at 10:14 AM, Neo Cheema <neo.cheema at gmail.com>
>>> > wrote:
>>> >>
>>> >> João,
>>> >>
>>> >> "Since the socket implemented on mod_zmq is a simple PUB/SUB, yes,
>>> >> messages would be discarded if they are not received by the other
>>> >> end."
>>> >>
>>> >> I thought it didn't matter if the 'worker' was up before the
>>> >> 'producer'/freeswitch started pushing in the messages. 0mq handles
>>> >> that part, if atleast one worker is connected.
>>> >>
>>> >> My main reason for looking towards 0mq was to bypass a webserver,
>>> >> which would be required for xml_cdr.
>>> >>
>>> >> On Fri, Jul 6, 2012 at 8:33 AM, jay binks <jaybinks at gmail.com> wrote:
>>> >> > while we are talking about funky CDR stuff.
>>> >> >
>>> >> > Ive been planning to look at riak ( http://wiki.basho.com/ ) for
>>> >> > bulk
>>> >> > CDR
>>> >> > storage
>>> >> > ( storing data other than billing data ) but just not finding the
>>> >> > time.
>>> >> >
>>> >> > anyone done something similar ?
>>> >> > The idea is to store as much data in a distributed manner, so as to
>>> >> > aid
>>> >> > debugging.
>>> >> > ( not so much for billing )
>>> >> >
>>> >> > Jay
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> > _________________________________________________________________________
>>> >> > Professional FreeSWITCH Consulting Services:
>>> >> > consulting at freeswitch.org
>>> >> > http://www.freeswitchsolutions.com
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> > Official FreeSWITCH Sites
>>> >> > http://www.freeswitch.org
>>> >> > http://wiki.freeswitch.org
>>> >> > http://www.cluecon.com
>>> >> >
>>> >> > Join Us At ClueCon - Aug 7-9, 2012
>>> >> >
>>> >> > 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
>>> >> >
>>> >>
>>> >>
>>> >>
>>> >> _________________________________________________________________________
>>> >> Professional FreeSWITCH Consulting Services:
>>> >> consulting at freeswitch.org
>>> >> http://www.freeswitchsolutions.com
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> Official FreeSWITCH Sites
>>> >> http://www.freeswitch.org
>>> >> http://wiki.freeswitch.org
>>> >> http://www.cluecon.com
>>> >>
>>> >> Join Us At ClueCon - Aug 7-9, 2012
>>> >>
>>> >> 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
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > _________________________________________________________________________
>>> > Professional FreeSWITCH Consulting Services:
>>> > consulting at freeswitch.org
>>> > http://www.freeswitchsolutions.com
>>> >
>>> >
>>> >
>>> >
>>> > Official FreeSWITCH Sites
>>> > http://www.freeswitch.org
>>> > http://wiki.freeswitch.org
>>> > http://www.cluecon.com
>>> >
>>> > Join Us At ClueCon - Aug 7-9, 2012
>>> >
>>> > 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
>>> >
>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>>
>>>
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://wiki.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> Join Us At ClueCon - Aug 7-9, 2012
>>>
>>> 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
>>
>>
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>>
>>
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://wiki.freeswitch.org
>> http://www.cluecon.com
>>
>> Join Us At ClueCon - Aug 7-9, 2012
>>
>> 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
>>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
>
>
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> Join Us At ClueCon - Aug 7-9, 2012
>
> 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
>
>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
>
>
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> Join Us At ClueCon - Aug 7-9, 2012
>
> 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
>
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users
mailing list