[asterisk-dev] Module to Asterisk function Compiler Issue question

Mike Myhre digium at aeisecure.com
Sat Jul 30 12:53:53 CDT 2011


I am having problems getting a module I am creating to link to a
function I created in a patch to my version of asterisk.
I have declared the function in channels/chan_sip.c as:

typedef void (*sip_reg_tracker_func)(const char *peer, struct
sockaddr_in *sin, int success, const char *reason);
int ast_register_sipregtracker(sip_reg_tracker_func)
attribute_warn_unused_result;
int ast_unregister_sipregtracker(sip_reg_tracker_func)
attribute_warn_unused_result;

When I compile it and do a objdump on it, I get:
00018070 g    DF .text  000000d1  Base        ast_register_sipregtracker
00018150 g    DF .text  000000b6  Base        ast_unregister_sipregtracker

I see that it is in the .text section, not the *UND* section. Since it
isn't a static function, I think this is expected.

When I try to call this function from a module I am creating, I get this
output from the objdump:
00000000      D  *UND*  00000000              ast_register_sipregtracker
00000000      D  *UND*  00000000              ast_unregister_sipregtracker

I think this is why when I try to load my module and it executes the
function, I get the error:
undefined symbol: ast_register_sipregtracker

Where am I going wrong? I see other examples of the same declarations of
other module to asterisk calls that match mine and they appear to all be
in the *UND* section.

Any hints??

     Thanks,

     Mike





More information about the asterisk-dev mailing list