memset(data, 0, olen);
c = data;
for (p = indup; p && p < endof_indup && *p; p++) {
+ int global = 0;
vtype = 0;
if (*p == '\\') {
if (*(p + 1) == '$') {
nv = 1;
p++;
+ if (*(p + 1) == '$') {
+ p++;
+ }
} else if (*(p + 1) == '\'') {
p++;
continue;
}
if (*p == '$' && !nv) {
+
+ if (*(p + 1) == '$') {
+ p++;
+ global++;
+ }
+
if (*(p + 1)) {
if (*(p + 1) == '{') {
- vtype = 1;
+ vtype = global ? 3 : 1;
} else {
nv = 1;
}
s++;
- if (vtype == 1 && *s == '{') {
+ if ((vtype == 1 || vtype == 3) && *s == '{') {
br = 1;
s++;
}
vtype = 2;
}
- if (vtype == 1) {
+ if (vtype == 1 || vtype == 3) {
char *expanded = NULL;
int offset = 0;
int ooffset = 0;
idx = atoi(ptr);
}
- if ((sub_val = (char *) switch_channel_get_variable_dup(channel, vname, SWITCH_TRUE, idx))) {
+ if (vtype == 3 || (sub_val = (char *) switch_channel_get_variable_dup(channel, vname, SWITCH_TRUE, idx))) {
if (var_list && !switch_event_check_permission_list(var_list, vname)) {
sub_val = "INVALID";
}
memset(data, 0, olen);
c = data;
for (p = indup; p && p < endof_indup && *p; p++) {
+ int global = 0;
vtype = 0;
if (*p == '\\') {
if (*(p + 1) == '$') {
nv = 1;
p++;
+ if (*(p + 1) == '$') {
+ p++;
+ }
} else if (*(p + 1) == '\'') {
p++;
continue;
}
if (*p == '$' && !nv) {
+ if (*(p + 1) == '$') {
+ p++;
+ global++;
+ }
+
if (*(p + 1)) {
if (*(p + 1) == '{') {
- vtype = 1;
+ vtype = global ? 3 : 1;
} else {
nv = 1;
}
s++;
- if (vtype == 1 && *s == '{') {
+ if ((vtype == 1 || vtype == 3) && *s == '{') {
br = 1;
s++;
}
vtype = 2;
}
- if (vtype == 1) {
+ if (vtype == 1 || vtype == 3) {
char *expanded = NULL;
int offset = 0;
int ooffset = 0;
idx = atoi(ptr);
}
- if (!(sub_val = switch_event_get_header_idx(event, vname, idx))) {
+ if (vtype == 3 || !(sub_val = switch_event_get_header_idx(event, vname, idx))) {
switch_safe_free(gvar);
if ((gvar = switch_core_get_variable_dup(vname))) {
sub_val = gvar;