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.

ChanSpy([chanprefix,[options]])
  1. http://the-asterisk-book.com/1.6/applikationen-chanspy.html
  2. https://wiki.asterisk.org/wiki/display/AST/Application_ChanSpy

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

ChanSpy(SIP/10,bqe(SIP/10))

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

http://forums.asterisk.org/viewtopic.php?f=1&t=78922


Related threads

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

https://blogs.asterisk.org/2016/02/10/converting-from-chan_agent-to-app_agent_pool/

http://the-asterisk-book.com/1.6/applikationen-chanspy.html

https://wiki.asterisk.org/wiki/display/AST/Application_ChanSpy

http://forums.asterisk.org/viewtopic.php?f=1&t=96037

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