Summary:ASTERISK-07918: [patch] Allow exiting from ChanSpy to a valid sigle digit extension (like meetme) and add a readonly mode
Reporter:Matthew Nicholson (mnicholson)Labels:
Date Opened:2006-10-11 21:47:02Date Closed:2007-02-15 19:17:57.000-0600
Versions:Frequency of
Environment:Attachments:( 0) app_chanspy-exit-readonly3.diff
( 1) chanspy5.diff
Description:This patch adds an X option to ChanSpy that works the same as meetme's X option.  It allows the user to exit to a valid single digit extension in the current context or the context specified by SPY_EXIT_CONTEXT.  It also sets the SPY_CHANNEL varible to the last channel that was being spied on.

Also included is an option to not mix the two channels enabling read-only mode in which the spy only hears audio coming from the spyee and not audio going to him.

The patch from ASTERISK-7917 is also included, which fixes volume adjustment.

I successfully tested a similar patch against version 1.2.12+svn, but I was unable to get app_chanspy working on trunk on my test system (with or without the patch).  It compiles fine.


This patch superseeds ASTERISK-7321 for the most part and includes the readonly option and a means to "mark" a channel.  After exiting from spying the channel could be sent via a UserEvent over the manager using the ${SPY_CHANNEL} variable.

Patch notes:
The patch includes a goto, which I know is considered bad, but it was the cleanest way I could exit from some nested loops and it is very straight forward in operation.
Comments:By: Serge Vecher (serge-v) 2006-10-12 08:30:22

I think that this should not be limited to a single digit extension. Would it be possible to extend the patch to accept/match a sequence?

By: Matthew Nicholson (mnicholson) 2006-10-12 09:46:08

I only need a single digit, which is why it is a single digit :).  It get's a little more complicated with multiple digits.  Also I think the single digit exit should completely disable the chanprefix features.  Reason being is when you dial a single digit that does not match any in the specified context, futher digits are viewed as chanprefix options until you press # (or enter 24 digits or something).  This can be confusing.  I'll upload another patch.

By: Matthew Nicholson (mnicholson) 2006-10-12 09:54:51

Also meetme's 'X' option only supports a single digit.

By: Matthew Nicholson (mnicholson) 2006-10-17 20:25:55

The patch has been updated against latest trunk (r45426).  Also the X option diables the chanprefix stuff.

By: jmls (jmls) 2006-10-31 11:33:45.000-0600

does this patch mean that we can close ASTERISK-7321 ?

By: Matthew Nicholson (mnicholson) 2006-10-31 12:21:43.000-0600

Well you could close it and reference this bug, as this superseeds that.  I also want to write a patch to allow adjusting the default volumn for reading and writing seperatly.  That of course will come in another bug.

By: jmls (jmls) 2006-11-20 11:43:14.000-0600

okay, we closed ASTERISK-7321. Developers - what's next ?

By: Matthew Nicholson (mnicholson) 2006-11-20 13:31:25.000-0600

There are still a few issues with this code.  The one I can think of is, when there are no channels to spy on the exit keys don't work.  I can fix that (soon).

By: Serge Vecher (serge-v) 2007-01-09 13:06:27.000-0600

mnicholson: any progress on this issue?

By: Matthew Nicholson (mnicholson) 2007-01-09 14:01:51.000-0600

Yeah, sorry.  I have the code but it is not yet "done" enough to go in yet.  I just have to update the patch to fix a few of the issues I found after reporting this.  I'll set aside some time this week to do it.

By: Matthew Nicholson (mnicholson) 2007-01-11 14:35:39.000-0600

Ok, I updated the patch.  In this version, single digit exit works when you are not listening on a channel.

By: Serge Vecher (serge-v) 2007-01-11 15:45:56.000-0600

minor spelling comments:
1. superseets -> supersedes
2. ... in the correct context it ChanSpy will ... -> in the correct context ChanSpy will

By: Matthew Nicholson (mnicholson) 2007-01-11 16:11:44.000-0600

Spelling and grammar issues fixed in chanspy5.diff

By: Joshua C. Colp (jcolp) 2007-02-15 19:17:56.000-0600

Put into trunk as of revision 54748. Thanks Matt!