コード例 #1
0
ファイル: ccapi_service.c プロジェクト: emannion/ikran
/**
 * Pre-initialize the Sipcc stack.
 * @return
 */
cc_return_t CCAPI_Service_create() {
    CCAPP_ERROR("CCAPI_Service_create - calling CC_Service_create \n");

    registration_processEvent(EV_CC_CREATE);
    return (CC_SUCCESS);
    //return (service_processEvent(EV_SRVC_CREATE));
}
コード例 #2
0
ファイル: ccapi_service.c プロジェクト: emannion/ikran
/**
 * 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);
}
コード例 #3
0
ファイル: ccapi_service.c プロジェクト: emannion/ikran
/**
 * 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;
}
コード例 #4
0
ファイル: ccapi_service.c プロジェクト: emannion/ikran
/**
 * 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);
}
コード例 #5
0
ファイル: ccapi_service.c プロジェクト: emannion/ikran
/**
 * Bring up the Sipcc stack in service
 * @return
 */
cc_return_t CCAPI_Service_start() {

    if (isServiceStartRequestPending == TRUE) {
        DEF_DEBUG("CCAPI_Service_start request is already pending. Ignoring this.\n");
        return CC_SUCCESS;
    }

    DEF_DEBUG("CCAPI_Service_start - \n");
    isServiceStartRequestPending = TRUE;

    registration_processEvent(EV_CC_START);

    return (CC_SUCCESS);
}
コード例 #6
0
ファイル: ccapi_service.c プロジェクト: Andrel322/gecko-dev
/**
 * 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;
}
コード例 #7
0
ファイル: ccapi_config.c プロジェクト: Andrel322/gecko-dev
void CCAPI_Start_response(int device_handle, const char *device_name, const char *sipUser, const char *sipPassword, const char *sipDomain) {
    static const char fname[] = "CCAPI_Start_response";

    if (is_empty_str((char*)sipUser) || is_empty_str((char*)sipDomain)) {
        CCAPP_ERROR(DEB_F_PREFIX" invalid registration details user=%s, domain=%s", DEB_F_PREFIX_ARGS(CC_API, fname), sipUser, sipDomain);
        return;
    }

    g_dev_hdl = device_handle;
    sstrncpy(g_dev_name, device_name, sizeof(g_dev_name));

    if (is_phone_registered() == FALSE) {

        if (parse_setup_properties(device_handle, device_name, sipUser, sipPassword, sipDomain)) {
            registration_processEvent(EV_CC_CONFIG_RECEIVED);
        }
        return;
    }

 }