[Devel] Re: tm callback called several times
JF
jfkavaka at gmail.com
Sat Dec 3 11:25:08 CET 2005
I found the problem: I was relaying the request to myself from the script.
JF
On 12/2/05, JF <jfkavaka at gmail.com> wrote:
> 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