[Home]

Summary:ASTERISK-29317: pbx_spool: Call file comments using '#' can not be escaped
Reporter:N A (InterLinked)Labels:
Date Opened:2021-02-26 18:12:46.000-0600Date Closed:2021-03-01 08:58:11.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:PBX/pbx_spool
Versions:18.2.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Debian 10Attachments:
Description:Very minor bug (probably easy to fix) that I noticed today:

When creating a call file, the Asterisk call file spool processor does not recognize all valid dialplan extensions as extensions. For instance, it does not recognize # as a valid extension. This prevents some dialplan extensions from being accessible through call files.

[Feb 26 19:04:07]     -- Executing [s@regeneratecall:1] System("Local/#@connect-0000028f;2", "echo Channel: Local/16143842472755@carrierbridgeaccess >> /tmp/1614384247.2755.call") in new stack
[Feb 26 19:04:07]     -- Executing [s@regeneratecall:2] System("Local/#@connect-0000028f;2", "echo Context: onward >> /tmp/1614384247.2755.call") in new stack
[Feb 26 19:04:07]     -- Executing [s@regeneratecall:3] System("Local/#@connect-0000028f;2", "echo Extension: # >> /tmp/1614384247.2755.call") in new stack
[Feb 26 19:04:07]     -- Executing [s@regeneratecall:4] System("Local/#@connect-0000028f;2", "echo Priority: 1 >> /tmp/1614384247.2755.call") in new stack
....
[Feb 26 19:04:07]     -- Executing [s@regeneratecall:16] System("Local/#@connect-0000028f;2", "mv /tmp/1614384247.2755.call /var/spool/asterisk/outgoing/") in new stack
[2021-02-26 19:04:07] WARNING[20336]: pbx_spool.c:327 apply_outgoing: At least one of app or extension must be specified, along with tech and dest in file /var/spool/asterisk/outgoing/1614384247.2755.call
[2021-02-26 19:04:07] WARNING[20336]: pbx_spool.c:517 scan_service: Invalid file contents in /var/spool/asterisk/outgoing/1614384247.2755.call, deleting

This works correctly with more "typical" (numeric) extensions. *6, as another test, also works. This may just be limited to the # character in particular, but whatever validation the call file parser is using does not seem to match up with the dialplan.
Comments:By: Asterisk Team (asteriskteam) 2021-02-26 18:12:47.511-0600

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: N A (InterLinked) 2021-03-01 07:31:43.960-0600

Sorry, maybe my description was unclear. I wasn't trying to make a comment. # is the literal extension (as in dialing #).

By: Joshua C. Colp (jcolp) 2021-03-01 07:35:14.370-0600

It was not unclear. The problem is that '#' is considered a comment in call files, and can't be escaped.

By: Sean Bright (seanbright) 2021-03-01 08:36:39.013-0600

Instead of this:

{noformat}
echo Extension: # >> /tmp/...
{noformat}

Try this:

{noformat}
echo Extension:# >> /tmp/...
{noformat}

(Note that in the second example there is no space between the {{:}} and the {{#}})

By: Sean Bright (seanbright) 2021-03-01 08:58:11.404-0600

A {{#}} is interpreted as the beginning of a comment [if it appears as the first character on a line or is immediately preceded by a space or tab|https://github.com/asterisk/asterisk/blob/fd0ca1c3f9b972a52d48a82b492fd6bac772dc78/pbx/pbx_spool.c#L183-L189].

Removing the space before the {{#}} should make it work in your case.