Thank you Marius,

I do loadmodule "/home/path/to/kamailio/modules/topoh/topoh.so"

and now I have another problem, When it starts, Kamailio says :

-----------------------------------------------------------------------------------------------

Not starting kamailio: invalid configuration file!

 0(19622) : <core> [cfg.y:3329]: parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 328, column 19: Command cannot be used in the block

ERROR: bad config file (1 errors)
----------------------------------------------------------------------------------------------------

I search on google and i find this:

http://www.mail-archive.com/users@lists.kamailio.org/msg07610.html

Is it the same problem for topoh as in this mail with tm ?

thank you

Jérôme

ps:  I check if the m_topoh function is compiled by looking at the symbol table in the topoh.so file

nm -a topoh.so | grep m_topoh
00008c70 t m_topoh

marius zbihlei a écrit :
jerome.marchet@orange-ftgroup.com wrote:

Hi all,


I use Kamailio 3.0.0 currently, but I have a problem with the topoh module.


Indeed, I want to create an exported function called « topoh_required »( so, to be used in the config file) for this module, I read and execute the instruction of the devel guide to do this:


in topoh_mod.c, I add or modify:


int th_param_mask = 0;


...


static cmd_export_t cmds[] = {

{"topoh_required", (cmd_function)m_topoh, 1, fixup_uint_null , REQUEST_ROUTE|ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE},

{0, 0, 0, 0, 0}

};


...


struct module_exports exports= {

"topoh",

DEFAULT_DLFLAGS, /* dlopen flags */

*cmds, /*added*/*

params,

0, /* exported statistics */

0, /* exported MI functions */

0, /* exported pseudo-variables */

0, /* extra processes */

mod_init, /* module initialization function */

0,

0,

0 /* per-child init function */

};


...


static int m_topoh(struct sip_msg *msg, char *value)

{

unsigned int temp = (unsigned int) value;

if(temp==1)

{

th_param_mask=1;

return 1;

}

else if (temp==0)

{

th_param_mask=0;

return 0;

}

else return -1;

}


I do make module and make ... no problem,



Hello Jerome

Have you installed your module? Can you double check that the module loaded from the config is the same as your patched one? You can also use full paths to load module, so I suggest to do a

loadmodule "/home/path/to/kamailio/modules/topoh/topoh.so"

Also check if the m_topoh function is compiled by looking at the symbol table in the topoh.so file

nm -a topoh.so | grep m_topoh should work just fine.

As I look thru your code, I can't see any possible errors. I will look more closely if with these suggestions don't work

Cheers
Marius


but when I start Kamailio with the function topoh_required(« 1 »); in the config file, it says:



Not starting kamailio: invalid configuration file!


0(19524) : <core> [cfg.y:3329]: parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 328, column 20: unknown command, missing loadmodule?


ERROR: bad config file (1 errors)


So It doesn't know the topoh_required function. But I don't know how to solve this problem.


Can somebody help me please? Thank you very much for your help.


Jérôme





--

MARCHET Jerome RD-CORE-LAN
LAN/CORE/M2V
Tel : +33 296052479
Email: jerome.marchet@orange-ftgroup.com
R&D Lannion 2, avenue Pierre Marzin 22307 LANNION Cedex - France


Mailer ThunderBird sous YourDev Linux
Installez simplement votre poste de travail Linux avec http://web2000.rd.francetelecom.fr