[OpenSIPS-Users] load module functions!

Jorge Henrique Pinho jorge-h-pinho at ext.ptinovacao.pt
Wed Aug 1 16:21:36 CEST 2012


Hello,
I create a new module named xcoder_b2b and this module contain a particular function(add_b2b_callID) that is called in another module (b2b_logic).
When i start to run openisps it gives an error.

ERROR:core:sr_load_module: could not open module </lib64/opensips/modules/b2b_logic.so>: /lib64/opensips/modules/b2b_logic.so: undefined symbol: add_b2b_callID

I defined a load.h in my module containing the function that i need to be called from outside my module.

int add_b2b_callID(char * orig_callID, char * b2b_callID, char * b2b_server_callID);
typedef int (*add_b2b_callID_f)(char * orig_callID, char * b2b_callID, char * b2b_server_callID);

struct xcoder_binds {
        add_b2b_callID_f add_b2b_callID;
};

typedef int(*load_xcoder_f)( struct xcoder_binds *xcoder );
int load_xcoder( struct xcoder_binds *xcoder);


static inline int load_xcoder_api( struct xcoder_binds *xcoder )
{
        load_xcoder_f load_xcoder;

        /* import the QOS auto-loading function */
        if ( !(load_xcoder=(load_xcoder_f)find_export("load_xcoder", 0, 0))) {
                LM_ERR("can't import load_xcoder\n");
                return -1;
        }
        /* let the auto-loading function load all QOS stuff */
        if (load_xcoder( xcoder )==-1)
                return -1;

        return 0;
}

also i add this line, to my cmd_export_t array.

{"load_xcoder", (cmd_function)load_xcoder, 0, 0, 0, 0}

int load_xcoder( struct xcoder_binds *xcoder)
{
        xcoder->add_b2b_callID = add_b2b_callID;
        return 1;
}

in mod_init of b2b_logic i call the function load_xcoder_api

what am i doing wrong?

Thanks in advance


Jorge Pinho
Analyst/Developer
Network Platforms and Multimedia Solutions 
Multimedia Division 


More information about the Users mailing list