Hello everybody,
I am currently using asterisk as a “pass-thru” SIP gateway.
Phones register on a CISCO based system and call out via their respective PBX.
The PBX routes the call thru asterisk, asterisk routes it back to another PBX.
This is done in order to record calls that pass through the asterisk servers.
In this scenario, I recently wanted to integrate ChanSpy (specifically with whisper and barge functions).
In fact, the ChanSpy function works pretty well. The Spier can hear both parties.
Unfortunately thou, whisper and barge do not work the way they should.
Specifically, whisper does nothing (no parties can hear the Spier).
Barge works (imho, half way) but only the called party can hear the spier. The spied user cannot.
This is my extensions.conf (the relevant)
[default]
exten => _[*#0-9]!,1,NoOp()
exten => _[*#0-9]!,n,Set(xunique=${PJSIP_HEADER(read,x-unique)})
exten => _[*#0-9]!,n,Set(xprefix=${PJSIP_HEADER(read,x-asterisk-prefix)})
exten => _[*#0-9]!,n,Set(username=${PJSIP_HEADER(read,x-username)})
exten => _[*#0-9]!,n,Set(userid=${PJSIP_HEADER(read,x-userid)})
exten => _[*#0-9]!,n,GotoIf($["${userid}" != ""]?setspygroup:nospygroup)
exten => _[*#0-9]!,n(setspygroup),Set(SPYGROUP=${userid})
exten => _[*#0-9]!,n(nospygroup),NoOp()
exten => _[*#0-9]!,n,Set(CALLEDNUM=${EXTEN})
exten => _[*#0-9]!,n,Log(WARNING, Call ${xunique} started from ${CALLERID(num)} (${username} spyGroup ${SPYGROUP}) to ${EXTEN} (${xprefix}${EXTEN}) recorded as /var/records/${xunique}.wav)
exten => _[*#0-9]!,n,MixMonitor(/var/records/${xunique}.wav,abW(4))
exten => _[*#0-9]!,n,Dial(PJSIP/vg4/sip:${xprefix}${EXTEN}@MY-NEXT-HOP,60,gXwW)
exten => _[*#0-9]!,n,StopMixMonitor()
exten => _[*#0-9]!,n,Hangup()
exten => h,1,NoOp(CALLEDNUM=${CALLEDNUM})
exten => h,n,StopMixMonitor()
exten => h,n,Log(WARNING, Call ${xunique} closed from ${CALLERID(num)} to ${CALLEDNUM} (${xprefix}${CALLEDNUM}) with status ${DIALSTATUS} (${HANGUPCAUSE}) recorded as /var/records/${xunique}.wav)
exten => _88XXXX,1,NoOp()
exten => _88XXXX,n,Set(SPY=${EXTEN:2})
exten => _88XXXX,n,ChanSpy(,wdg(${SPY})v(4)q)
exten => _88XXXX,n,UserEvent(ChanSpy,User ${CALLBACKNUM} spied on ${SPY})```
So, just to make clear, the flow is:
phase 1
- Agent dials a number
- Cisco PBX routes the call to Asterisk
- Asterisk records the call and routes it to “MY-NEXT-HOP”
This works flawlessy.
phase 2
- Supervisor dials 881234 (where 1234 is the agent userid)
- ChanSpy is activated (Supervisor CAN hear both the agent and the called party)
- Supervisor presses “4”, he can hear both parties.
- Supervisor presses “5” and talks, noone can hear him
- Supervisor presses “6” and talks, called party can hear him, but calling party does not hear him.
All looks normal from the logs:
== Spying on channel PJSIP/anonymous-00000003
-- Attaching spy channel PJSIP/anonymous-00000005 to PJSIP/anonymous-00000003
-- Attaching spy channel PJSIP/anonymous-00000005 to PJSIP/anonymous-00000003
> 0x7fe73400a7a0 -- Strict RTP learning complete - Locking on source address xx.xx.xx.xx:20358
-- Attaching spy channel PJSIP/anonymous-00000005 to PJSIP/vg4-00000004
== Done Spying on channel PJSIP/anonymous-00000003
I’ve tried disabling MixMonitor - no effect.
I’ve tried with asterisk 16.0.1, 16.10.0 and 17.4.0 - same issues.
Anything I am missing or doing wrong?
Any idea to point me in the right direction?
Thank for your time and help.
Manuele