[OpenSER-Devel] Accessing exported functions from another module

Ardjan Zwartjes a.zwartjes at telecats.nl
Thu Jul 10 16:49:18 CEST 2008


Hello Henning,

Thanks for your answer.

> You should also  
> use the wrapper "find_export" instead of the "find_cmd_export_t".

That was what I tried at first, only then I figured out that the
parameter types of cmd_export_t functions aren't always what is
specified in cmd_export_t. The textops functions use all kinds of
pv_elem_t's so I wanted to use the fixup functions to generates these
structs and to get the fixup functions I needed find_cmd_export_t. Quite
ugly I know, but I really need these functions.

> For your case "adding a header" i would simple write my own 
> function. 35 LOCs 
> of duplication (e.g. see maxforward:add_maxfwd_header) are 
> IMHO justifiable.

If I was only adding a header I would agree, but I'm using more and more
code from textops. I also remove headers, add parameters to the contact
header and so on. So basically I would have to duplicate the entire
textops module in my module. Perhaps it is a good idea to add an API to
the textops module? If I write a patch for the textops module, what are
the chances of it being included in openser releases?

Kind regards,
Ardjan.



More information about the Devel mailing list