How to use ChanSpy to eavesdrop a single channel instead of a channel prefix?

I would like to configure the ChanSpy application to only spy in a single extension, instead of a extension prefix as the documentation states:

If the chanprefix parameter is specified, only channels beginning with this string will be spied upon.

  1. B.19. ChanSpy()
  2. Application_ChanSpy - Asterisk Project - Asterisk Project Wiki

For example, with the following, I can spy on all channels as 10, 101, 102, … How can I limit it to spy only on the channel 10, not all channels starting with 10 on their name?

exten => 2,ChanSpy(SIP/10 ,bq)

Related threads

You could try using the ‘e’ option to restrict to a list.

1 Like

Can you show an example of the syntax?

I think it should be as simple as


1 Like

Thanks, I figured out it also work without adding the prefix and added the E option to hang up the channel once the eavesdropped call has ended.

exten => 1,1,ChanSpy(,Ebqe(SIP/10))

Related solutions

Related threads

For reference, I am going to post all topics I found about this problem:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.