/* * init module function */ static int mod_init(void) { presence_api_t pres; LM_INFO("initializing...\n"); bind_presence_t bind_presence; bind_presence= (bind_presence_t)find_export("bind_presence", 1,0); if (!bind_presence) { LM_ERR("can't bind presence\n"); return -1; } if (bind_presence(&pres) < 0) { LM_ERR("can't bind pua\n"); return -1; } pres_add_event = pres.add_event; if (pres_add_event == NULL) { LM_ERR("could not import add_event\n"); return -1; } if(callinfo_add_events() < 0) { LM_ERR("failed to add call-info events\n"); return -1; } return 0; }
/* * init module function */ static int mod_init(void) { bind_presence_t bind_presence; LM_INFO("initializing...\n"); /* bind to presence module */ bind_presence= (bind_presence_t)find_export("bind_presence", 1,0); if (!bind_presence) { LM_ERR("can't bind presence\n"); return -1; } if (bind_presence(&pres) < 0) { LM_ERR("can't bind pua\n"); return -1; } if (pres.add_event == NULL) { LM_ERR("could not import add_event\n"); return -1; } if(callinfo_add_events() < 0) { LM_ERR("failed to add call-info events\n"); return -1; } if (no_dialog_support==0) { /* bind to the dialog API */ if (init_dialog_support()<0 ) { LM_ERR("failed to enable the dialog support\n"); return -1; } /* init internal hash table to keep the SCA/lines status */ if ( init_sca_hash(hash_size) < 0 ) { LM_ERR("failed to init hash table for SCA lines\n"); return -1; } } return 0; }