[Devel] future perl module
Daniel-Constantin Mierla
daniel at voice-system.ro
Fri Nov 17 17:31:11 CET 2006
Hello,
On 11/17/06 16:49, Bastian Friedrich wrote:
> Hi,
>
> unfortunately my OpenSER knowledge and experience is rather limited, so I'd
> need to know what functions exactly you need.
>
the functions will be added as someone needs them, it is no reason to
make all of them available there. At the beginning should be the basic
framework. I will try to get a list with that and post it on the mailing
list for completion.
> Am Dienstag, 14. November 2006 12:12 schrieb Daniel-Constantin Mierla:
>
>> like playing with flags,
>>
>
> setflag(), resetflag() and isflagset() are available now. Constants for FL_*
> have been redefined in Perl.
>
>
>> dst uri
>>
>
> A new package "OpenSER::URI" exists now with functions user(), host(),
> port(), ... - for all string members of sip_uri type. I might add more
> functions for the non-string members. A function getParsedURI in
> OpenSER::Message extracts the RURI.
>
> RURI can be set with "rewrite_ruri", as copied from alias_db.
This is ok for request URI.
> Should I user
> msg_parser's set_dst_uri instead?
>
This should be also available to set the destination URI (the outbound
proxy address).
>
>> , branches, AVPs, sockets...
>>
>
> Can you give me a comprehension of which functions you will need?
>
As said above, I will think to a list of them.
> As for the AVPs: Do you need access to the core functions, or will it be
> sufficient to access the exported avpops module functions only?
>
Perhaps access to core functions is better, since the avpops can be used
from openser config file and most (or all) of the operations can be
implemented in perl language.
> Am Dienstag, 14. November 2006 16:41 schrieb Klaus Darilion:
>
>> IMO Reading/writing AVPs would be very useful.
>>
>
> Dito. :)
>
>
>> Reading pseudo variables would also makes sense.
>>
>
> Done.
>
> I had a lot of difficulties to connect the right xl_* functions. Maybe a much
> simpler convenience function "char *xl_sprintf(struct sip_msg *m, char *fmt)"
> should be defined on a higher level? I have one of those now...
>
That exists more or less, just needs a wrapper. Functions like
avp_printf(), xlog() use something similar, but the fmt is parsed when
OpenSER starts and kept optimized in memory.
> My "pseudoVar" function returns a new string with all contained variables
> substituted by their values. This should be enough to read AVPs, too, right?
>
yes, AVPs are a special class of pseudo-variables.
> Oh, btw: Is it OK to use the str(n)dup functions in the code? It allocates
> it's memory via "malloc()" instead of "pkg_malloc()"...
>
is better to use pkg_* functions to benefit of internal memory manager,
it is no much difference in usage.
Cheers,
Daniel
> Thx,
> Bastian
>
>
More information about the Devel
mailing list