ChanSpy enforced mode (e option.)

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

ChanSpy enforced mode (e option.)

Postby eg » Thu Jun 30, 2011 5:54 am

Good day,
I am trying to set ChanSpy for monitoring extension from a specific group of extensions,
I am using e option from ChanSpy application.
In my case I set to monitor extensions from 100 to 102

Code: Select all
exten => 123,1,ChanSpy(e(100:101:102))


But when a call is placed from any of this extensions(10[0-2]) , ChanSpy didn't react on this.

Maybe I set wrong delimiter or extension names , if anybody know how to use it properly I will be very thankful if you can help me.

Thanks in advance.
================================

PS:
I am using : Asterisk 1.6.2.19-rc1
ChanSpy g option is not an solution for my case.
eg
Newsterisk
 
Posts: 41
Joined: Fri Mar 26, 2010 3:49 am

Re: ChanSpy enforced mode (e option.)

Postby david55 » Thu Jun 30, 2011 6:13 am

Missing ",".
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: ChanSpy enforced mode (e option.)

Postby eg » Thu Jun 30, 2011 6:48 am

david55 wrote:Missing ",".

Thank you david55, I really didn't get this point.
I changed it like

Code: Select all
exten => 123,1,ChanSpy(,e(100:101:102))


But It's the same.
Extensions are calling, I am in Chanspy.
But nothing is happening.
Without e option everything is working fine.

Maybe there is something else that I did wrong. Please give me some advices .
Thank you.

Code: Select all
pbx1*CLI> core show channels
Channel              Location             State   Application(Data)             
SIP/newacc-000 (None)                       Up      AppDial((Outgoing Line))     
SIP/101-0000014b    s@macro-dialout-trun Up      Dial(SIP/newacc/447916..
SIP/105-0000014a   123@from-internal:4  Up      ChanSpy(,e(101:102:103))
eg
Newsterisk
 
Posts: 41
Joined: Fri Mar 26, 2010 3:49 am

Re: ChanSpy enforced mode (e option.)

Postby david55 » Thu Jun 30, 2011 6:57 am

I haven't used this feature, but:

- why do you believe the delimiter is ":"?

- why do you think that this requires anything less than the full device name (possibly split between prefix and the part in the e option)?

You can be certain that it doesn't expect an extension number, in the Asterisk sense.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: ChanSpy enforced mode (e option.)

Postby eg » Thu Jun 30, 2011 7:22 am

david55 wrote:I haven't used this feature, but:

- why do you believe the delimiter is ":"?

- why do you think that this requires anything less than the full device name (possibly split between prefix and the part in the e option)?

You can be certain that it doesn't expect an extension number, in the Asterisk sense.

Thank you a lot david55,

That was how I interpreted documentation related with this Application.
From core show application ChanSpy
Code: Select all
- e(ext): Enable 'enforced' mode, so the spying channel can only monitor extensions whose name
  is in the 'ext' : delimited list.



david55 wrote:- why do you believe the delimiter is ":"?

'ext' : delimited list. I thought ":" is delimiter. But it's look like not, i will check it also with "," and "|".
david55 wrote:- why do you think that this requires anything less than the full device name (possibly split between prefix and the part in the e option)?

monitor extensions whose name - only name I got for extensions is extension number without tech prefix.
eg
Newsterisk
 
Posts: 41
Joined: Fri Mar 26, 2010 3:49 am

Re: ChanSpy enforced mode (e option.)

Postby david55 » Thu Jun 30, 2011 7:33 am

There is an unfortunate line break in the help text in my version. Colon probably is right.

ChanSpy spies on channels, not extensions, so I would assume you need to a device name, not an extension name. Best security practice is that these should not match, but they may be related in your system.

If you want to match on extension, you need to use ExtenSpy, but that only works for outgoing calls. Asterisk cannot associate an extension number with incoming calls, and there may not even be one. (One could, possibly use hints, but then it would have to use both strategies (match on device name according to hint and match on extension according to position in dialplan).
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: ChanSpy enforced mode (e option.)

Postby david55 » Thu Jun 30, 2011 8:12 am

Looks to me as though it requires the full technology/address name, although case insensitively. There may be bug in the version I looked at, for addresses which, themselves, contain hyphens. myenforced is the e option parameter and peer is the channel that is a candidate for being spyed upon. If 1.8.x still says extensions, a bug report would be justified to correct the loose use of the word.

Code: Select all
                        if (myenforced) {
                                char ext[AST_CHANNEL_NAME + 3];
                                char buffer[512];
                                char *end;

                                snprintf(buffer, sizeof(buffer) - 1, ":%s:", myenforced);

                                ast_copy_string(ext + 1, peer->name, sizeof(ext) - 1);
                                if ((end = strchr(ext, '-'))) {
                                        *end++ = ':';
                                        *end = '\0';
                                }

                                ext[0] = ':';

                                if (strcasestr(buffer, ext)) {
                                        ienf = 1;
                                }
                        }
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: ChanSpy enforced mode (e option.)

Postby eg » Fri Jul 01, 2011 5:47 am

david55 , thank you a lot again.

You are right , it is necessary to use tech prefix for all extensions , I used to use only sip, so I almost forgot about that they could be IAX or whatever too, and it is necessary to be distinguish between them.

And finlay it look like :
Code: Select all
exten => 123,1,ChanSpy(,e(SIP/101:SIP/102:SIP/103))


Thanks again, [ SLOVED ] - at least for me.
eg
Newsterisk
 
Posts: 41
Joined: Fri Mar 26, 2010 3:49 am


Return to Asterisk Support

Who is online

Users browsing this forum: No registered users and 1 guest