int prepare () { /* using pre-compiled expressions to speed things up*/ compile_expresions(PORT_REGEX,IP_REGEX); #ifdef DEMO load_tm_f load_tm; fprintf(stdout,"===============NEW RUN================\n"); //register callbacks if (!(load_tm=(load_tm_f)find_export("load_tm",NO_SCRIPT,0))) { printf("Error:FCP:prepare:cannot import load_tm\n"); return -1; } if (load_tm(&tmb)==-1) return -1; if (tmb.register_tmcb(TMCB_REQUEST_OUT, func_invite, 0, 0) <= 0) return -1; #endif return 0; }
int prepare (void) { /* using pre-compiled expressions to speed things up*/ compile_expresions(PORT_REGEX,IP_REGEX); #ifdef DEMO fprintf(stdout,"===============NEW RUN================\n"); /* load the TM API */ if (load_tm_api(&tmb)!=0) { LM_ERR("can't load TM API\n"); return -1; } //register callbacks if (tmb.register_tmcb(TMCB_REQUEST_OUT,func_invite,0) <= 0) return -1; #endif return 0; }