aboutsummaryrefslogtreecommitdiffstats
path: root/manager.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-08 02:11:42 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-08 02:11:42 +0000
commit55d241bdd360054c5c5213bbfc195a62087b4102 (patch)
treed56e38975d34d7f781adc8390fd2776d299fd436 /manager.c
parentdf706a8900728f959c8f227580fe45227495fb81 (diff)
issue #5585
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7012 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'manager.c')
-rwxr-xr-xmanager.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/manager.c b/manager.c
index f0f7a8752..1f38db260 100755
--- a/manager.c
+++ b/manager.c
@@ -309,26 +309,34 @@ char *astman_get_header(struct message *m, char *var)
struct ast_variable *astman_get_variables(struct message *m)
{
- int varlen, x;
+ int varlen, x, y;
struct ast_variable *head = NULL, *cur;
char *var, *val;
+ unsigned int var_count;
+ char *vars[32];
varlen = strlen("Variable: ");
for (x = 0; x < m->hdrcount; x++) {
- if (!strncasecmp("Variable: ", m->headers[x], varlen)) {
- var = val = ast_strdupa(m->headers[x] + varlen);
- if (!var)
- return head;
- strsep(&val, "=");
- if (!val || ast_strlen_zero(var))
- continue;
- cur = ast_variable_new(var, val);
- if (head) {
- cur->next = head;
- head = cur;
- } else
- head = cur;
+ if (strncasecmp("Variable: ", m->headers[x], varlen))
+ continue;
+
+ if (!(var = ast_strdupa(m->headers[x] + varlen)))
+ return head;
+
+ if ((var_count = ast_app_separate_args(var, '|', vars, sizeof(vars) / sizeof(var[0])))) {
+ for (y = 0; y < var_count; y++) {
+ var = val = vars[y];
+ strsep(&val, "=");
+ if (!val || ast_strlen_zero(var))
+ continue;
+ cur = ast_variable_new(var, val);
+ if (head) {
+ cur->next = head;
+ head = cur;
+ } else
+ head = cur;
+ }
}
}