]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
aelparse: Accept an included context with timings.
authorAlexander Traud <pabstraud@compuserve.com>
Mon, 2 Aug 2021 17:33:07 +0000 (19:33 +0200)
committerGeorge Joseph <gjoseph@digium.com>
Fri, 6 Aug 2021 14:20:04 +0000 (09:20 -0500)
With Asterisk 1.6.0, in the main parser for the configuration file
extensions.conf, the separator was changed from vertical bar to comma.
However, the first separator was not changed in aelparse; it still had
to be a vertical bar, and no comma was allowed.

Additionally, this change allows the vertical bar for the first and
last parameter again, even in the main parser, because the vertical bar
was still accepted for the other parameters.

ASTERISK-29540

Change-Id: I882e17c73adf4bf2f20f9046390860d04a9f8d81

main/pbx_include.c
main/pbx_timing.c
utils/extconf.c

index 1bdc39605fecfe1f9c350dc60ac96fc31dd20e60..188bce1ad192b49261943909d9a97ac8ebabfe4b 100644 (file)
@@ -94,7 +94,7 @@ struct ast_include *include_alloc(const char *value, const char *registrar)
        new_include->rname = p;
        strcpy(p, value);
        /* Strip off timing info, and process if it is there */
-       if ((c = strchr(p, ',')) ) {
+       if ( (c = strchr(p, '|')) || (c = strchr(p, ',')) ) {
                *c++ = '\0';
                new_include->hastime = ast_build_timing(&(new_include->timing), c);
        }
index b3ef0891ed8c6e4cb7e9c5bc0042b9b48f90f626..1f76ab81a6eb904923198edbe12b3c2459934cdb 100644 (file)
@@ -217,7 +217,7 @@ int ast_build_timing(struct ast_timing *i, const char *info_in)
 
        /* count the number of fields in the timespec */
        for (j = 0, num_fields = 1; info[j] != '\0'; j++) {
-               if (info[j] == ',') {
+               if (info[j] == '|' || info[j] == ',') {
                        last_sep = j;
                        num_fields++;
                }
index 674f5df47962e04507462cc3f3f18da64bd3240c..afc893c48ff8c6e992e4721c0f3262eec5a070e4 100644 (file)
@@ -3822,7 +3822,7 @@ int ast_build_timing(struct ast_timing *i, const char *info_in)
 
        /* count the number of fields in the timespec */
        for (j = 0, num_fields = 1; info[j] != '\0'; j++) {
-               if (info[j] == ',') {
+               if (info[j] == '|' || info[j] == ',') {
                        last_sep = j;
                        num_fields++;
                }
@@ -4525,7 +4525,7 @@ static int ast_context_add_include2(struct ast_context *con, const char *value,
        new_include->rname = p;
        strcpy(p, value);
        /* Strip off timing info, and process if it is there */
-       if ( (c = strchr(p, '|')) ) {
+       if ( (c = strchr(p, '|')) || (c = strchr(p, ',')) ) {
                *c++ = '\0';
                new_include->hastime = ast_build_timing(&(new_include->timing), c);
        }