mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-27 08:36:07 +00:00
add 'systemname' option to prefix channel unique IDs with (issue #5825)
convert chan->uniqueid to a stringfield from a fixed-size buffer git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
6
pbx.c
6
pbx.c
@@ -890,7 +890,7 @@ static char *substring(const char *value, int offset, int length, char *workspac
|
||||
void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, char *workspace, int workspacelen, struct varshead *headp)
|
||||
{
|
||||
const char not_found = '\0';
|
||||
char tmpvar[80];
|
||||
char *tmpvar;
|
||||
const char *s; /* the result */
|
||||
int offset, length;
|
||||
int i, need_substring;
|
||||
@@ -904,7 +904,7 @@ void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, c
|
||||
* Then if called directly, we might need to run substring() on the result;
|
||||
* remember this for later in 'need_substring', 'offset' and 'length'
|
||||
*/
|
||||
ast_copy_string(tmpvar, var, sizeof(tmpvar)); /* parse_variable_name modifies the string */
|
||||
tmpvar = ast_strdupa(var); /* parse_variable_name modifies the string */
|
||||
need_substring = parse_variable_name(tmpvar, &offset, &length, &i /* ignored */);
|
||||
|
||||
/*
|
||||
@@ -960,6 +960,8 @@ void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, c
|
||||
if (!strcmp(var, "EPOCH")) {
|
||||
snprintf(workspace, workspacelen, "%u",(int)time(NULL));
|
||||
s = workspace;
|
||||
} else if (!strcmp(var, "SYSTEMNAME")) {
|
||||
ast_copy_string(workspace, ast_config_AST_SYSTEM_NAME, workspacelen);
|
||||
}
|
||||
}
|
||||
/* if not found, look into chanvars or global vars */
|
||||
|
Reference in New Issue
Block a user