[Devel] tm callback called several times

JF jfkavaka at gmail.com
Fri Dec 2 13:33:29 CET 2005


Hi,

I'm trying to write a SER module using TM callbacks, but the callback
is getting called more than one time for each request.
In mod_init function I load the TM API and register the
TMCB_REQUEST_IN for function my_onreq:

static int mod_init(void)
{
        /* load the TM API */
        if (load_tm_api(&tmb)!=0) {
                LOG(L_ERR, "ERROR:mod_init: can't load TM API\n");
                return -1;
        }

        /* register callbacks*/
        /* listen for all incoming requests  */
        if ( tmb.register_tmcb( 0, 0, TMCB_REQUEST_IN, my_onreq, 0 ) <=0 ) {
                LOG(L_ERR,"ERROR:mod_init: cannot register TMCB_REQUEST_IN "
                        "callback\n");
                return -1;
        }
        return 0;
}

static void dlgm_onreq( struct cell* t, int type, struct tmcb_params *ps )
{
        printf("\n\n\n\nCALLBACK FROM TM!!!!!!!!!!\n\n\n");
}


What could be wrong? Or is this the correct behaviour? (I added some
debug to the acc module acc_onreq callback function and it also gets
called several times per request)

Can anyone shed some light on this?

Thank you,

JF



More information about the Devel mailing list