mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 15:29:05 +00:00
Git does not support the ability to replace a token with a version
string during check-in. While it does have support for replacing a
token on clone, this is somewhat sub-optimal: the token is replaced
with the object hash, which is not particularly easy for human
consumption. What's more, in practice, the source file version was often
not terribly useful. Generally, when triaging bugs, the overall version
of Asterisk is far more useful than an individual SVN version of a file. As a
result, this patch removes Asterisk's support for showing source file
versions.
Specifically, it does the following:
* Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
remove passing the version in with the macro. Other facilities
than 'core show file version' make use of the file names, such as
setting a debug level only on a specific file. As such, the act of
registering source files with the Asterisk core still has use. The
macro rename now reflects the new macro purpose.
* main/asterisk:
- Refactor the file_version structure to reflect that it no longer
tracks a version field.
- Remove the "core show file version" CLI command. Without the file
version, it is no longer useful.
- Remove the ast_file_version_find function. The file version is no
longer tracked.
- Rename ast_register_file_version/ast_unregister_file_version to
ast_register_file/ast_unregister_file, respectively.
* main/manager: Remove value from the Version key of the ModuleCheck
Action. The actual key itself has not been removed, as doing so would
absolutely constitute a backwards incompatible change. However, since
the file version is no longer tracked, there is no need to attempt to
include it in the Version key.
* UPGRADE: Add notes for:
- Modification to the ModuleCheck AMI Action
- Removal of the "core show file version" CLI command
Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
117 lines
2.8 KiB
C
117 lines
2.8 KiB
C
/*
|
|
* 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"
|
|
|
|
ASTERISK_REGISTER_FILE()
|
|
|
|
#include "asterisk/global_datastores.h"
|
|
#include "asterisk/linkedlists.h"
|
|
|
|
static void dialed_interface_destroy(void *data)
|
|
{
|
|
struct ast_dialed_interface *di = NULL;
|
|
AST_LIST_HEAD(, ast_dialed_interface) *dialed_interface_list = data;
|
|
|
|
if (!dialed_interface_list) {
|
|
return;
|
|
}
|
|
|
|
AST_LIST_LOCK(dialed_interface_list);
|
|
while ((di = AST_LIST_REMOVE_HEAD(dialed_interface_list, list)))
|
|
ast_free(di);
|
|
AST_LIST_UNLOCK(dialed_interface_list);
|
|
|
|
AST_LIST_HEAD_DESTROY(dialed_interface_list);
|
|
ast_free(dialed_interface_list);
|
|
}
|
|
|
|
static void *dialed_interface_duplicate(void *data)
|
|
{
|
|
struct ast_dialed_interface *di = NULL;
|
|
AST_LIST_HEAD(, ast_dialed_interface) *old_list;
|
|
AST_LIST_HEAD(, ast_dialed_interface) *new_list = NULL;
|
|
|
|
if(!(old_list = data)) {
|
|
return NULL;
|
|
}
|
|
|
|
if(!(new_list = ast_calloc(1, sizeof(*new_list)))) {
|
|
return NULL;
|
|
}
|
|
|
|
AST_LIST_HEAD_INIT(new_list);
|
|
AST_LIST_LOCK(old_list);
|
|
AST_LIST_TRAVERSE(old_list, di, list) {
|
|
struct ast_dialed_interface *di2 = ast_calloc(1, sizeof(*di2) + strlen(di->interface));
|
|
if(!di2) {
|
|
AST_LIST_UNLOCK(old_list);
|
|
dialed_interface_destroy(new_list);
|
|
return NULL;
|
|
}
|
|
strcpy(di2->interface, di->interface);
|
|
AST_LIST_INSERT_TAIL(new_list, di2, list);
|
|
}
|
|
AST_LIST_UNLOCK(old_list);
|
|
|
|
return new_list;
|
|
}
|
|
|
|
const struct ast_datastore_info dialed_interface_info = {
|
|
.type = "dialed-interface",
|
|
.destroy = dialed_interface_destroy,
|
|
.duplicate = dialed_interface_duplicate,
|
|
};
|
|
|
|
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,
|
|
};
|