コード例 #1
0
ファイル: func_callcompletion.c プロジェクト: cfhb/vlink-cti
static int acf_cc_read(struct ast_channel *chan, const char *name, char *data,
		char *buf, size_t buf_len)
{
	struct ast_cc_config_params *cc_params;
	int res;

	ast_channel_lock(chan);
	if (!(cc_params = ast_channel_get_cc_config_params(chan))) {
		ast_channel_unlock(chan);
		return -1;
	}

	res = ast_cc_get_param(cc_params, data, buf, buf_len);
	ast_channel_unlock(chan);
	return res;
}
コード例 #2
0
static int acf_cc_read(struct ast_channel *chan, const char *name, char *data,
		char *buf, size_t buf_len)
{
	struct ast_cc_config_params *cc_params;
	int res;

	if (!chan) {
		ast_log(LOG_WARNING, "No channel was provided to %s function.\n", name);
		return -1;
	}

	ast_channel_lock(chan);
	if (!(cc_params = ast_channel_get_cc_config_params(chan))) {
		ast_channel_unlock(chan);
		return -1;
	}

	res = ast_cc_get_param(cc_params, data, buf, buf_len);
	ast_channel_unlock(chan);
	return res;
}