[Home]

Summary:ASTERISK-29540: aelparse: include of context with timings fails
Reporter:Alexander Traud (traud)Labels:patch
Date Opened:2021-08-02 12:21:12Date Closed:2021-08-06 09:04:30
Priority:MinorRegression?
Status:Closed/CompleteComponents:Utilities/aelparse
Versions:16.19.1 18.5.1 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) extensions_include_timings_v13.patch
( 1) extensions_include_timings_v16.patch
Description:The helper utility {{aelparse}} comes with its own parser for the configuration file {{extensions.conf}}. The syntax of that file changed with Asterisk 1.6.0. To be more precise, the use of the character ‘vertical bar’ was changed to the ‘comma’ (see commit [55b1ee2|https://github.com/asterisk/asterisk/commit/55b1ee298e926c594f45456e5afbc25c79e3889b]). With that change also timing information while including a context got changed
{code}
include => tagschaltung|09:00-17:00|mon-fri|*|*

include => tagschaltung|09:00-14:00|sat|*|*
include => anrufbeantworter
{code}
in Asterisk 1.4, had to be changed to commas
{code}
include => tagschaltung,09:00-17:00,mon-fri,*,*

include => tagschaltung,09:00-14:00,sat,*,*
include => anrufbeantworter
{code}
for Asterisk 1.6.0 and later. Otherwise you would get the warning
{code}
pbx.c […] ast_context_verify_includes: Context 'default' tries to include nonexistent context 'tagschaltung|09:00-17:00|mon-fri|*|*'
{code}
So far, so good. However, {{aelparse}} comes with its own parser and that particular change was not duplicated in source file {{utils/extconf.c}}. Commit [27cbfc1|https://github.com/asterisk/asterisk/commit/27cbfc1bd5b0f80de5d5968c8b1965c2252b23c1] fixed that, it ported that change over. Furthermore, it added an optional parameter. For that not the vertical bar is allowed but a comma is *required*. Consequently, the ‘main’ parser allows
{code}
include => tagschaltung,09:00-17:00|mon-fri|*|*,my_timezone
{code}
Actually, commit [27cbfc1|https://github.com/asterisk/asterisk/commit/27cbfc1bd5b0f80de5d5968c8b1965c2252b23c1] ported the changes over to {{aelparse}} but did not fix the separator between the first and second parameter.

Long story short, the attached patch fixes {{aelparse}} to allow the comma, finally. Furthermore, it adds the possibility to use the vertical bar before the last optional parameter (the timezone name) and after the first parameter (the context name), both in {{aelparse}} and the main parser of Asterisk.
Comments:By: Asterisk Team (asteriskteam) 2021-08-02 12:21:15.934-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Kevin Harwell (kharwell) 2021-08-02 12:56:21.180-0500

[~traud] Something you think you might push up to gerrit yourself?

By: Alexander Traud (traud) 2021-08-03 02:58:24.100-0500

Already there: https://gerrit.asterisk.org/16228
Should I do something special to link issue report and code review (like using the ‘review link’ field in the original description) in future?

By: Kevin Harwell (kharwell) 2021-08-03 10:22:55.708-0500

Ah cool thanks!

At the moment the Gerrit->Jira linking script is not functioning, so yeah for now if you'd like you can comment and link them, or use the 'review link' field.

By: Friendly Automation (friendly-automation) 2021-08-06 09:04:31.694-0500

Change 16228 merged by Friendly Automation:
aelparse: Accept an included context with timings.

[https://gerrit.asterisk.org/c/asterisk/+/16228|https://gerrit.asterisk.org/c/asterisk/+/16228]

By: Friendly Automation (friendly-automation) 2021-08-06 09:19:42.276-0500

Change 16246 merged by George Joseph:
aelparse: Accept an included context with timings.

[https://gerrit.asterisk.org/c/asterisk/+/16246|https://gerrit.asterisk.org/c/asterisk/+/16246]

By: Friendly Automation (friendly-automation) 2021-08-06 09:19:54.065-0500

Change 16247 merged by George Joseph:
aelparse: Accept an included context with timings.

[https://gerrit.asterisk.org/c/asterisk/+/16247|https://gerrit.asterisk.org/c/asterisk/+/16247]

By: Friendly Automation (friendly-automation) 2021-08-06 09:20:06.610-0500

Change 16245 merged by George Joseph:
aelparse: Accept an included context with timings.

[https://gerrit.asterisk.org/c/asterisk/+/16245|https://gerrit.asterisk.org/c/asterisk/+/16245]