summaryrefslogtreecommitdiff
path: root/main/global_datastores.c
blob: 521106defe3bf1075febf124e03341ee579e155f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * Asterisk -- An open source telephony toolkit.
 *
 * Copyright (C) 1999 - 2007, Digium, Inc.
 *
 * Mark Michelson <mmichelson@digium.com>
 *
 * See http://www.asterisk.org for more information about
 * the Asterisk project. Please do not directly contact
 * any of the maintainers of this project for assistance;
 * the project provides a web site, mailing lists and IRC
 * channels for your use.
 *
 * This program is free software, distributed under the terms of
 * the GNU General Public License Version 2. See the LICENSE file
 * at the top of the source tree.
 */

/*! \file
 *
 * \brief globally-accessible datastore information and callbacks
 *
 * \author Mark Michelson <mmichelson@digium.com>
 */

/*** MODULEINFO
	<support_level>core</support_level>
 ***/

#include "asterisk.h"

#include "asterisk/global_datastores.h"

static void secure_call_store_destroy(void *data)
{
	struct ast_secure_call_store *store = data;

	ast_free(store);
}

static void *secure_call_store_duplicate(void *data)
{
	struct ast_secure_call_store *old = data;
	struct ast_secure_call_store *new;

	if (!(new = ast_calloc(1, sizeof(*new)))) {
		return NULL;
	}
	new->signaling = old->signaling;
	new->media = old->media;

	return new;
}
const struct ast_datastore_info secure_call_info = {
	.type = "encrypt-call",
	.destroy = secure_call_store_destroy,
	.duplicate = secure_call_store_duplicate,
};