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:
Kevin P. Fleming
2006-02-14 23:42:36 +00:00
parent ec7df7e557
commit 124b00c4a4
8 changed files with 17 additions and 8 deletions

6
pbx.c
View File

@@ -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 */