[sr-dev] Forward declaration of SDPOPS functions in my module

Cockhootec Yahrabee cockootec at gmail.com
Fri May 8 16:07:34 CEST 2015


Hi guys,

I found this very useful function in `sdpops` module which I want to use
within my own module but I cannot find out how to forward its declaration
correctly so I can use it in my module.

Since `sdpops` has not defined it's functions within .h file I am just
simply forward declaring function I want to use in my .h file like this:

int sdp_remove_codecs_by_name(sip_msg_t* msg, str* codecs);

And then I just calling it within my function. I can compile it and linker
won't give me any errors but when I am running Kamailio it says that I have
error in config file which is obviously not true because if I comment code
which uses forward declared function kamailio runs without errors.

Kamailio log (when using forwarded declaration of sdpops function):
 0(23096) DEBUG: <core> [route_struct.c:129]: mk_action(): ACTION_#2 #0/2:
3(3)/ 0x1
 0(23096) DEBUG: <core> [route_struct.c:129]: mk_action(): ACTION_#2 #1/2:
3(3)/ 0x1
 0(23096) DEBUG: <core> [route_struct.c:129]: mk_action(): ACTION_#16 #0/3:
22(16)/ 0x7f115fcfa898
 0(23096) DEBUG: <core> [route_struct.c:129]: mk_action(): ACTION_#16 #1/3:
8(8)/ 0x7f115fcfaf98
 0(23096) DEBUG: <core> [route_struct.c:129]: mk_action(): ACTION_#16 #2/3:
0(0)/ 0x7f1100000000
 0(23096) DEBUG: <core> [route.c:129]: route_add(): mapping routing block
(0xa84a40)[MANAGE_FAILURE] to 1
ERROR: bad config file (1 errors)
 0(23096) DEBUG: <core> [ppcfg.c:224]: pp_ifdef_level_check(): same number
of pairing preprocessor directives #!IF[N]DEF - #!ENDIF
 0(23096) DEBUG: tm [t_funcs.c:85]: tm_shutdown(): DEBUG: tm_shutdown :
start
 0(23096) DEBUG: tm [t_funcs.c:88]: tm_shutdown(): DEBUG: tm_shutdown :
emptying hash table
 0(23096) DEBUG: tm [t_funcs.c:90]: tm_shutdown(): DEBUG: tm_shutdown :
removing semaphores
 0(23096) DEBUG: tm [t_funcs.c:92]: tm_shutdown(): DEBUG: tm_shutdown :
destroying tmcb lists
 0(23096) DEBUG: tm [t_funcs.c:95]: tm_shutdown(): DEBUG: tm_shutdown : done
 0(23096) DEBUG: <core> [mem/shm_mem.c:242]: shm_mem_destroy():
shm_mem_destroy
 0(23096) DEBUG: <core> [mem/shm_mem.c:245]: shm_mem_destroy(): destroying
the shared memory lock

Did anybody resolved this issue? All help is appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20150508/d793ef0f/attachment-0001.html>


More information about the sr-dev mailing list