[OpenSIPS-Devel] some questions about opensips

Bogdan-Andrei Iancu bogdan at voice-system.ro
Thu Sep 10 11:32:47 CEST 2009


徐飞 wrote:
> here i still have some questions, and i appreciate your answering! 
> thanks very much~~
>
> 2009/9/8 Iñaki Baz Castillo <ibc at aliax.net <mailto:ibc at aliax.net>>
>
>     2009/9/8 徐飞 <kudofaye at gmail.com <mailto:kudofaye at gmail.com>>:
>     > Hi Professors:
>     >
>     > Recently I have worked with your project opensips, to develop a
>     system. In
>     > this period, I have encountered some problems...
>     >
>     > 1. How does the project configure file (opensips.cfg) call the
>     functions
>     > which are provided by the project modules. For example, function
>     "save()" is
>     > exported in the module “registerar”, and how can the configure
>     file call
>     > "save("location");". How is it implemented?
>
>     Each module exports functions to be used in the config scripts. Take a
>     look to any module (file "mod_module_name.c" or "module_name.c"). Look
>     for "export_functions" (or similar).
>
> yep, I have already known what you said, while my real intention is 
> that how does the module export functions which can be used by the cfg 
> file? what is the mechanism of it?
each module is compiled as a dynamic library - each module defines a
variable named "module_export" that contains the entire definition of
the module interface (what function and params the module exports, the
init and shoutdown functions, etc).

When the core load the module (as dynamic library) it will search (as
symbol) for the "module_export" variable and learn from there the module
definition.


>
>
>     > 2. I have found that the configure file also called the
>     functions which are
>     > not exported in the project modules, such as
>     "setflag()","setbflag()",
>     > "isbflag()", so this time how can the configure file call them?
>     I am a
>     > little confused....and I do need your help....
>
>     These are core functions, not implemented in modules.
>
> okey, and the same quesion, how could this be implemented, and that is 
> to say how could cfg file call the functions which are defined in the 
> c file. what is the mechanism...
This functions are hardcoded in the LEX/YACC part as definitions (see
cfg.lex and cfg.y). Also see the action.c (do_action() function) to see
how these functions are triggered.

>
>
>     > 3. What is the meaning of the data structure "branch" which is
>     defined in
>     > the "dest.c". What is it used for? Does it have the same meaning
>     of the
>     > "branch" in the SIP protocol?
>
>     Where is that file? I don't find it...
>
> I'am terribly sorry, I have mistaken "dest.c" for "dset.c"... , and 
> actually it is "dset.c".
See my previous email on this thread.

Regards,
Bogdan





More information about the Devel mailing list