Chanspy supervisor can listen to conversations but can not hear audio file injected via playback

We set up a call between two parties and use chanspy to play an audio file to both parties. This works great.

We would like supervisors to be able to monitor all audio on the call.
If we patch the supervisor in via chanspy PJSIP/ the supervisor can hear both parties but can not hear the file that is injected to the called parties via chanspy/playback.

If we use chanspy Local/ the supervisor can hear the audio file injected via chanspy/playback but can not hear the live people.

In addition to our chanspy configuration, we tried out the targeted chanspy solution by lgaetz (a big Thank You to lgaetz for all of your FreePBX contributions!)

The results of using lgaetz solution are the same: Supervisors can hear both of the live parties on the call but do not hear the audio file that is played to both parties via chanspy.

We have tried spying using the full channel names for both sides of the call instead of just Local/nnn or PJSIP/nnn

Result was the same, supervisor could hear the live parties but not the injected audio.

Is there a way to live monitor and hear all audio on the call?

Relevant parts of dialplan / ami, etc below:

[play_sound]
;this context is used to play sound file, both parties hear it
;i.e. can inject sound file to station phone local channel 305 and the respondent on the line with 305 via:
;asterisk -x “channel originate Local/305@play_sound application playback demo-thanks”
exten=>_X.,1,Answer()
;same=>n,Noop(PLAY SOUND EXTEN: ${EXTEN} ${SID})
;same=>n,Noop(PLAY SOUND CHANNEL: ${CHANNEL})
;same=>n,Noop(PLAY SOUND CHANVAR: ${CHANVAR})
;set volume - could be used as a variable to increase / decrease vol of played sound file
;same=>n,Set(VOLUME(RX)=4)
;play sound file, both parties hear it
;options B barge, E exit when spied on channel hangs up, q do not play beep
same=>n,ChanSpy(PJSIP/${EXTEN},qBE)
same=>n,Hangup()

AMI call to play audio file to both parties [works as expected]:
Action: Originate\r\n
Channel: Local/nnn@play_sound\r\n
Application: Playback\r\n
Data: somesoundfile\r\n\r\n

AMI for supervisor to monitor call. Either hears parties on the line or the audio file being played.
fputs($socket, “Action: Originate\r\n”);
#Call supervisor
#fputs($socket, “Channel: PJSIP/$supervisor\r\n”);
#Local will ring all endpoints if multiple devices use same extension i.e. softphone and physical desk phone
fputs($socket, “Channel: Local/$supervisor\r\n”);
fputs($socket, “CallerID: $supervisor\r\n”);
#Spy on station

- option q quiet (do not play beep when connecting)

- S stop when no more channels available to spy

leave off the S to monitor multiple calls to station

fputs($socket, “Application: ChanSpy\r\n”);
#fputs($socket, “Data: PJSIP/$station_to_monitor,q\r\n”);
#PJSIP only monitors convo between interviewer and respondent

- supervisor can not hear files played via playback

fputs($socket, “Data: PJSIP/$station_to_monitor,q\r\n”);
#Local only monitors local channel - supervisor can hear files played via playback but cannot hear interviewer/respondent
#fputs($socket, “Data: Local/$station_to_monitor,q\r\n”);
fputs($socket, “ActionID: webmonitor!PJSIP/$station_to_monitor\r\n”);
fputs($socket, “Async: TRUE\r\n\r\n”);

No. Audiohooks (which is what ChanSpy uses) has a fixed execution order. Spying is first, followed by whispering (what barge-in uses), followed by manipulation (not used by ChanSpy). This means that spys hear the audio before any audio is added by barge-in.

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