[Home]

Summary:ASTERISK-26993: app_chanspy: ExtenSpy on extension with no active channels
Reporter:Jared Hull (fortytwo)Labels:
Date Opened:2017-05-10 16:21:03Date Closed:
Priority:MajorRegression?
Status:Open/NewComponents:Applications/app_chanspy
Versions:13.14.0 14.4.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) asterisk.txt
Description:I have three extensions: 101, 102, 103.
If 103 is in a call and I use ExtenSpy from extension 101 spy on extension 102 which has no active channels, it will spy on extension 103.

{noformat}exten => _*52.,1,ExtenSpy(${EXTEN:3},qS)
exten => _*53.,1,ExtenSpy(${EXTEN:3},qSw)
exten => _*54.,1,ExtenSpy(${EXTEN:3},qSB){noformat}

I inserted a debug statement into 'for (autochan = next_channel(iter, chan);' in common_exec() in apps/app_chanspy.c and see ast_channel_name(autochan->chan) is equal to the 103 channel.

I would expect that the iterator object should be null since there are no channels for the extension.
iter = ast_channel_iterator_by_exten_new(exten, context);
Comments:By: Asterisk Team (asteriskteam) 2017-05-10 16:21:04.663-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.

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].

By: Joshua C. Colp (jcolp) 2017-05-10 16:28:35.670-0500

Thank you for taking the time to report this bug and helping to make Asterisk better. Unfortunately, we cannot work on this bug because your description did not include enough information. Please read over the Asterisk Issue Guidelines [1] which discusses the information necessary for your issue to be resolved and the format that information needs to be in. We would be grateful if you would then provide a more complete description of the problem. At a minimum, we need:

1. The specific steps or actions you took that caused you to encounter the problem.
2. The behavior you expected and the location of documentation that led you to that expectation.
3. The behavior you actually encountered.

To demonstrate the issue in detail, please include Asterisk log files generated per the instructions on the wiki [2]. If applicable, please ensure that protocol-level trace debugging is enabled, e.g., 'sip set debug on' if the issue involves chan_sip, and configuration information such as dialplan and channel configuration.

Thanks!

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines

[2] https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information



By: Jared Hull (fortytwo) 2017-05-10 17:16:56.171-0500

One of these days I will learn how to follow the rules. Log attached to the issue.
In this test case, 103 is in an echo test. 101 dials *53102 to spy on 102, but 102 is not in any active channel and it spys on 103.

You will see a line in there like this.
{noformat}ast_verb(2, "%s ______________________ %s\n", ast_channel_name(chan), ast_channel_name(autochan->chan));{noformat}
The iterator for autochan is somehow grabbing a channel from another extension. It is as if Asterisk is just returning all active channels in the system rather than finding the ones that correspond with the extension. Of which there are none because the extension being spied on doesn't have any channels open.

By: Jared Hull (fortytwo) 2017-05-10 17:23:40.648-0500

Uploaded wrong test case log. Corrected now.