Why can't I hear calls through ChanSpy?

Greetings community,

I am setting up a FreePBX 16.0.40 server to listen in real-time to calls answered by agents. Under Admin > Feature Codes > Core, the ChanSpy option is enabled with the default value of 555.
Additionally, I have added the following code under Admin > Config Edit > Asterisk Custom Configuration Files > extensions_custom.conf:

exten => 555,1,Macro(user-callerid)
exten => 555,2,Authenticate(123)
exten => 555,3,Read(SPYNUM,agent-newlocation)
exten => 555,4,ChanSpy(SIP/${SPYNUM})
exten => 555,5,Hangup

Now, when I test it, I do the following:

I call from my mobile phone and answer with extension 201.
From another extension, I dial 555.
I hear a message asking for a password. I dial 123#.
I hear a message asking for the extension. I dial 201#.
I hear a beep that I assume means that call monitoring has started. However, I don’t hear anything while verifying that the call I made from my mobile phone continues normally.
Can anyone guess what might be happening? Why can’t I listen to the call?

Thanks in advance.

Are you using chan_sip for your extensions?

No, I’m using chan_pjsip extensions.

Then you need to use the PJSIP tech prefix. As in ChanSpy(PJSIP/${SPYNUM}).

Thanks Tom, that was just the problem. =-)

Here’s a channel agnostic version of targeted chanspy dialplan FreePBX Feature code prefix to allow spy/whisper/barge on the specified extension · GitHub

Thanks Lorne, it’s substantially better than what I have. :slightly_smiling_face:

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