ChanSpy enforced mode (e option.)

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

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.

Missing “,”.

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

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.

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))

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.

[quote=“david55”]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.[/quote]
Thank you a lot david55,

That was how I interpreted documentation related with this Application.
From core show application ChanSpy

- e(ext): Enable 'enforced' mode, so the spying channel can only monitor extensions whose name is in the 'ext' : delimited list.

‘ext’ : delimited list. I thought “:” is delimiter. But it’s look like not, i will check it also with “,” and “|”.

monitor extensions whose name - only name I got for extensions is extension number without tech prefix.

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

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] 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;
                            }
                    }[/code]

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 :

Thanks again, [ SLOVED ] - at least for me.