Hello all,<br> I am very new to ser<br> I am using 8.14 version of ser ... I build up ser from source code available from CVS repositry.<br><br>Actually
I wanted to make a simple module for logging of Source name and host
name that passes through ser (just for learning purpose) ...... I build
up the module and placed it in ser's source module directory and
recompiled the source .....Now problem is that when I try to call one
exported function from (
i.e. siplog) from ser.cfg .... It gives me following error message
...... <br><br><br style="text-decoration: underline; color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);"><span style="color: rgb(51, 0, 0);"> 0(12672) parse error (89,8-9): unknown command, missing loadmodule?
</span></span><br><br>when I did ser -dd -c I got following <br><br><br> 0(14407) find_export: <siplog> not found<br> 0(14407) find_export: <siplog> not found<br> 0(14407) parse error (90,9-10): unknown command, missing loadmodule?
<br><br>So I think siplog() is not exported ....... could not find the reason why it is so because I am exporting it ...........<br><br>My source code is following -----<br> <br><br>#include "../../sr_module.h"
<br><br>#include <stdio.h><br><br>char * str_param;<br>int int_param;<br><br>MODULE_VERSION<br><br>static int mod_init(void) ;<br><br>static int siplog(struct sip_msg *msg,char *str,char *str2);<br><br>static int mod_init(void) {
<br> fprintf(stdout,"initializing siplog module");<br> return 0;<br>}<br><br>static cmd_export_t cmds[] = {<br> {"siplog",siplog,1,0,REQUEST<div>_ROUTE},<br> {0,0,0,0,0}<br>
};<br>
<br>struct module_exports exports = {<br> "siplog", /*module name */<br> cmds, /*cmd-name registered by this module */<br> 0,<br> mod_init,<br> 0,<br> 0,
<br> 0,<br> 0<br>};<br><br>static int siplog(struct sip_msg*msg,char*str,char*str2) {<br> /*the basic logic of module goes here*/<br>}<br><br><br><br>My ser.cfg file is as follows---<br><br>#<br># $Id:
ser.cfg,v <a href="http://1.25.2.1/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">1.25.2.1</a> 2005/02/18 14:30:44 andrei Exp $<br>#<br># simple quick-start config script<br>#<br><br># ----------- global configuration parameters ------------------------
<br><br>#debug=3 # debug level (cmd line: -dddddddddd)
<br>#fork=yes<br>#log_stderror=no # (cmd line: -E)<br><br>/* Uncomment these lines to enter debugging mode <br>fork=no<br>log_stderror=yes<br>*/<br><br>check_via=no # (cmd. line: -v)<br>dns=no # (cmd. line: -r)
<br>rev_dns=no # (cmd. line: -R)<br>#port=5060<br>#children=4<br>fifo="/tmp/ser_fifo"<br><br># ------------------ module loading ----------------------------------<br><br># Uncomment this if you want to use SQL database
<br>#loadmodule "/usr/local/lib/ser/modules/mysql.so"<br><br>loadmodule "/usr/local/lib/ser/modules/sl.so"<br>loadmodule "/usr/local/lib/ser/modules/tm.so"<br>loadmodule "/usr/local/lib/ser/modules/rr.so"
<br>loadmodule "/usr/local/lib/ser/modules/maxfwd.so"<br>loadmodule "/usr/local/lib/ser/modules/usrloc.so"<br>loadmodule "/usr/local/lib/ser/modules/registrar.so"<br>loadmodule "/usr/local/lib/ser/modules/textops.so"
<br>loadmodule "/usr/local/lib/ser/modules/print.so"<br># Uncomment this if you want digest authentication<br># mysql.so must be loaded !<br>#loadmodule "/usr/local/lib/ser/modules/auth.so"<br>#loadmodule "/usr/local/lib/ser/modules/auth_db.so"
<br><br>#added by annirudh<br>loadmodule "/usr/local/lib/ser/modules/pa.so"<br><br>#added by shashwat<br>loadmodule "/usr/local/lib/ser/modules/siplog.so"<br><br># ----------------- setting module-specific parameters ---------------
<br><br># -- usrloc params --<br><br>modparam("usrloc", "db_mode", 0)<br><br># Uncomment this if you want to use SQL database <br># for persistent storage and comment the previous line<br>#modparam("usrloc", "db_mode", 2)
<br><br># -- auth params --<br># Uncomment if you are using auth module<br>#<br>#modparam("auth_db", "calculate_ha1", yes)<br>#<br># If you set "calculate_ha1" parameter to yes (which true in this config),
<br># uncomment also the following parameter)<br>#<br>#modparam("auth_db", "password_column", "password")<br><br># -- rr params --<br># add value to ;lr param to make some broken UAs happy<br>
modparam("rr", "enable_full_lr", 1)<br><br># ------------------------- request routing logic -------------------<br><br># main routing logic<br><br>route{<br><br> # initial sanity checks -- messages with
<br> # max_forwards==0, or excessively long requests<br> if (!mf_process_maxfwd_header("10")) {<br> sl_send_reply("483","Too Many Hops");<br> break;<br> };<br> if (msg:len >= 2048 ) {
<br> sl_send_reply("513", "Message too big");<br> break;<br> };<br> print(); <br> siplog(); <br> # we record-route all messages -- to make sure that<br> # subsequent messages will go through our proxy; that's
<br> # particularly good if upstream and downstream entities<br> # use different transport protocol<br> if (!method=="REGISTER") record_route(); <br><br> # subsequent messages withing a dialog should take the
<br> # path determined by record-routing<br> if (loose_route()) {<br> # mark routing logic in request<br> append_hf("P-hint: rr-enforced\r\n"); <br> route(1);<br> break;<br> };
<br><br> if (!uri==myself) {<br> # mark routing logic in request<br> append_hf("P-hint: outbound\r\n"); <br> route(1);<br> break;<br> };<br><br> # if the request is for other domain use UsrLoc
<br> # (in case, it does not work, use the following command<br> # with proper names and addresses in it)<br> if (uri==myself) {<br><br> if (method=="REGISTER") {<br><br># Uncomment this if you want to use digest authentication
<br># if (!www_authorize("<a href="http://iptel.org/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">iptel.org</a>", "subscriber")) {<br># www_challenge("
<a href="http://iptel.org/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">iptel.org</a>", "0");<br>
# break;<br># };<br><br> save("location");<br> break;<br> };<br><br> lookup("aliases");<br> if (!uri==myself) {<br> append_hf("P-hint: outbound alias\r\n");
<br> route(1);<br> break;<br> };<br><br> # native SIP destinations are handled using our USRLOC DB<br> if (!lookup("location")) {<br> sl_send_reply("404", "Not Found");
<br> break;<br> };<br> };<br> append_hf("P-hint: usrloc applied\r\n"); <br> route(1);<br>}<br><br>route[1] <br>{<br> # send it out now; use stateful forwarding as it works reliably
<br>
# even for UDP2TCP<br> if (!t_relay()) {<br> sl_reply_error();<br> };<br>}<br><br><br><br><br>I would be very thankful for any kind of help ....<br>Thanks <br><br><br>-------------------------------------------------------------------------------------------------------------------------------------------------------------
<br>result of nm siplog.so | grep ' T ' --------------------><br>000009ec T _fini<br>00000748 T _init<br><br>result of uname -a ------------> Linux server1.ims 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux
<br><br>reslut of ser -V ------------>flags: STATS:Off, USE_IPV6,
USE_TCP, DISABLE_NAGLE, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT<br>ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
<br>@(#) $Id: main.c,v 1.168.4.3.2.1 2004/10/22 17:21:32 andrei Exp $<br>main.c compiled on 16:06:05 Jun 19 2006 with gcc 3.2</div><br clear="all"><br>-- <br>regards<br> <br>shashwat gupta <br>