[Kamailio-Users] freeing innername from htable Re: perl module, "pv_sprintf: Memory exhausted!"
Daniel-Constantin Mierla
miconda at gmail.com
Wed Jun 10 09:22:27 CEST 2009
Hello Christian,
On 06/09/2009 04:56 PM, Christian Koch wrote:
> Hello Daniel,
>
> Daniel-Constantin Mierla schrieb:
>> unfortunately you cannot use $sht in this way from perl module. The
>> same limitation that prevent calling any function from modules apply
>> here -- the fixup system used at startup, when string parameters are
>> pre-compiled in different forms to speed up runtime execution.
> So there is no way to access $sht from other moduls (like perl or
> xlog)? It seems to work, but obviously the memory isn't freed :-)
you could access it by adding some sht extensions to the Perl API, same
way as for AVP, but this requires development as well.
From other modules is easier, as one can evaluate the name and then do
search in the hashtable.
>
> What we are trying to do is the following:
> During processing of "INVITE" we need to save some call details
> (source IP, URI, ...) and want to write them to file when the call is
> finished (including duration, ...), while processing BYE or CANCEL, to
> have CDRs. As there are multiple childs of kamailio we tried to save
> the calls details from the INVITE in shared memory using htable (e.g.
> "$sht(a=>$ci::srcip) = $si"), so we can use them while processing the
> BYE (possibly in another child). There we wanted to use perl to be
> able to write the saved details to a file.
> We used the shared memory module as we don´t want to save the infos to
> DB because of performance issues we suspect when using DBs.
>
> But as you mentioned $sht is not supposed to be used in such a way. Do
> you have any idea what else we can do to generate CDRs as mentioned?
> By using other modules for example or a complete other way you may know?
You can use shared memory from perl, see persistence.pl in
modules/perl/doc/samples/
Cheers,
Daniel
>
>>
>> It can be added as a feature request for future. For module functions
>> I added the core support for free fixup functions, but nobody
>> committed to continue the work in perl module.
>>
>> If you want to work on it, I can assist and guide you.
> Well, honestly we are looking for a fast way to implement it.
> How long will it take to implement it with your guidance?
>
> Thanks and regards,
> Christian
>
>
> _______________________________________________
> Kamailio (OpenSER) - Users mailing list
> Users at lists.kamailio.org
> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
> http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
>
--
Daniel-Constantin Mierla
http://www.asipto.com/
More information about the Users
mailing list