Hi all, i'm trying to write some custom perl module to extend functionalities of openSER.
I can't notify UAC with classic sl_send_reply, in my debug log i found:
ERROR:core:moduleFunc: Module function 'sl_send_reply' is unsafe. Call is refused. ERROR:core:XS_OpenSER__Message_moduleFunction: calling module function 'sl_send_reply' failed. Missing loadmodule?
in my perl script i put a simple: $m->moduleFunction("sl_send_reply", "200", "OK"); as i read in module's example i found in samples/function.pl file.
there's some way to send replyes in perl scripts?
thanks in advance.
k.
Hi,
On Tuesday 19 February 2008, kionez wrote:
I can't notify UAC with classic sl_send_reply, in my debug log i found:
ERROR:core:moduleFunc: Module function 'sl_send_reply' is unsafe. Call is refused. ERROR:core:XS_OpenSER__Message_moduleFunction: calling module function 'sl_send_reply' failed. Missing loadmodule?
in my perl script i put a simple: $m->moduleFunction("sl_send_reply", "200", "OK"); as i read in module's example i found in samples/function.pl file.
I'm dearly sorry that the sample code in the README file was obsoleted by the work that led to sl_send_reply not being available any longer.
The reason for the error message you get is that module functions in some cases execute preprocessing steps (so-called "fixups") that cannot be "undone" by the Perl module. Executing them results in memory leaks; eventually, your OpenSER will run out of memory.
It is possible nonetheless to execute sl_send_reply (and all other functions of the same type) by setting a "hidden" flag (I'll give you a hint in a private mail). Be aware, though, that this will result in a memory leak; you should then restart OpenSER once in a while to release all allocated memory.
there's some way to send replyes in perl scripts?
No other way that I am aware of :(
Fixing the underlying problems has been on the OpenSER "Todo" for quite a while; unfortunatley, things are not that easy...
Bastian