Esempio n. 1
0
/**
 * reregister the Sipcc stack service, without downloading the config file
 *
 */
cc_return_t CCAPI_Service_reregister(int device_handle, const char *device_name,
                                     const char *cfg,
                                     int complete_config)
{
    CCAPP_ERROR("CCAPI_Service_reregister - initiate reregister \n");

    if (is_action_to_be_deferred(RE_REGISTER_ACTION) == TRUE) {
        return CC_SUCCESS;
    }
    if (pending_action_type != NO_ACTION) {
        CCAPP_ERROR("Reset/Restart is pending, reregister Ignored! \n");
        return CC_FAILURE;
    }

    if (is_empty_str((char*)cfg)) {
        CCAPP_ERROR("Reregister request with empty config.  Exiting.\n");
        return CC_FAILURE;
    }

    g_dev_hdl = device_handle;
    strncpy(g_dev_name, device_name, 64);
    strncpy(g_cfg_p, cfg, 256);
    CCAPP_DEBUG("CCAPI_Service_reregister - devce name [%s], cfg [%s] \n", g_dev_name, g_cfg_p);
    g_compl_cfg  = complete_config;

    registration_processEvent(EV_CC_RE_REGISTER);

    return (CC_SUCCESS);
}
Esempio n. 2
0
/**
 * Stop Sipcc stack service
 * @return
 */
cc_return_t CCAPI_Service_stop() {

    CCAPP_ERROR("CCAPI_Service_stop - calling registration stop \n");
    if (is_action_to_be_deferred(STOP_ACTION) == TRUE) {
        return CC_SUCCESS;
    }
    sendResetUpdates  = 0;         // reset to default is not to send updates
    isServiceStartRequestPending = FALSE;
    registration_processEvent(EV_CC_STOP);
    return CC_SUCCESS;
}
Esempio n. 3
0
/**
 * Gracefully unload the Sipcc stack
 * @return
 */
cc_return_t CCAPI_Service_destroy() {
    CCAPP_ERROR("CCAPI_Service_destroy - calling CC_Service_destroy \n");

    if (is_action_to_be_deferred(STOP_ACTION) == TRUE) {
        return CC_SUCCESS;
    }
    // initialize the config to empty
    init_empty_str(g_cfg_p);
    isServiceStartRequestPending = FALSE;
    registration_processEvent(EV_CC_DESTROY);
    return (CC_SUCCESS);
}
Esempio n. 4
0
/**
 * Stop Sipcc stack service
 * @return
 */
cc_return_t CCAPI_Service_stop() {

	int  sdpmode = 0;

    CCAPP_ERROR("CCAPI_Service_stop - calling registration stop");

    config_get_value(CFGID_SDPMODE, &sdpmode, sizeof(sdpmode));
    if (!sdpmode) {
        if (is_action_to_be_deferred(STOP_ACTION) == TRUE) {
            return CC_SUCCESS;
        }
    }
    sendResetUpdates  = 0;         // reset to default is not to send updates
    isServiceStartRequestPending = FALSE;
    registration_processEvent(EV_CC_STOP);
    return CC_SUCCESS;
}