Debian Codegraph @

main/global_datastores.c

raw symbols SCIP
1 /*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 1999 - 2007, Digium, Inc.
5 *
6 * Mark Michelson <[email protected]>
7 *
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
13 *
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
17 */
18
19 /*! \file
20 *
21 * \brief globally-accessible datastore information and callbacks
22 *
23 * \author Mark Michelson <[email protected]>
24 */
25
26 /*** MODULEINFO
27 <support_level>core</support_level>
28 ***/
29
30 #include "asterisk.h"
31
32 #include "asterisk/global_datastores.h"
33
34 static void secure_call_store_destroy(void *data)
35 {
36 struct ast_secure_call_store *store = data;
37
38 ast_free(store);
39 }
40
41 static void *secure_call_store_duplicate(void *data)
42 {
43 struct ast_secure_call_store *old = data;
44 struct ast_secure_call_store *new;
45
46 if (!(new = ast_calloc(1, sizeof(*new)))) {
47 return NULL;
48 }
49 new->signaling = old->signaling;
50 new->media = old->media;
51
52 return new;
53 }
54 const struct ast_datastore_info secure_call_info = {
55 .type = "encrypt-call",
56 .destroy = secure_call_store_destroy,
57 .duplicate = secure_call_store_duplicate,
58 };