[SR-Users] sr-users Digest, Vol 93, Issue 13

kiran bhosale kbhosale at synteltelecom.com
Tue Feb 12 13:43:24 CET 2013


madhumanjusha at integramicro.com wrote:
> 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
>   
>>> sr-users at lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>
>>>
>>>       
>> 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.
>>
>>     
>
>
> On Fri, February 8, 2013 3:36 am, sr-users-request at lists.sip-router.org
> wrote:
>   
>> Send sr-users mailing list submissions to
>> sr-users at lists.sip-router.org
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>> or, via email, send a message with subject or body 'help' to
>> sr-users-request at lists.sip-router.org
>>
>> You can reach the person managing the list at
>> sr-users-owner at lists.sip-router.org
>>
>> 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
>> (madhumanjusha at integramicro.com)
>> 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: madhumanjusha at integramicro.com
>> Subject: [SR-Users] Reg. shared library linking during compiling time
>> To: sr-users at lists.sip-router.org
>> Message-ID:
>> <38400.61.8.152.138.1360306018.squirrel at mail.integramicro.com>
>> 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->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 at 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 & Regards,
>> Manjusha A.
>> Integra Micro Software Services (P) Ltd.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ------------------------------
>>
>>
>> Message: 2
>> Date: Fri, 08 Feb 2013 12:36:36 +0530
>> From: kiran bhosale <kbhosale at synteltelecom.com>
>> Subject: Re: [SR-Users] Reg. shared library linking during compiling
>> time To: "SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
>> Users	Mailing List" <sr-users at lists.sip-router.org>
>> Message-ID: <5114A3FC.9000902 at synteltelecom.com>
>> Content-Type: text/plain; charset=us-ascii; format=flowed
>>
>>
>> madhumanjusha at integramicro.com wrote:
>>     
>>> 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->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 at 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 & Regards,
>>> Manjusha A.
>>> Integra Micro Software Services (P) Ltd.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>> sr-users at lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>
>>>
>>>       
>> 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 <miconda at gmail.com>
>> Subject: Re: [SR-Users] Multiple radius responses on a missed call
>> To: "SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
>> Users	Mailing List" <sr-users at lists.sip-router.org>
>> Message-ID: <5114B6DB.10605 at gmail.com>
>> 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:
>>
>>     
>>> 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: <core> [parser/msg_parser.c:634]: SIP Reply  (status):
>>> 0(5890) DEBUG: <core> [parser/msg_parser.c:636]:  version: <SIP/2.0>
>>> 0(5890) DEBUG: <core> [parser/msg_parser.c:638]:  status:  <486>
>>> 0(5890) DEBUG: <core> [parser/msg_parser.c:640]:  reason:  <Busy here>
>>> 0(5890) DEBUG: <core> [parser/parse_via.c:1286]: Found param type
>>> 232, <branch> = <z9hG4bK8d9c.4438d232.1>; state=6
>>> 0(5890) DEBUG: <core> [parser/parse_via.c:1286]: Found param type
>>> 234, <received> = <192.168.21.101>; state=16
>>> 0(5890) DEBUG: <core> [parser/parse_via.c:2561]: end of header reached,
>>> state=5 0(5890) DEBUG: <core> [parser/msg_parser.c:511]: parse_headers:
>>> Via
>>> found, flags=2 0(5890) DEBUG: <core> [parser/msg_parser.c:513]:
>>> parse_headers: this
>>> is the first via 0(5890) DEBUG: <core> [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: <core>
>>> [parser/parse_via.c:1286]: Found param type
>>> 232, <branch> = <z9hG4bK8d9c.e7b650e1.0>; state=16
>>> 0(5890) DEBUG: <core> [parser/parse_via.c:2561]: end of header reached,
>>> state=5 0(5890) DEBUG: <core> [parser/msg_parser.c:511]: parse_headers:
>>> Via
>>> found, flags=22 0(5890) DEBUG: <core> [parser/msg_parser.c:524]:
>>> parse_headers: this
>>> is the second via 0(5890) DEBUG: <core> [parser/parse_via.c:1286]: Found
>>> param type 232, <branch> = <z9hG4bK463ae086>; state=6
>>> 0(5890) DEBUG: <core> [parser/parse_via.c:1286]: Found param type
>>> 235, <rport> = <5060>; state=16
>>> 0(5890) DEBUG: <core> [parser/parse_via.c:2561]: end of header reached,
>>> state=5 0(5890) DEBUG: <core> [parser/msg_parser.c:511]: parse_headers:
>>> Via
>>> found, flags=22 0(5890) DEBUG: <core> [parser/parse_to.c:178]: DEBUG:
>>> add_param: tag=as493d6134
>>> 0(5890) DEBUG: <core> [parser/parse_to.c:802]: end of header reached,
>>> state=29 0(5890) DEBUG: <core> [parser/msg_parser.c:188]: DEBUG:
>>> get_hdr_field: <To> [42]; uri=[sip:5556003900000 at dr.vm]
>>> 0(5890) DEBUG: <core> [parser/msg_parser.c:190]: DEBUG: to body
>>> [<sip:5556003900000 at dr.vm>]
>>> 0(5890) DEBUG: <core> [parser/msg_parser.c:168]: get_hdr_field: cseq
>>> <CSeq>: <102> <INVITE>
>>> 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: <core> [parser/parse_to.c:178]:
>>> DEBUG: add_param: tag=as5c1d222e
>>> 0(5890) DEBUG: <core> [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 <486>
>>> 0(5890) INFO: <script>: XLOG: 38e422e10af08b2e34d58e5b765e81d3 at dr.vm
>>> [REPLY_TWO] Incoming reply code: 486 0(5890) DEBUG: tm
>>> [t_reply.c:1204]: ->>>>>>>>> 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 at dr.vm;code=486;reason=Busy
>>> here 0(5890) DEBUG: acc [acc.c:872]: missed event for engine: radius
>>> 0(5890) DEBUG: <core> [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]:
>>> SIP_HF_CALLID=38e422e10af08b2e34d58e5b765e81d3 at dr.vm
>>> 0(5890) DEBUG: exec [exec_hf.c:267]:
>>> SIP_HF_CONTACT=<sip:0221028400 at 192.168.21.106>
>>> 0(5890) DEBUG: exec [exec_hf.c:267]: SIP_HF_TO=<sip:5556003900000 at dr.vm>
>>>  0(5890) DEBUG: exec [exec_hf.c:267]: SIP_HF_FROM="Janko"
>>> <sip:0221028400 at dr.vm>;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
>>> sip:3333003900000 at ast-car.vm sip:0221028400 at dr.vm
>>> 38e422e10af08b2e34d58e5b765e81d3 at dr.vm]
>>> sh: /opt/kamrouter/scripts/notify_reroute.sh: not found
>>> 0(5890) INFO: <core> [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 <486>
>>> 0(5890) INFO: <script>: XLOG: 38e422e10af08b2e34d58e5b765e81d3 at dr.vm
>>> [FAIL_TWO] Rerouted gw returned 486 0(5890) INFO: <script>: XLOG:
>>> 38e422e10af08b2e34d58e5b765e81d3 at dr.vm [aaa] VYMAZAVAM3 0(5890) DEBUG:
>>> tm [t_reply.c:1702]: DEBUG: relay_reply: branch=1, save=0, relay=1
>>> 0(5890) DEBUG: <core> [msg_translator.c:1933]:  old size: 572, new
>>> size: 485
>>> 0(5890) DEBUG: <core> [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" <sip:0221028400 at dr.vm>;tag=as5c1d222e
>>> To: <sip:5556003900000 at dr.vm>;tag=as493d6134
>>> Call-ID: 38e422e10af08b2e34d58e5b765e81d3 at dr.vm
>>> 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 -> 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 -> 3
>>> 0(5890) DEBUG: dialog [dlg_handlers.c:1469]: executing event_route 4 on
>>> state 5 0(5890) INFO: <script>: XLOG:
>>> 38e422e10af08b2e34d58e5b765e81d3 at dr.vm
>>> [dialog:failed] Deleting 38e422e10af08b2e34d58e5b765e81d3 at dr.vm from
>>> dialogs and dstprefix_limit 0(5890) DEBUG: dialog [dlg_hash.c:753]: unref
>>> dlg 0x871af3f0 with 1 -> 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 -> 3
>>> 0(5890) DEBUG: dialog [dlg_hash.c:646]: dialog
>>> callid='38e422e10af08b2e34d58e5b765e81d3 at dr.vm' 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"=sip:003900000 at cr1.vm:5060
>>> (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 -> 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 -> 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 -> 2
>>> 0(5890) DEBUG: dialog [dlg_hash.c:753]: unref dlg 0x871af3f0 with 1 -> 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 at 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 at 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
>>> sr-users at lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>       
>> --
>> Daniel-Constantin Mierla - http://www.asipto.com
>> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
>> Kamailio World Conference, April 16-17, 2013, Berlin
>> - http://conference.kamailio.com -
>>
>>
>>
>>
>>
>> ------------------------------
>>
>>
>> Message: 4
>> Date: Fri, 08 Feb 2013 09:36:01 +0100
>> From: Daniel-Constantin Mierla <miconda at gmail.com>
>> Subject: Re: [SR-Users] Reg. shared library linking during compiling
>> time To: "SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
>> Users	Mailing List" <sr-users at lists.sip-router.org>
>> Message-ID: <5114B8F1.8020807 at gmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>>
>> Hello,
>>
>>
>> some guidelines to write a new module are available at: -
>> http://www.asipto.com/pub/kamailio-devel-guide/#c16_devel_new_module
>>
>>
>> Cheers,
>> Daniel
>>
>>
>> On 2/8/13 8:06 AM, kiran bhosale wrote:
>>
>>     
>>> madhumanjusha at integramicro.com wrote:
>>>       
>>>> 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->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 at 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 & Regards,
>>>> Manjusha A.
>>>> Integra Micro Software Services (P) Ltd.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
>>>> list sr-users at lists.sip-router.org
>>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>>
>>>>
>>>>         
>>> 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
>>> sr-users at lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>       
>> --
>> Daniel-Constantin Mierla - http://www.asipto.com
>> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
>> Kamailio World Conference, April 16-17, 2013, Berlin
>> - http://conference.kamailio.com -
>>
>>
>>
>>
>>
>> ------------------------------
>>
>>
>> _______________________________________________
>> sr-users mailing list sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>>
>> 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 
cmd_export_t cmds[] = {
{"source_ip", get_source_ip, 0, 0, 0, REQUEST_ROUTE | FAILURE_ROUTE | 
BRANCH_ROUTE | ANY_ROUTE},
{"syntel_ringing",syntel_ringing, 0, 0, 0, REQUEST_ROUTE | FAILURE_ROUTE 
| BRANCH_ROUTE | ANY_ROUTE},
{"syntel_rewrite_uri", syntel_rewrite_uri, 0, 0, 0, REQUEST_ROUTE | 
FAILURE_ROUTE | BRANCH_ROUTE | ANY_ROUTE},
{"syntel_save", syntel_save, 0, 0, 0, REQUEST_ROUTE | FAILURE_ROUTE | 
BRANCH_ROUTE | ANY_ROUTE},
{"syntel_outgoing_call", syntel_outgoing_call, 0, 0, 0, REQUEST_ROUTE | 
FAILURE_ROUTE | BRANCH_ROUTE | ANY_ROUTE},
{"check_registration_timeout", check_msg, 0, 0, 0, REQUEST_ROUTE | 
FAILURE_ROUTE | BRANCH_ROUTE | ANY_ROUTE},
{0, 0, 0, 0, 0, 0}
};


struct module_exports exports = {
"syntel",
DEFAULT_DLFLAGS, /* dlopen flags */
cmds, /* Exported functions */
0,
0, /* exported statistics */
0, /* exported MI functions NULL */
0, /* exported pseudo-variables */
0, /* extra processes */
mod_init, /* Module initialization function */
0, /* Response function */
mod_destroy, /* Destroy function */
0 /* Child initialization function */
};




for an example
"source_ip" the command to be executed from the conf file
get_source_ip - corresponding function to be executed
0,0,0. - parametersstatic int
syntel_outgoing_call (struct sip_msg *msg, char *foo, char *bar)
{
char user[4];
char final_uri[64];
str uri;
int i = 0;
int j = 0;
int Retval = 0;
get_to_uri (msg);
// parse the location table
strcpy (user, buff);
user[3] = '\0';
LM_DBG ("\n USER in DB =%s \n", user);
for (i=0;i<MAX_EXTENSIONS;i++)
{
if(!strcmp(request_uri[i],user))
break;
}
for (j=0;j<(syntel_database+i)->max_bindings;j++)
{
strcpy (final_uri, "sip:"); // sip
strcat (final_uri,request_uri[i]); // user
strcat (final_uri, "@"); // @
strcat (final_uri, (syntel_database+i)->ip_addr[j]); //ip address
strcat (final_uri, ":"); //colon
strcat (final_uri, "5060"); // port number
LM_ERR ("\n final uri =%s \n", final_uri);
uri.s = final_uri;
uri.len = strlen (final_uri);
if (j == 0)
{
rewrite_uri (msg, &uri);
LM_DBG ("\n rewriteuri =%s \n", uri.s);
}
else
append_branch (msg, &uri, 0, 0, Q_UNSPECIFIED, 0, 0);
LM_DBG ("\n appennded one =%s \n", uri.s);
Retval = 1;
++j;
}
return Retval;
}
to the function
REQUEST_ROUTE,...- the routes it executes from in conf file (in this 
case all routes)

so accordingly prepare functions with the parameters





EXAMPLE


each function will have variable no of parameters with first being 
current SIP message. so prepare all your functions like below and 
initialize the cmds structure

static int
syntel_outgoing_call (struct sip_msg *msg, char *foo, char *bar)
{
char user[4];
char final_uri[64];
str uri;
int i = 0;
int j = 0;
int Retval = 0;
get_to_uri (msg);
// parse the location table
strcpy (user, buff);
user[3] = '\0';
LM_DBG ("\n USER in DB =%s \n", user);
for (i=0;i<MAX_EXTENSIONS;i++)
{
if(!strcmp(request_uri[i],user))
break;
}
for (j=0;j<(syntel_database+i)->max_bindings;j++)
{
strcpy (final_uri, "sip:"); // sip
strcat (final_uri,request_uri[i]); // user
strcat (final_uri, "@"); // @
strcat (final_uri, (syntel_database+i)->ip_addr[j]); //ip address
strcat (final_uri, ":"); //colon
strcat (final_uri, "5060"); // port number
LM_ERR ("\n final uri =%s \n", final_uri);
uri.s = final_uri;
uri.len = strlen (final_uri);
if (j == 0)
{
rewrite_uri (msg, &uri);
LM_DBG ("\n rewriteuri =%s \n", uri.s);
}
else
append_branch (msg, &uri, 0, 0, Q_UNSPECIFIED, 0, 0);
LM_DBG ("\n appennded one =%s \n", uri.s);
Retval = 1;
++j;
}
return Retval;
}








>>  
>
>
> Thanks & Regards,
> Manjusha A.
> Integra Micro Software Services (P) Ltd.
>
>
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130212/4c22102a/attachment-0001.htm>


More information about the sr-users mailing list