Index: main/config.c =================================================================== --- main/config.c (revision 209049) +++ main/config.c (working copy) @@ -717,16 +717,25 @@ } if (do_include || do_exec) { if (c) { + cur = c; /* Strip off leading and trailing "'s and <>'s */ - while((*c == '<') || (*c == '>') || (*c == '\"')) c++; - /* Get rid of leading mess */ - cur = c; - while (!ast_strlen_zero(cur)) { - c = cur + strlen(cur) - 1; - if ((*c == '>') || (*c == '<') || (*c == '\"')) - *c = '\0'; - else - break; + if (*c == '"') { + /* Dequote */ + while (*c) { + if (*c == '"') { + strcpy(c, c + 1); /* SAFE */ + c--; + } else if (*c == '\\') { + strcpy(c, c + 1); /* SAFE */ + } + c++; + } + } else if (*c == '<') { + /* C-style include */ + if (*(c + strlen(c) - 1) == '>') { + cur++; + *(c + strlen(c) - 1) = '\0'; + } } /* #exec We create a tmp file, then we #include it, then we delete it. */ Index: configs/extensions.conf.sample =================================================================== --- configs/extensions.conf.sample (revision 209049) +++ configs/extensions.conf.sample (working copy) @@ -73,6 +73,8 @@ ; that includes contexts within other contexts. The #include command works ; in all asterisk configuration files. ;#include "filename.conf" +;#include +;#include filename.conf ; ; You can execute a program or script that produces config files, and they ; will be inserted where you insert the #exec command. The #exec command @@ -80,6 +82,9 @@ ; activate them within asterisk.conf with the "execincludes" option. They ; are otherwise considered a security risk. ;#exec /opt/bin/build-extra-contexts.sh +;#exec /opt/bin/build-extra-contexts.sh --foo="bar" +;#exec +;#exec "/opt/bin/build-extra-contexts.sh --foo=\"bar\"" ; ; The "Globals" category contains global variables that can be referenced