Пример #1
0
static void linphone_remote_provisioning_apply(LinphoneCore *lc, const char *xml) {
	xml2lpc_context *context = xml2lpc_context_new(xml2lpc_callback, lc);
	int result = xml2lpc_set_xml_string(context, xml);
	char * error_msg = NULL;
	if (result == 0) {
		LpConfig * lpc = linphone_core_get_config(lc);
		result = xml2lpc_convert(context, lpc);
		if (result == 0) {
			// if the remote provisioning added a proxy config and none was set before, set it
			if (lp_config_has_section(lpc, "proxy_0") && lp_config_get_int(lpc, "sip", "default_proxy", -1) == -1){
				lp_config_set_int(lpc, "sip", "default_proxy", 0);
			}
			lp_config_sync(lpc);

		} else {
			error_msg = "xml to lpc failed";
		}
	} else {
		error_msg = "invalid xml";
	}

	xml2lpc_context_destroy(context);
	linphone_configuring_terminated(lc
									,error_msg ? LinphoneConfiguringFailed : LinphoneConfiguringSuccessful
									, error_msg);
}
Пример #2
0
void ipphone_iterate(LinphoneCore *lc){
	linphone_core_iterate(lc);
	if (auth_stack.nitems){
		ipphone_auth_final(lc);
	}
	if (lp_config_needs_commit(lc->config)){
		lp_config_sync(lc->config);
		printf("back-up\n");
	}
}