convert the final clients of ast_build_string to use ast_str_*()

Now the only module left using it is chan_sip.c



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Luigi Rizzo
2006-12-18 15:38:50 +00:00
parent 684e4dc373
commit ccebf3511c
7 changed files with 24 additions and 20 deletions

View File

@@ -137,7 +137,7 @@ static int serialize_showchan(struct ast_channel *c, char *buf, size_t size)
static int dumpchan_exec(struct ast_channel *chan, void *data)
{
struct ast_module_user *u;
char vars[BUFSIZ * 4];
struct ast_str *vars = ast_str_alloca(BUFSIZ * 4); /* XXX very large! */
char info[1024];
int level = 0;
static char *line = "================================================================================";
@@ -147,10 +147,10 @@ static int dumpchan_exec(struct ast_channel *chan, void *data)
if (!ast_strlen_zero(data))
level = atoi(data);
pbx_builtin_serialize_variables(chan, vars, sizeof(vars));
pbx_builtin_serialize_variables(chan, &vars);
serialize_showchan(chan, info, sizeof(info));
if (option_verbose >= level)
ast_verbose("\nDumping Info For Channel: %s:\n%s\nInfo:\n%s\nVariables:\n%s%s\n", chan->name, line, info, vars, line);
ast_verbose("\nDumping Info For Channel: %s:\n%s\nInfo:\n%s\nVariables:\n%s%s\n", chan->name, line, info, vars->str, line);
ast_module_user_remove(u);

View File

@@ -1565,13 +1565,15 @@ static void do_hang(struct callattempt *o)
static char *vars2manager(struct ast_channel *chan, char *vars, size_t len)
{
char *tmp = alloca(len);
struct ast_str *buf = ast_str_alloca(len + 1);
char *tmp;
if (pbx_builtin_serialize_variables(chan, tmp, len)) {
if (pbx_builtin_serialize_variables(chan, &buf)) {
int i, j;
/* convert "\n" to "\nVariable: " */
strcpy(vars, "Variable: ");
tmp = buf->str;
for (i = 0, j = 10; (i < len - 1) && (j < len - 1); i++, j++) {
vars[j] = tmp[i];