<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=us-ascii" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<a class="moz-txt-link-abbreviated" href="mailto:madhumanjusha@integramicro.com">madhumanjusha@integramicro.com</a> wrote:
<blockquote
 cite="mid:38551.61.8.152.138.1360312992.squirrel@mail.integramicro.com"
 type="cite">
  <pre wrap="">Yes,Yes I did it the way tm and mediaproxy modules are added...
when i check /usr/local/lib/kamailio/modules I found my module and
$stat module
time is effected.



SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap=""><a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>



      </pre>
    </blockquote>
    <pre wrap="">seems that you want to create your custom module. have you checked the
makefile of your module. in order to develop the custom module just copy
the existing module and make relevant changes there. this is genuine way .
for this u need to include makefile.lst ,Makefile in your module. so best
way is to copy the smallest module (e.g.) pdb module and make changes.

    </pre>
  </blockquote>
  <pre wrap=""><!---->

On Fri, February 8, 2013 3:36 am, <a class="moz-txt-link-abbreviated" href="mailto:sr-users-request@lists.sip-router.org">sr-users-request@lists.sip-router.org</a>
wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Send sr-users mailing list submissions to
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>

To subscribe or unsubscribe via the World Wide Web, visit
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
or, via email, send a message with subject or body 'help' to
<a class="moz-txt-link-abbreviated" href="mailto:sr-users-request@lists.sip-router.org">sr-users-request@lists.sip-router.org</a>

You can reach the person managing the list at
<a class="moz-txt-link-abbreviated" href="mailto:sr-users-owner@lists.sip-router.org">sr-users-owner@lists.sip-router.org</a>

When replying, please edit your Subject line so it is more specific
than "Re: Contents of sr-users digest..."


Today's Topics:


1. Reg. shared library linking during compiling time
(<a class="moz-txt-link-abbreviated" href="mailto:madhumanjusha@integramicro.com">madhumanjusha@integramicro.com</a>)
2. Re: Reg. shared library linking during compiling time
(kiran bhosale)
3. Re: Multiple radius responses on a missed call
(Daniel-Constantin Mierla)
4. Re: Reg. shared library linking during compiling time
(Daniel-Constantin Mierla)



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


Message: 1
Date: Fri, 8 Feb 2013 01:46:58 -0500 (EST)
From: <a class="moz-txt-link-abbreviated" href="mailto:madhumanjusha@integramicro.com">madhumanjusha@integramicro.com</a>
Subject: [SR-Users] Reg. shared library linking during compiling time
To: <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
Message-ID:
<a class="moz-txt-link-rfc2396E" href="mailto:38400.61.8.152.138.1360306018.squirrel@mail.integramicro.com">&lt;38400.61.8.152.138.1360306018.squirrel@mail.integramicro.com&gt;</a>
Content-Type: text/plain;charset=iso-8859-1



Hello All,
Please find below steps...and kindly let me know the error solution.


STEP 1::
Under modules I created a directory name b2bentities
/root/kamailio-3.3.2/modules/b2bentities
$ls
b2bentities.so  b2b_server.c  b2b_server.d  b2b_server.h  b2b_server.o
dialog.h  librpath.lst  makecfg.lst  Makefile

In b2b_server.h
#ifndef SERVER_H
#define SERVER_H
#endif


int b2b_dlg_reply();



In b2b_server.c I wrote following code ::


int b2b_dlg_reply() {
LOG(L_INFO,"Hello am in b2bua module\n");
return 0; }


Also,I added below code to the same file as per steps given in kamailio
server's developer's guide. In developer's guide,they told to initialize
parameters as per module's requirement but i made them all empty and
null... for example static int mod_init(void) {
LOG(L_INFO,"IN mod_init\n");
return 0; }


static cmd_export_t commands[] = { };



static param_export_t params[]={ };


struct module_exports exports = { "b2bentities",    // module name
NULL, // dlopen flags
commands,        // exported functions params,      // exported parameters
NULL,            // exported statistics
NULL,            // exported MI functions
NULL,            // exported pseudo-variables
NULL,            // extra processes
mod_init,        // module init function (before fork. kids will inherit)
NULL,            // reply processing function
NULL,            // destroy function
child_init       // child init function };



STEP 2::
In kamailio core
file : In receive.c Method Name : In receive_msg


i did this way...

In receive.c add follow piece of code::


#include "modules/b2bentities/b2b_server.h"


int receive_msg(....) {
/*my code*/
int b2b_ret; int (*ptr)(); ptr= b2b_dlg_reply;
if(msg-&gt;REQ_METHOD!=METHOD_REGISTER) {


b2b_ret=(*ptr)(); if(b2b_ret!=0) {
LOG(L_INFO,"B2B Dialogue reply function failed\n");
exit(1); }
else {
LOG(L_INFO,"B2B Dialogue reply function success\n");
exit(1); }


}



}


STEP 3::
I even added kamailio.cfg  load module "b2bentities.so"




STEP 4::
Final step,when I do make all.....
its giving me the following error :: [root@kamserver kamailio-3.3.2]# make
all CC (gcc) [kamailio]             receive.o
LD (gcc) [kamailio]             kamailio
receive.o: In function `receive_msg':
/root/kamailio-3.3.2/receive.c:163: undefined reference to `b2b_dlg_reply'
 collect2: ld returned 1 exit status
make: *** [kamailio] Error 1




My doubt:
Where should my b2bentities.so should be linked during compiling time?
Please tell me the steps for it.


Thanks &amp; Regards,
Manjusha A.
Integra Micro Software Services (P) Ltd.










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


Message: 2
Date: Fri, 08 Feb 2013 12:36:36 +0530
From: kiran bhosale <a class="moz-txt-link-rfc2396E" href="mailto:kbhosale@synteltelecom.com">&lt;kbhosale@synteltelecom.com&gt;</a>
Subject: Re: [SR-Users] Reg. shared library linking during compiling
time To: "SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
Users        Mailing List" <a class="moz-txt-link-rfc2396E" href="mailto:sr-users@lists.sip-router.org">&lt;sr-users@lists.sip-router.org&gt;</a>
Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:5114A3FC.9000902@synteltelecom.com">&lt;5114A3FC.9000902@synteltelecom.com&gt;</a>
Content-Type: text/plain; charset=us-ascii; format=flowed


<a class="moz-txt-link-abbreviated" href="mailto:madhumanjusha@integramicro.com">madhumanjusha@integramicro.com</a> wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">Hello All,
Please find below steps...and kindly let me know the error solution.


STEP 1::
Under modules I created a directory name b2bentities
/root/kamailio-3.3.2/modules/b2bentities
$ls
b2bentities.so  b2b_server.c  b2b_server.d  b2b_server.h  b2b_server.o
dialog.h  librpath.lst  makecfg.lst  Makefile

In b2b_server.h
#ifndef SERVER_H
#define SERVER_H
#endif


int b2b_dlg_reply();



In b2b_server.c I wrote following code ::


int b2b_dlg_reply() {
LOG(L_INFO,"Hello am in b2bua module\n");
return 0; }


Also,I added below code to the same file as per steps given in kamailio
 server's developer's guide. In developer's guide,they told to
initialize parameters as per module's requirement but i made them all
empty and null... for example static int mod_init(void) {
LOG(L_INFO,"IN mod_init\n");
return 0; }


static cmd_export_t commands[] = { };



static param_export_t params[]={ };


struct module_exports exports = { "b2bentities",    // module name
NULL, // dlopen flags
commands,        // exported functions params,      // exported
parameters NULL,            // exported statistics
NULL,            // exported MI functions
NULL,            // exported pseudo-variables
NULL,            // extra processes
mod_init,        // module init function (before fork. kids will
inherit) NULL,            // reply processing function
NULL,            // destroy function
child_init       // child init function };



STEP 2::
In kamailio core
file : In receive.c Method Name : In receive_msg


i did this way...

In receive.c add follow piece of code::


#include "modules/b2bentities/b2b_server.h"


int receive_msg(....) {
/*my code*/
int b2b_ret; int (*ptr)(); ptr= b2b_dlg_reply;
if(msg-&gt;REQ_METHOD!=METHOD_REGISTER) {


b2b_ret=(*ptr)(); if(b2b_ret!=0) {
LOG(L_INFO,"B2B Dialogue reply function failed\n");
exit(1); }
else {
LOG(L_INFO,"B2B Dialogue reply function success\n");
exit(1); }


}



}


STEP 3::
I even added kamailio.cfg  load module "b2bentities.so"




STEP 4::
Final step,when I do make all.....
its giving me the following error :: [root@kamserver kamailio-3.3.2]#
make all CC (gcc) [kamailio]             receive.o
LD (gcc) [kamailio]             kamailio
receive.o: In function `receive_msg':
/root/kamailio-3.3.2/receive.c:163: undefined reference to
`b2b_dlg_reply'
collect2: ld returned 1 exit status
make: *** [kamailio] Error 1




My doubt:
Where should my b2bentities.so should be linked during compiling time?
Please tell me the steps for it.


Thanks &amp; Regards,
Manjusha A.
Integra Micro Software Services (P) Ltd.








_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>



      </pre>
    </blockquote>
    <pre wrap="">seems that you want to create your custom module. have you checked the
makefile of your module. in order to develop the custom module just copy
the existing module and make relevant changes there. this is genuine way .
for this u need to include makefile.lst ,Makefile in your module. so best
way is to copy the smallest module (e.g.) pdb module and make changes.




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


Message: 3
Date: Fri, 08 Feb 2013 09:27:07 +0100
From: Daniel-Constantin Mierla <a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com">&lt;miconda@gmail.com&gt;</a>
Subject: Re: [SR-Users] Multiple radius responses on a missed call
To: "SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
Users        Mailing List" <a class="moz-txt-link-rfc2396E" href="mailto:sr-users@lists.sip-router.org">&lt;sr-users@lists.sip-router.org&gt;</a>
Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:5114B6DB.10605@gmail.com">&lt;5114B6DB.10605@gmail.com&gt;</a>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed


Hello,


there are different event logged for accounting: - missed call event which
is sent from the point of view of callee - transaction answered which is
sent from the point of view of caller

In db (eg mysql) accounting, each event in stored in a different table.
I don't know how they are in radius. You probably get two missed call
events and one transaction answered.

If you want only one, do not set the flag for missed calls.


Cheers,
Daniel


On 2/7/13 9:23 PM, Efelin Novak wrote:

    </pre>
    <blockquote type="cite">
      <pre wrap="">Hi folks,


I'd like to ask you how can I solve an issue when I'm receiving three
RADIUS requests on one missed call. My scenario is as follows:


A calls to B. B returns 503 error message, INIVITE is then sent to C
and C sends 486.

After first 503 I receive a first RADIUS request. This is correct.


However after 486 I receive three RADIUS requests with different IDs.
As you can see in a DEBUG one RADIUS is send after the SIP reply
message is received and second and third RADIUS messages are sent after
the SIP reply message is forwarded.

I'd like to receive only two RADIUS messages. One after 503 and second
after 486.


FLT_ACC is defined as 1. My config is as follows:
modparam("acc", "failed_transaction_flag", FLT_ACC) modparam("acc",
"report_cancels",     1)
modparam("acc", "report_ack",         0) modparam("acc",
"detect_direction", 0)
modparam("acc", "early_media",        0) modparam("acc", "log_level",
5)
modparam("acc", "log_flag",           1) modparam("acc",
"log_missed_flag",    1)
modparam("acc_radius", "radius_config",
"/etc/radiusclient-ng/radiusclient.conf")          # This is the
location of the configuration file of radius client
modparam("acc_radius", "radius_flag",        FLT_ACC)
modparam("acc_radius", "radius_missed_flag", FLT_ACC)

In a route I set setflag("FLT_ACC") only once per call.


Here is the debug for debug level 7:
0(5890) DEBUG: &lt;core&gt; [parser/msg_parser.c:634]: SIP Reply  (status):
0(5890) DEBUG: &lt;core&gt; [parser/msg_parser.c:636]:  version: &lt;SIP/2.0&gt;
0(5890) DEBUG: &lt;core&gt; [parser/msg_parser.c:638]:  status:  &lt;486&gt;
0(5890) DEBUG: &lt;core&gt; [parser/msg_parser.c:640]:  reason:  &lt;Busy here&gt;
0(5890) DEBUG: &lt;core&gt; [parser/parse_via.c:1286]: Found param type
232, &lt;branch&gt; = &lt;z9hG4bK8d9c.4438d232.1&gt;; state=6
0(5890) DEBUG: &lt;core&gt; [parser/parse_via.c:1286]: Found param type
234, &lt;received&gt; = &lt;192.168.21.101&gt;; state=16
0(5890) DEBUG: &lt;core&gt; [parser/parse_via.c:2561]: end of header reached,
state=5 0(5890) DEBUG: &lt;core&gt; [parser/msg_parser.c:511]: parse_headers:
Via
found, flags=2 0(5890) DEBUG: &lt;core&gt; [parser/msg_parser.c:513]:
parse_headers: this
is the first via 0(5890) DEBUG: &lt;core&gt; [receive.c:149]: After
parse_msg... 0(5890) DEBUG: tm [t_lookup.c:1079]: DEBUG: t_check_msg:
msg id=6 global id=5 T start=0xffffffff 0(5890) DEBUG: &lt;core&gt;
[parser/parse_via.c:1286]: Found param type
232, &lt;branch&gt; = &lt;z9hG4bK8d9c.e7b650e1.0&gt;; state=16
0(5890) DEBUG: &lt;core&gt; [parser/parse_via.c:2561]: end of header reached,
state=5 0(5890) DEBUG: &lt;core&gt; [parser/msg_parser.c:511]: parse_headers:
Via
found, flags=22 0(5890) DEBUG: &lt;core&gt; [parser/msg_parser.c:524]:
parse_headers: this
is the second via 0(5890) DEBUG: &lt;core&gt; [parser/parse_via.c:1286]: Found
param type 232, &lt;branch&gt; = &lt;z9hG4bK463ae086&gt;; state=6
0(5890) DEBUG: &lt;core&gt; [parser/parse_via.c:1286]: Found param type
235, &lt;rport&gt; = &lt;5060&gt;; state=16
0(5890) DEBUG: &lt;core&gt; [parser/parse_via.c:2561]: end of header reached,
state=5 0(5890) DEBUG: &lt;core&gt; [parser/msg_parser.c:511]: parse_headers:
Via
found, flags=22 0(5890) DEBUG: &lt;core&gt; [parser/parse_to.c:178]: DEBUG:
add_param: tag=as493d6134
0(5890) DEBUG: &lt;core&gt; [parser/parse_to.c:802]: end of header reached,
state=29 0(5890) DEBUG: &lt;core&gt; [parser/msg_parser.c:188]: DEBUG:
get_hdr_field: &lt;To&gt; [42]; uri=[<a class="moz-txt-link-freetext" href="sip:5556003900000@dr.vm">sip:5556003900000@dr.vm</a>]
0(5890) DEBUG: &lt;core&gt; [parser/msg_parser.c:190]: DEBUG: to body
[<a class="moz-txt-link-rfc2396E" href="sip:5556003900000@dr.vm">&lt;sip:5556003900000@dr.vm&gt;</a>]
0(5890) DEBUG: &lt;core&gt; [parser/msg_parser.c:168]: get_hdr_field: cseq
&lt;CSeq&gt;: &lt;102&gt; &lt;INVITE&gt;
0(5890) DEBUG: tm [t_lookup.c:965]: DEBUG: t_reply_matching: hash
51672 label 590185284 branch 1
0(5890) DEBUG: tm [t_lookup.c:1016]: DEBUG: t_reply_matching: reply
matched (T=0x871afc98)! 0(5890) DEBUG: tm [t_hooks.c:288]: DBG:
trans=0x871afc98, callback type 2, id 0 entered 0(5890) DEBUG: acc
[acc_logic.c:537]: acc callback called for
t(0x871afc98) event type 2, reply code 486 0(5890) DEBUG: tm
[t_hooks.c:288]: DBG: trans=0x871afc98, callback
type 2, id 0 entered 0(5890) DEBUG: &lt;core&gt; [parser/parse_to.c:178]:
DEBUG: add_param: tag=as5c1d222e
0(5890) DEBUG: &lt;core&gt; [parser/parse_to.c:802]: end of header reached,
state=29 0(5890) DEBUG: siptrace [siptrace.c:794]: storing info...
0(5890) DEBUG: tm [t_lookup.c:1148]: DEBUG: t_check_msg: msg id=6
global id=6 T end=0x871afc98 0(5890) DEBUG: tm [t_reply.c:2081]: DEBUG:
reply_received: org.
status uas=180, uac[1]=180 local=0 is_invite=1) 0(5890) DEBUG: tm
[t_hooks.c:288]: DBG: trans=0x871afc98, callback
type 4194304, id 0 entered 0(5890) DEBUG: siptrace [siptrace.c:794]:
storing info... 0(5890) DEBUG: tm [t_lookup.c:1079]: DEBUG: t_check_msg:
msg id=6 global id=6 T start=0x871afc98 0(5890) DEBUG: tm
[t_lookup.c:1151]: DEBUG: t_check_msg: T already found!
0(5890) DEBUG: tmx [t_var.c:438]: reply code is &lt;486&gt;
0(5890) INFO: &lt;script&gt;: XLOG: <a class="moz-txt-link-abbreviated" href="mailto:38e422e10af08b2e34d58e5b765e81d3@dr.vm">38e422e10af08b2e34d58e5b765e81d3@dr.vm</a>
[REPLY_TWO] Incoming reply code: 486 0(5890) DEBUG: tm
[t_reply.c:1204]: -&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; T_code=180, new_code=486
0(5890) DEBUG: tm [t_hooks.c:288]: DBG: trans=0x871afc98, callback
type 128, id 0 entered 0(5890) DEBUG: acc [acc_logic.c:537]: acc callback
called for t(0x871afc98) event type 128, reply code 486 0(5890) acc
[acc.c:275]: ACC: call missed:
timestamp=1360265692;method=INVITE;from_tag=as5c1d222e;to_tag=as493d6134
;call_id=38e422e10af08b2e34d58e5b765e81d3@dr.vm;code=486;reason=Busy
here 0(5890) DEBUG: acc [acc.c:872]: missed event for engine: radius
0(5890) DEBUG: &lt;core&gt; [md5utils.c:67]: DEBUG: MD5 calculated:
6e1b9f35a8b3e65859e29aefc1c26fc3
0(5890) DEBUG: exec [exec_hf.c:267]: SIP_HF_CONTENT_LENGTH=262
0(5890) DEBUG: exec [exec_hf.c:267]: SIP_HF_CONTENT_TYPE=application/sdp
 0(5890) DEBUG: exec [exec_hf.c:267]: SIP_HF_SUPPORTED=replaces
0(5890) DEBUG: exec [exec_hf.c:267]: SIP_HF_ALLOW=INVITE, ACK,
CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
0(5890) DEBUG: exec [exec_hf.c:267]: SIP_HF_DATE=Thu, 07 Feb 2013
19:35:53 GMT
0(5890) DEBUG: exec [exec_hf.c:267]: SIP_HF_MAX_FORWARDS=68
0(5890) DEBUG: exec [exec_hf.c:267]: SIP_HF_USER_AGENT=Asterisk PBX
0(5890) DEBUG: exec [exec_hf.c:267]: SIP_HF_CSEQ=102 INVITE
0(5890) DEBUG: exec [exec_hf.c:267]:
<a class="moz-txt-link-abbreviated" href="mailto:SIP_HF_CALLID=38e422e10af08b2e34d58e5b765e81d3@dr.vm">SIP_HF_CALLID=38e422e10af08b2e34d58e5b765e81d3@dr.vm</a>
0(5890) DEBUG: exec [exec_hf.c:267]:
SIP_HF_CONTACT=<a class="moz-txt-link-rfc2396E" href="sip:0221028400@192.168.21.106">&lt;sip:0221028400@192.168.21.106&gt;</a>
0(5890) DEBUG: exec [exec_hf.c:267]: SIP_HF_TO=<a class="moz-txt-link-rfc2396E" href="sip:5556003900000@dr.vm">&lt;sip:5556003900000@dr.vm&gt;</a>
 0(5890) DEBUG: exec [exec_hf.c:267]: SIP_HF_FROM="Janko"
<a class="moz-txt-link-rfc2396E" href="sip:0221028400@dr.vm">&lt;sip:0221028400@dr.vm&gt;</a>;tag=as5c1d222e
0(5890) DEBUG: exec [exec_hf.c:267]: SIP_HF_VIA=SIP/2.0/UDP
192.168.21.100;branch=z9hG4bK8d9c.e7b650e1.0,SIP/2.0/UDP
192.168.21.106:5060;branch=z9hG4bK463ae086;rport=5060
0(5890) DEBUG: exec [exec_mod.c:175]: executing
[/opt/kamrouter/scripts/notify_reroute.sh 503
<a class="moz-txt-link-freetext" href="sip:3333003900000@ast-car.vm">sip:3333003900000@ast-car.vm</a> <a class="moz-txt-link-freetext" href="sip:0221028400@dr.vm">sip:0221028400@dr.vm</a>
<a class="moz-txt-link-abbreviated" href="mailto:38e422e10af08b2e34d58e5b765e81d3@dr.vm">38e422e10af08b2e34d58e5b765e81d3@dr.vm</a>]
sh: /opt/kamrouter/scripts/notify_reroute.sh: not found
0(5890) INFO: &lt;core&gt; [main.c:797]: INFO: dont_fork turned on, living on
0(5890) DEBUG: tm [t_lookup.c:1079]: DEBUG: t_check_msg: msg id=0
global id=0 T start=0x871afc98 0(5890) DEBUG: tm [t_lookup.c:1151]:
DEBUG: t_check_msg: T already found!
0(5890) DEBUG: tmx [t_var.c:438]: reply code is &lt;486&gt;
0(5890) INFO: &lt;script&gt;: XLOG: <a class="moz-txt-link-abbreviated" href="mailto:38e422e10af08b2e34d58e5b765e81d3@dr.vm">38e422e10af08b2e34d58e5b765e81d3@dr.vm</a>
[FAIL_TWO] Rerouted gw returned 486 0(5890) INFO: &lt;script&gt;: XLOG:
<a class="moz-txt-link-abbreviated" href="mailto:38e422e10af08b2e34d58e5b765e81d3@dr.vm">38e422e10af08b2e34d58e5b765e81d3@dr.vm</a> [aaa] VYMAZAVAM3 0(5890) DEBUG:
tm [t_reply.c:1702]: DEBUG: relay_reply: branch=1, save=0, relay=1
0(5890) DEBUG: &lt;core&gt; [msg_translator.c:1933]:  old size: 572, new
size: 485
0(5890) DEBUG: &lt;core&gt; [msg_translator.c:1951]:
build_res_from_sip_res: copied size: orig:110, new: 23, rest: 462 msg=
SIP/2.0 486 Busy here
Via: SIP/2.0/UDP 192.168.21.100;branch=z9hG4bK8d9c.e7b650e1.0
Via: SIP/2.0/UDP 192.168.21.106:5060;branch=z9hG4bK463ae086;rport=5060
From: "Janko" <a class="moz-txt-link-rfc2396E" href="sip:0221028400@dr.vm">&lt;sip:0221028400@dr.vm&gt;</a>;tag=as5c1d222e
To: <a class="moz-txt-link-rfc2396E" href="sip:5556003900000@dr.vm">&lt;sip:5556003900000@dr.vm&gt;</a>;tag=as493d6134
Call-ID: <a class="moz-txt-link-abbreviated" href="mailto:38e422e10af08b2e34d58e5b765e81d3@dr.vm">38e422e10af08b2e34d58e5b765e81d3@dr.vm</a>
CSeq: 102 INVITE
Server: Asterisk PBX 11.0.2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0



0(5890) DEBUG: tm [t_hooks.c:288]: DBG: trans=0x871afc98, callback
type 1048576, id 0 entered 0(5890) DEBUG: dialog [dlg_hash.c:588]: ref
dlg 0x871af3f0 with 1 -&gt; 2 0(5890) DEBUG: dialog [dlg_hash.c:590]:
dialog id=3894 found on entry 2825 0(5890) DEBUG: dialog
[dlg_hash.c:940]: dialog 0x871af3f0 changed
from state 2 to state 5, due event 4 (ref 2) 0(5890) DEBUG: dialog
[dlg_hash.c:735]: ref dlg 0x871af3f0 with 1 -&gt; 3
0(5890) DEBUG: dialog [dlg_handlers.c:1469]: executing event_route 4 on
state 5 0(5890) INFO: &lt;script&gt;: XLOG:
<a class="moz-txt-link-abbreviated" href="mailto:38e422e10af08b2e34d58e5b765e81d3@dr.vm">38e422e10af08b2e34d58e5b765e81d3@dr.vm</a>
[dialog:failed] Deleting <a class="moz-txt-link-abbreviated" href="mailto:38e422e10af08b2e34d58e5b765e81d3@dr.vm">38e422e10af08b2e34d58e5b765e81d3@dr.vm</a> from
dialogs and dstprefix_limit 0(5890) DEBUG: dialog [dlg_hash.c:753]: unref
dlg 0x871af3f0 with 1 -&gt; 2 0(5890) DEBUG: dialog [dlg_handlers.c:543]:
dialog 0x871af3f0 failed (negative reply)
0(5890) DEBUG: dialog [dlg_cb.c:256]: dialog=0x871af3f0, type=4
0(5890) DEBUG: dialog [dlg_hash.c:643]: ref dlg 0x871af3f0 with 1 -&gt; 3
0(5890) DEBUG: dialog [dlg_hash.c:646]: dialog
callid='<a class="moz-txt-link-abbreviated" href="mailto:38e422e10af08b2e34d58e5b765e81d3@dr.vm">38e422e10af08b2e34d58e5b765e81d3@dr.vm</a>' found on entry 2825,
dir=1 0(5890) DEBUG: dialog [dlg_var.c:203]: Internal var-list ((nil)):
0(5890) DEBUG: dialog [dlg_var.c:213]: Dialog var-list (0x871af6f8):
0(5890) DEBUG: dialog [dlg_var.c:218]: "ru"=<a class="moz-txt-link-freetext" href="sip:003900000@cr1.vm:5060">sip:003900000@cr1.vm:5060</a>
(flags 1)
0(5890) DEBUG: dialog [dlg_var.c:218]: d=0 (flags 1)
0(5890) DEBUG: dialog [dlg_var.c:218]: et=1360265682.889 (flags 1)
0(5890) DEBUG: dialog [dlg_var.c:218]: st=1360265682.889 (flags 1)
0(5890) DEBUG: dialog [dlg_hash.c:753]: unref dlg 0x871af3f0 with 1 -&gt; 2
 0(5890) acc [acc_cdr.c:192]: st=1360265682.889; et=1360265682.889;
d=0; c1= 0(5890) DEBUG: dialog [dlg_hash.c:753]: unref dlg 0x871af3f0
with 1 -&gt; 1 0(5890) DEBUG: dialog [dlg_handlers.c:937]: registering TMCB
to wait for negative ACK 0(5890) DEBUG: dialog [dlg_hash.c:735]: ref dlg
0x871af3f0 with 1 -&gt; 2
0(5890) DEBUG: dialog [dlg_hash.c:753]: unref dlg 0x871af3f0 with 1 -&gt; 1
 0(5890) DEBUG: tm [t_hooks.c:288]: DBG: trans=0x871afc98, callback
type 512, id 0 entered 0(5890) DEBUG: acc [acc_logic.c:537]: acc callback
called for t(0x871afc98) event type 512, reply code 486 0(5890) acc
[acc.c:275]: ACC: call missed:
timestamp=1360265692;method=INVITE;from_tag=as5c1d222e;to_tag=as493d6134
;call_id=38e422e10af08b2e34d58e5b765e81d3@dr.vm;code=486;reason=Busy
here 0(5890) DEBUG: acc [acc.c:872]: missed event for engine: radius
0(5890) acc [acc.c:275]: ACC: transaction answered:
timestamp=1360265692;method=INVITE;from_tag=as5c1d222e;to_tag=as493d6134
;call_id=38e422e10af08b2e34d58e5b765e81d3@dr.vm;code=486;reason=Busy
here 0(5890) DEBUG: acc [acc.c:867]: acc event for engine: radius
0(5890) DEBUG: tm [t_hooks.c:288]: DBG: trans=0x871afc98, callback
type 8388608, id 0 entered

Thanks for a help.


Efelin


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>

      </pre>
    </blockquote>
    <pre wrap="">--
Daniel-Constantin Mierla - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, April 16-17, 2013, Berlin
- <a class="moz-txt-link-freetext" href="http://conference.kamailio.com">http://conference.kamailio.com</a> -





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


Message: 4
Date: Fri, 08 Feb 2013 09:36:01 +0100
From: Daniel-Constantin Mierla <a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com">&lt;miconda@gmail.com&gt;</a>
Subject: Re: [SR-Users] Reg. shared library linking during compiling
time To: "SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
Users        Mailing List" <a class="moz-txt-link-rfc2396E" href="mailto:sr-users@lists.sip-router.org">&lt;sr-users@lists.sip-router.org&gt;</a>
Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:5114B8F1.8020807@gmail.com">&lt;5114B8F1.8020807@gmail.com&gt;</a>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed


Hello,


some guidelines to write a new module are available at: -
<a class="moz-txt-link-freetext" href="http://www.asipto.com/pub/kamailio-devel-guide/#c16_devel_new_module">http://www.asipto.com/pub/kamailio-devel-guide/#c16_devel_new_module</a>


Cheers,
Daniel


On 2/8/13 8:06 AM, kiran bhosale wrote:

    </pre>
    <blockquote type="cite">
      <pre wrap=""><a class="moz-txt-link-abbreviated" href="mailto:madhumanjusha@integramicro.com">madhumanjusha@integramicro.com</a> wrote:
      </pre>
      <blockquote type="cite">
        <pre wrap="">Hello All,
Please find below steps...and kindly let me know the error solution.


STEP 1::
Under modules I created a directory name b2bentities
/root/kamailio-3.3.2/modules/b2bentities
$ls
b2bentities.so  b2b_server.c  b2b_server.d  b2b_server.h b2b_server.o
dialog.h  librpath.lst  makecfg.lst  Makefile

In b2b_server.h
#ifndef SERVER_H
#define SERVER_H
#endif


int b2b_dlg_reply();



In b2b_server.c I wrote following code ::


int b2b_dlg_reply() {
LOG(L_INFO,"Hello am in b2bua module\n");
return 0; }


Also,I added below code to the same file as per steps given in
kamailio server's developer's guide. In developer's guide,they told to
initialize parameters as per module's requirement but i made them all
empty and null... for example static int mod_init(void) {
LOG(L_INFO,"IN mod_init\n");
return 0; }


static cmd_export_t commands[] = { };



static param_export_t params[]={ };


struct module_exports exports = { "b2bentities",    // module name
NULL, // dlopen flags
commands,        // exported functions params,      // exported
parameters NULL,            // exported statistics
NULL,            // exported MI functions
NULL,            // exported pseudo-variables
NULL,            // extra processes
mod_init,        // module init function (before fork. kids will
inherit) NULL,            // reply processing function
NULL,            // destroy function
child_init       // child init function };



STEP 2::
In kamailio core
file : In receive.c Method Name : In receive_msg


i did this way...

In receive.c add follow piece of code::


#include "modules/b2bentities/b2b_server.h"


int receive_msg(....) {
/*my code*/
int b2b_ret; int (*ptr)(); ptr= b2b_dlg_reply;
if(msg-&gt;REQ_METHOD!=METHOD_REGISTER) {


b2b_ret=(*ptr)(); if(b2b_ret!=0) {
LOG(L_INFO,"B2B Dialogue reply function
failed\n"); exit(1); }
else {
LOG(L_INFO,"B2B Dialogue reply function
success\n"); exit(1); }


}



}


STEP 3::
I even added kamailio.cfg  load module "b2bentities.so"




STEP 4::
Final step,when I do make all.....
its giving me the following error :: [root@kamserver kamailio-3.3.2]#
make all CC (gcc) [kamailio]             receive.o
LD (gcc) [kamailio]             kamailio
receive.o: In function `receive_msg':
/root/kamailio-3.3.2/receive.c:163: undefined reference to
`b2b_dlg_reply'
collect2: ld returned 1 exit status
make: *** [kamailio] Error 1




My doubt:
Where should my b2bentities.so should be linked during compiling time?
 Please tell me the steps for it.


Thanks &amp; Regards,
Manjusha A.
Integra Micro Software Services (P) Ltd.








_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
list <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>


        </pre>
      </blockquote>
      <pre wrap="">seems that you want to create your custom module. have you checked the
makefile of your module. in order to develop the custom module just copy
the existing module and make relevant changes there. this is genuine way
. for this u need to include makefile.lst ,Makefile in
your module. so best way is to copy the smallest module (e.g.) pdb module
and make changes.


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>

      </pre>
    </blockquote>
    <pre wrap="">--
Daniel-Constantin Mierla - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, April 16-17, 2013, Berlin
- <a class="moz-txt-link-freetext" href="http://conference.kamailio.com">http://conference.kamailio.com</a> -





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


_______________________________________________
sr-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>



End of sr-users Digest, Vol 93, Issue 13
****************************************


if  your module is  single file, then  i recommend to copy the pdb module  and checkout how cmd_export_t structure is  created. if you module  doesnt  have  any parmeters  exporeted to/imported from the config file , then task becomes more  simpler. just to give an example , i have  pasted  sample code please  check through and make changes </pre>
  </blockquote>
</blockquote>
&nbsp; cmd_export_t cmds[] = {<br>
&nbsp; {"source_ip", get_source_ip, 0, 0, 0,&nbsp; REQUEST_ROUTE | FAILURE_ROUTE
| BRANCH_ROUTE | ANY_ROUTE},<br>
&nbsp; {"syntel_ringing",syntel_ringing, 0, 0, 0, REQUEST_ROUTE |
FAILURE_ROUTE | BRANCH_ROUTE | ANY_ROUTE},<br>
&nbsp; {"syntel_rewrite_uri", syntel_rewrite_uri, 0, 0, 0, REQUEST_ROUTE |
FAILURE_ROUTE | BRANCH_ROUTE | ANY_ROUTE},<br>
&nbsp; {"syntel_save", syntel_save, 0, 0, 0, REQUEST_ROUTE | FAILURE_ROUTE |
BRANCH_ROUTE | ANY_ROUTE},<br>
&nbsp; {"syntel_outgoing_call", syntel_outgoing_call, 0, 0, 0, REQUEST_ROUTE
| FAILURE_ROUTE | BRANCH_ROUTE | ANY_ROUTE},<br>
&nbsp; {"check_registration_timeout", check_msg, 0, 0, 0, REQUEST_ROUTE |
FAILURE_ROUTE | BRANCH_ROUTE | ANY_ROUTE},<br>
&nbsp; {0, 0, 0, 0, 0, 0}<br>
};<br>
<br>
<br>
struct module_exports exports = {<br>
&nbsp; "syntel",<br>
&nbsp; DEFAULT_DLFLAGS,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /* dlopen flags */<br>
&nbsp; cmds,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /* Exported functions */<br>
&nbsp; 0,<br>
&nbsp; 0,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /* exported statistics */<br>
&nbsp; 0,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /* exported MI functions NULL */<br>
&nbsp; 0,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /* exported pseudo-variables */<br>
&nbsp; 0,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /* extra processes */<br>
&nbsp; mod_init,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /* Module initialization function */<br>
&nbsp; 0,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /* Response function */<br>
&nbsp; mod_destroy,&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /* Destroy function */<br>
&nbsp; 0&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /* Child initialization function */<br>
};<br>
&nbsp;&nbsp; <br>
<br>
<br>
<br>
for an example <br>
&nbsp;"source_ip" the command&nbsp; to be executed from the conf file <br>
&nbsp;get_source_ip - corresponding function to be executed<br>
0,0,0. - parametersstatic int<br>
syntel_outgoing_call (struct sip_msg *msg, char *foo, char *bar)<br>
{<br>
&nbsp; char user[4];<br>
&nbsp; char final_uri[64];<br>
&nbsp; str uri;<br>
&nbsp; int i = 0;<br>
&nbsp; int j = 0;<br>
&nbsp; int Retval = 0;<br>
&nbsp; get_to_uri (msg);<br>
&nbsp; // parse&nbsp; the location table<br>
&nbsp; strcpy (user, buff);<br>
&nbsp; user[3] = '\0';<br>
&nbsp; LM_DBG ("\n&nbsp; USER in DB&nbsp; =%s&nbsp; \n", user);<br>
&nbsp;&nbsp;&nbsp; &nbsp;for (i=0;i&lt;MAX_EXTENSIONS;i++)<br>
&nbsp;&nbsp;&nbsp; &nbsp;{<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; if(!strcmp(request_uri[i],user))<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; break;<br>
&nbsp;&nbsp;&nbsp; &nbsp;}<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (j=0;j&lt;(syntel_database+i)-&gt;max_bindings;j++)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br>
&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; strcpy (final_uri, "sip:");&nbsp; //&nbsp; sip <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;strcat (final_uri,request_uri[i]); //&nbsp; user <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;strcat (final_uri, "@");&nbsp; // @<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;strcat (final_uri,
(syntel_database+i)-&gt;ip_addr[j]);&nbsp; //ip address<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;strcat (final_uri, ":");&nbsp;&nbsp; &nbsp; //colon <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;strcat (final_uri, "5060"); //&nbsp; port number &nbsp;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;LM_ERR ("\n final uri&nbsp; =%s&nbsp; \n", final_uri);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;uri.s = final_uri;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;uri.len = strlen (final_uri);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if (j == 0)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;rewrite_uri (msg, &amp;uri);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;LM_DBG ("\n rewriteuri&nbsp; =%s&nbsp; \n", uri.s);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;append_branch (msg, &amp;uri, 0, 0,
Q_UNSPECIFIED, 0, 0);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;LM_DBG ("\n appennded one&nbsp;&nbsp; =%s&nbsp; \n", uri.s);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Retval = 1;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;++j;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>
&nbsp;&nbsp;&nbsp; return Retval;<br>
}<br>
&nbsp;to the function <br>
REQUEST_ROUTE,...-&nbsp; the routes&nbsp; it executes&nbsp; from in conf file (in
this&nbsp; case&nbsp; all routes)<br>
<br>
so accordingly prepare&nbsp; functions with&nbsp; the parameters <br>
<br>
<br>
<br>
<br>
<br>
EXAMPLE <br>
<br>
<br>
each function will have variable no of parameters with first&nbsp; being&nbsp;
current&nbsp; SIP message. so prepare all your functions&nbsp; like below and
initialize&nbsp; the&nbsp; cmds structure <br>
<br>
static int<br>
syntel_outgoing_call (struct sip_msg *msg, char *foo, char *bar)<br>
{<br>
&nbsp; char user[4];<br>
&nbsp; char final_uri[64];<br>
&nbsp; str uri;<br>
&nbsp; int i = 0;<br>
&nbsp; int j = 0;<br>
&nbsp; int Retval = 0;<br>
&nbsp; get_to_uri (msg);<br>
&nbsp; // parse&nbsp; the location table<br>
&nbsp; strcpy (user, buff);<br>
&nbsp; user[3] = '\0';<br>
&nbsp; LM_DBG ("\n&nbsp; USER in DB&nbsp; =%s&nbsp; \n", user);<br>
&nbsp;&nbsp;&nbsp; &nbsp;for (i=0;i&lt;MAX_EXTENSIONS;i++)<br>
&nbsp;&nbsp;&nbsp; &nbsp;{<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(!strcmp(request_uri[i],user))<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;break;<br>
&nbsp;&nbsp;&nbsp; &nbsp;}<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (j=0;j&lt;(syntel_database+i)-&gt;max_bindings;j++)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; strcpy (final_uri, "sip:");&nbsp; //&nbsp; sip <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strcat (final_uri,request_uri[i]); //&nbsp; user <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strcat (final_uri, "@");&nbsp; // @<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strcat (final_uri,
(syntel_database+i)-&gt;ip_addr[j]);&nbsp; //ip address<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strcat (final_uri, ":");&nbsp;&nbsp;&nbsp; &nbsp;//colon <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strcat (final_uri, "5060"); //&nbsp; port number&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; LM_ERR ("\n final uri&nbsp; =%s&nbsp; \n", final_uri);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; uri.s = final_uri;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; uri.len = strlen (final_uri);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (j == 0)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rewrite_uri (msg, &amp;uri);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; LM_DBG ("\n rewriteuri&nbsp; =%s&nbsp; \n", uri.s);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; append_branch (msg, &amp;uri, 0, 0,
Q_UNSPECIFIED, 0, 0);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; LM_DBG ("\n appennded one&nbsp;&nbsp; =%s&nbsp; \n", uri.s);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Retval = 1;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ++j;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; return Retval;<br>
}<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<blockquote
 cite="mid:38551.61.8.152.138.1360312992.squirrel@mail.integramicro.com"
 type="cite">
  <blockquote type="cite">
    <pre wrap=""> </pre>
  </blockquote>
</blockquote>
<blockquote
 cite="mid:38551.61.8.152.138.1360312992.squirrel@mail.integramicro.com"
 type="cite">
  <pre wrap=""><!---->

Thanks &amp; Regards,
Manjusha A.
Integra Micro Software Services (P) Ltd.





_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>

  </pre>
</blockquote>
<br>
</body>
</html>