<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<div class="moz-signature">
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8">
<title></title>
<meta name="GENERATOR" content="OpenOffice.org 2.4  (Linux)">
<style type="text/css">
        <!--
                @page { size: 21cm 29.7cm; margin: 2cm }
                P { margin-bottom: 0.21cm }
        -->
        </style>
<p style="margin-bottom: 0cm;"><font color="#000000">Hi all,</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">I use Kamailio
3.0.0 currently, but I
have a problem with the topoh module.</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">Indeed, I want to
create an exported
function called &laquo;&nbsp;topoh_required&nbsp;&raquo;( so, to be used in the
config file) for this module, I read and execute the instruction of
the devel guide to do this:</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">in topoh_mod.c, I
add or modify:</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">int th_param_mask
= 0;</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">...</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">static
cmd_export_t cmds[] = {</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">
{"topoh_required",
(cmd_function)m_topoh, 1, fixup_uint_null ,
REQUEST_ROUTE|ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE},</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> {0, 0, 0, 0, 0}</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">};</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">...</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">struct
module_exports exports= {</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> "topoh",</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> DEFAULT_DLFLAGS,
/* dlopen flags */</font></p>
<p style="margin-bottom: 0cm;"> <font color="#000000"><b>cmds,
/*added*/</b></font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> params,</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> 0, /* exported
statistics */</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> 0, /* exported MI
functions
*/</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> 0, /* exported
pseudo-variables */</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> 0, /* extra
processes */</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> mod_init, /*
module initialization
function */</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> 0,</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> 0,</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> 0 /* per-child
init function
*/</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">};</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">...</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">static int
m_topoh(struct sip_msg *msg,
char *value)</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">{</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">unsigned int temp
= (unsigned int)
value;</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> if(temp==1)</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> {</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> th_param_mask=1;</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> return 1;</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> }</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> else if (temp==0)</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> {</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> th_param_mask=0;</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> return 0;</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> }</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> else return -1;</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">}</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">I do make module
and make ... no
problem,</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">but when I start
Kamailio with the
function topoh_required(&laquo;&nbsp;1&nbsp;&raquo;); in the config file, it
says:</font></p>
<font color="#000000"><br>
</font>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">Not starting
kamailio: invalid
configuration file!</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"> 0(19524) :
&lt;core&gt; [cfg.y:3329]:
parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line
328, column 20: unknown command, missing loadmodule?</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">ERROR: bad config
file (1 errors)</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">So It doesn't know
the topoh_required
function. But I don't know how to solve this problem.</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">Can somebody help
me please? Thank you
very much for your help.</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000"><br>
</font></p>
<p style="margin-bottom: 0cm;"><font color="#000000">J&eacute;r&ocirc;me</font></p>
<font face="TIMES"><font size="2">
<font color="#000000"><br>
</font><br>
</font></font></div>
</body>
</html>