Пример #1
0
static int linphone_remote_provisioning_load_file( LinphoneCore* lc, const char* file_path){
	int status = -1;
	FILE* f = fopen(file_path, "r");

	if( f ){
		long fsize;
		char* provisioning;

		fseek(f, 0, SEEK_END);
		fsize = ftell(f);
		fseek(f, 0, SEEK_SET);

		provisioning = ms_malloc(fsize + 1);
		provisioning[fsize]='\0';
		if (fread(provisioning, fsize, 1, f)==0){
			ms_error("Could not read xml provisioning file from %s",file_path);
			status=-1;
		}else{
			linphone_remote_provisioning_apply(lc, provisioning);
			status = 0;
		}
		ms_free(provisioning);
		fclose(f);
	} else {
		ms_error("Couldn't open file %s for provisioning", file_path);
	}

	return status;
}
Пример #2
0
static void belle_request_process_response_event(void *ctx, const belle_http_response_event_t *event) {
	LinphoneCore *lc = (LinphoneCore *)ctx;
	belle_sip_message_t *message = BELLE_SIP_MESSAGE(event->response);
	const char *body = belle_sip_message_get_body(message);

	if (belle_http_response_get_status_code(event->response) == 200) {
		linphone_remote_provisioning_apply(lc, body);
	} else {
		linphone_configuring_terminated(lc, LinphoneConfiguringFailed, "http error");
	}
}
Пример #3
0
int linphone_remote_provisioning_load_file( LinphoneCore* lc, const char* file_path){
	int status = -1;
	char* provisioning=load_file_content(file_path);

	if (provisioning){
		linphone_remote_provisioning_apply(lc, provisioning);
		status = 0;
		ms_free(provisioning);
	}
	return status;
}