Esempio n. 1
0
/*
 * Initialize OSP module
 * return 0 success, -1 failure
 */
static int ospInitMod(void)
{
    LOG(L_DBG, "osp: ospInitMod\n");

    if (ospVerifyParameters() != 0) {
        /* At least one parameter incorrect -> error */
        return -1;   
    }

    if (ospInitTm() < 0) {
        return -1;
    }

    /* everything is fine, initialization done */
    return 0;
}
Esempio n. 2
0
/*
 * Initialize OSP module
 * return 0 success, -1 failure
 */
static int ospInitMod(void)
{
    bind_auth_t bind_auth;

    LM_INFO("initializing...\n");

    if (ospVerifyParameters() != 0) {
        /* At least one parameter incorrect -> error */
        return -1;
    }

    /* Load the RR API */
    if (load_rr_api(&osp_rr) != 0) {
        LM_WARN("failed to load the RR API. Check if you load the rr module\n");
        LM_WARN("add_rr_param is required for reporting duration for OSP transactions\n");
        memset(&osp_rr, 0, sizeof(osp_rr));
    }

    /* Load the AUTH API */
    bind_auth = (bind_auth_t)find_export("bind_auth", 0);
    if ((bind_auth == NULL) || (bind_auth(&osp_auth) != 0)) {
        LM_WARN("failed to load the AUTH API. Check if you load the auth module.\n");
        LM_WARN("rpid_avp & rpid_avp_type is required for calling number translation\n");
        memset(&osp_auth, 0, sizeof(osp_auth));
    }

    if (ospInitSig() != 0) {
        return -1;
    }

    if (ospInitTm() != 0) {
        return -1;
    }

    if(ospParseAvps() != 0) {
        return -1;
    }

    /* everything is fine, initialization done */
    return 0;
}