Monitor a Spygroup with an entire conference room

Is there a way to spy a call with an entire conference room?
There should be an active call (Call A), where the Spygroup is already set.

Now I am trying to create a conference room, which always listens to the mentioned call A.
The member in the conference should hear each other, plus the active mentioned call A.
But the participants of the Call A should not hear the member of the conference.
Is this possible somehow?

Thank you very much in advance!

Kinda want to do ExtenSpy() and ConfBridge() at the same time

Commonly people would use a Local channel, with one side going into dialplan that does the spying and the other side going into ConfBridge.

1 Like

I tried something like this, but only get audio from the conference:

exten => _*1#X.,1,NoOp(“Set up for silent monitoring for MAID ${EXTEN:3}”)
same => n,Originate(Local/${MAID}@background_spy,exten,background_spy,${MAID},1,30,a)
same => n,ConfBridge(KONF-${MAID})
same => n,Hangup()

[background_spy]
exten => _X.,1,NoOp(“Background_spy context”)
same => n,Set(CHANNEL_NAME=SPYCHANNEL-${EXTEN})
same => n,ExtenSpy(SPY-${EXTEN})
same => n,Hangup()

You haven’t shown any console output or described what actually happened when you tried. Break down what you’ve done and verify the assumptions you have about how it should work.

  1. Is it spying on the correct thing?
  2. Is there audio flowing on what is being spied on?
  3. Did the Local channel join the conference bridge?
  4. If you ExtenSpy outside of the conference bridge does it work?
1 Like

Exact dialplan for the first call to spy on:

exten => _*2#X.,1,NoOp(“Dummy-Call to Dialer - MAID ${EXTEN:3}”)
same => n,Answer()
same => n,Set(MAID=${EXTEN:3})
same => n,NoOp(“Set up Spygroup - SPY-${MAID}”)
same => n,Set(SPYGROUP=SPY-${MAID})
same => n,Playback(tt-weasels)
same => n,MusicOnHold(default)
same => n,Hangup()

Dialplan for 2nd call (Trying to spy and join conference):
exten => _*1#X.,1,NoOp(“Set up for silent monitoring for MAID ${EXTEN:3}”)
same => n,Answer()
same => n,Set(MAID=${EXTEN:3})
same => n,Originate(Local/${MAID}@background_spy,exten,background_spy,${MAID},1,30,a)
same => n,ConfBridge(KONF-${MAID})
same => n,Hangup()

[background_spy]
exten => _X.,1,NoOp(“Background_spy context”)
same => n,Set(CHANNEL_NAME=SPYCHANNEL-${EXTEN})
same => n,ExtenSpy(SPY-${EXTEN})
same => n,Hangup()

The CLI shows:

== Endpoint callrouter is now Reachable
– Contact callrouter/sip:192.168.251.91 is now Reachable. RTT: 1.485 msec
– Executing [*2#12345@main:1] NoOp(“PJSIP/norman-linphone-00000000”, "“Dummy-Call to Dialer - MAID 12345"”) in new stack
– Executing [*2#12345@main:2] Answer(“PJSIP/norman-linphone-00000000”, “”) in new stack
> 0x75c6b8020c40 – Strict RTP learning after remote address set to: 192.168.199.130:7078
> 0x75c6b8020c40 – Strict RTP switching to RTP target address 192.168.199.130:7078 as source
– Executing [*2#12345@main:3] Set(“PJSIP/norman-linphone-00000000”, “MAID=12345”) in new stack
– Executing [*2#12345@main:4] NoOp(“PJSIP/norman-linphone-00000000”, "“Set up Spygroup - SPY-12345"”) in new stack
– Executing [*2#12345@main:5] Set(“PJSIP/norman-linphone-00000000”, “SPYGROUP=SPY-12345”) in new stack
– Executing [*2#12345@main:6] Playback(“PJSIP/norman-linphone-00000000”, “tt-weasels”) in new stack
– <PJSIP/norman-linphone-00000000> Playing ‘tt-weasels.gsm’ (language ‘de’)
– Executing [*2#12345@main:7] MusicOnHold(“PJSIP/norman-linphone-00000000”, “default”) in new stack
– Started music on hold, class ‘default’, on channel ‘PJSIP/norman-linphone-00000000’
> 0x75c6b8020c40 – Strict RTP learning complete - Locking on source address 192.168.199.130:7078
== Using SIP RTP Audio TOS bits 184
== Using SIP RTP Audio CoS mark 5
– Executing [*1#12345@from_callrouter:1] Goto(“PJSIP/callrouter-00000001”, “main_norman,*1#12345,1”) in new stack
– Goto (main_norman,*1#12345,1)
– Executing [*1#12345@main_norman:1] NoOp(“PJSIP/callrouter-00000001”, "“Set up for silent monitoring for MAID 12345"”) in new stack
– Executing [*1#12345@main_norman:2] Answer(“PJSIP/callrouter-00000001”, “”) in new stack
> 0x75c6b80631b0 – Strict RTP learning after remote address set to: 192.168.251.91:13646
> 0x75c6b80631b0 – Strict RTP switching to RTP target address 192.168.251.91:13646 as source
– Executing [*1#12345@main_norman:3] Set(“PJSIP/callrouter-00000001”, “MAID=12345”) in new stack
– Executing [*1#12345@main_norman:4] Originate(“PJSIP/callrouter-00000001”, “Local/12345@background_spy,exten,background_spy,12345,1,30,a”) in new stack
– Executing [12345@background_spy:1] NoOp(“Local/12345@background_spy-00000000;2”, ““Background_spy context””) in new stack
– Executing [12345@background_spy:2] Set(“Local/12345@background_spy-00000000;2”, “CHANNEL_NAME=SPYCHANNEL-12345”) in new stack
– Executing [12345@background_spy:3] ExtenSpy(“Local/12345@background_spy-00000000;2”, “SPY-12345”) in new stack
– Called 12345@background_spy
– Local/12345@background_spy-00000000;1 answered
– Executing [12345@background_spy:1] NoOp(“Local/12345@background_spy-00000000;1”, ““Background_spy context””) in new stack
– Executing [12345@background_spy:2] Set(“Local/12345@background_spy-00000000;1”, “CHANNEL_NAME=SPYCHANNEL-12345”) in new stack
– Executing [12345@background_spy:3] ExtenSpy(“Local/12345@background_spy-00000000;1”, “SPY-12345”) in new stack
– <Local/12345@background_spy-00000000;1> Playing ‘beep.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;2> Playing ‘beep.gsm’ (language ‘de’)
– Executing [*1#12345@main_norman:5] Wait(“PJSIP/callrouter-00000001”, “1”) in new stack
– <Local/12345@background_spy-00000000;2> Playing ‘letters/s.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;1> Playing ‘letters/s.gsm’ (language ‘de’)
– Executing [*1#12345@main_norman:6] ConfBridge(“PJSIP/callrouter-00000001”, “KONF-12345”) in new stack
– Channel CBAnn/KONF-12345-00000001;2 joined ‘softmix’ base-bridge <81984b18-b6e4-4de4-b45c-8d20573c6d8e>
– <PJSIP/callrouter-00000001> Playing ‘conf-onlyperson.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;2> Playing ‘letters/p.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;1> Playing ‘letters/p.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;2> Playing ‘letters/y.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;1> Playing ‘letters/y.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;2> Playing ‘letters/dash.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;1> Playing ‘letters/dash.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;2> Playing ‘letters/p.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;1> Playing ‘letters/p.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;2> Playing ‘letters/j.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;1> Playing ‘letters/j.gsm’ (language ‘de’)
– <PJSIP/callrouter-00000001> Playing ‘confbridge-join.gsm’ (language ‘de’)
– <CBAnn/KONF-12345-00000001;1> Playing ‘confbridge-join.gsm’ (language ‘en’)
– <Local/12345@background_spy-00000000;2> Playing ‘letters/s.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;1> Playing ‘letters/s.gsm’ (language ‘de’)
– Channel PJSIP/callrouter-00000001 joined ‘softmix’ base-bridge <81984b18-b6e4-4de4-b45c-8d20573c6d8e>
> 0x75c6b80631b0 – Strict RTP learning complete - Locking on source address 192.168.251.91:13646
– <Local/12345@background_spy-00000000;2> Playing ‘letters/i.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;1> Playing ‘letters/i.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;2> Playing ‘letters/p.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;1> Playing ‘letters/p.gsm’ (language ‘de’)
== Spying on channel PJSIP/norman-linphone-00000000
– Attaching spy channel Local/12345@background_spy-00000000;2 to PJSIP/norman-linphone-00000000
== Spying on channel PJSIP/norman-linphone-00000000
– Attaching spy channel Local/12345@background_spy-00000000;1 to PJSIP/norman-linphone-00000000

  1. When I just use ExtenSpy(SPY-${EXTEN}), it works, but blocks the following dialplan, so I cant join the conference directly after
  2. Yes i play some music on hold for the active call
  3. No, how do I do this?
  4. Yes this worked

You haven’t told Originate to send the call to ConfBridge upon answer, instead you’ve told it to go to ExtenSpy a second time.

1 Like

When I try to initiate the 2nd call, I just hear audio, that I joined the conference. Dont hear any Music thats playing on the first call

How would I do this?

You would need to add another extension, or do it in another context too, that simply joins the given conference bridge.

Originate works by doing the following:

  1. Place a call to the given dial target
  2. Upon answer send it to the given dialplan target

Right now you’ve said “dial ${MAID} extension in the background_spy context, upon answer send it to the ${MAID} extension in the background_spy context” so you have two ExtenSpy applications talking to each other.

1 Like

Now I better understand the originate function, thank you!!
I changed the line to:
same => n,Originate(Local/${MAID}@background_spy,exten,background_bridge,${MAID},1,30,a)

and added the context:
[background_bridge]
exten => _X.,1,NoOp(“Background_bridge context”)
same => n,ConfBridge(KONF-${EXTEN})
same => n,Hangup()

But now, I only hear a very very loud undefined noise, when I try to spy…

This is the current CLI output:

== Endpoint norman-linphone is now Reachable
– Added contact ‘sip:norman-linphone@192.168.199.130;transport=udp’ to AOR ‘norman-linphone’ with expiration of 3600 seconds
== Using SIP RTP Audio TOS bits 184
== Using SIP RTP Audio CoS mark 5
– Executing [*2#12345@from_callrouter:1] Goto(“PJSIP/callrouter-00000000”, “main_norman,*2#12345,1”) in new stack
– Goto (main_norman,*2#12345,1)
– Executing [*2#12345@main_norman:1] NoOp(“PJSIP/callrouter-00000000”, "“Dummy-Call to Dialer - MAID 12345"”) in new stack
– Executing [*2#12345@main_norman:2] Answer(“PJSIP/callrouter-00000000”, “”) in new stack
> 0x7b4488041610 – Strict RTP learning after remote address set to: 192.168.251.91:10062
> 0x7b4488041610 – Strict RTP switching to RTP target address 192.168.251.91:10062 as source
– Executing [*2#12345@main_norman:3] Set(“PJSIP/callrouter-00000000”, “MAID=12345”) in new stack
– Executing [*2#12345@main_norman:4] NoOp(“PJSIP/callrouter-00000000”, "“Set up Spygroup - SPY-12345"”) in new stack
– Executing [*2#12345@main_norman:5] Set(“PJSIP/callrouter-00000000”, “SPYGROUP=SPY-12345”) in new stack
– Executing [*2#12345@main_norman:6] Playback(“PJSIP/callrouter-00000000”, “tt-weasels”) in new stack
– <PJSIP/callrouter-00000000> Playing ‘tt-weasels.gsm’ (language ‘de’)
– Executing [*2#12345@main_norman:7] MusicOnHold(“PJSIP/callrouter-00000000”, “default”) in new stack
– Started music on hold, class ‘default’, on channel ‘PJSIP/callrouter-00000000’
> 0x7b4488041610 – Strict RTP learning complete - Locking on source address 192.168.251.91:10062
– Executing [*1#12345@main:1] NoOp(“PJSIP/norman-linphone-00000001”, "“Set up for silent monitoring for MAID 12345"”) in new stack
– Executing [*1#12345@main:2] Answer(“PJSIP/norman-linphone-00000001”, “”) in new stack
> 0x7b4488053b00 – Strict RTP learning after remote address set to: 192.168.199.130:7078
> 0x7b4488053b00 – Strict RTP switching to RTP target address 192.168.199.130:7078 as source
– Executing [*1#12345@main:3] Set(“PJSIP/norman-linphone-00000001”, “MAID=12345”) in new stack
– Executing [*1#12345@main:4] Originate(“PJSIP/norman-linphone-00000001”, “Local/12345@background_spy,exten,background_bridge,12345,1,30,a”) in new stack
– Called 12345@background_spy
– Executing [12345@background_spy:1] NoOp(“Local/12345@background_spy-00000000;2”, ““Background_spy context””) in new stack
– Executing [12345@background_spy:2] Set(“Local/12345@background_spy-00000000;2”, “CHANNEL_NAME=SPYCHANNEL-12345”) in new stack
– Executing [12345@background_spy:3] ExtenSpy(“Local/12345@background_spy-00000000;2”, “SPY-12345”) in new stack
– Local/12345@background_spy-00000000;1 answered
– Executing [12345@background_bridge:1] NoOp(“Local/12345@background_spy-00000000;1”, ““Background_bridge context””) in new stack
– Executing [12345@background_bridge:2] ConfBridge(“Local/12345@background_spy-00000000;1”, “KONF-12345”) in new stack
– Channel CBAnn/KONF-12345-00000001;2 joined ‘softmix’ base-bridge <5a4c08c7-3c6d-41ed-a8ce-93ea1fab7b90>
– Executing [*1#12345@main:5] Wait(“PJSIP/norman-linphone-00000001”, “1”) in new stack
– <Local/12345@background_spy-00000000;1> Playing ‘conf-onlyperson.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;2> Playing ‘beep.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;2> Playing ‘letters/s.gsm’ (language ‘de’)
– Executing [*1#12345@main:6] ConfBridge(“PJSIP/norman-linphone-00000001”, “KONF-12345”) in new stack
– <PJSIP/norman-linphone-00000001> Playing ‘confbridge-join.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;2> Playing ‘letters/p.gsm’ (language ‘de’)
– <CBAnn/KONF-12345-00000001;1> Playing ‘confbridge-join.gsm’ (language ‘en’)
– Channel PJSIP/norman-linphone-00000001 joined ‘softmix’ base-bridge <5a4c08c7-3c6d-41ed-a8ce-93ea1fab7b90>
– <Local/12345@background_spy-00000000;2> Playing ‘letters/y.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;2> Playing ‘letters/dash.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;1> Playing ‘confbridge-join.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;2> Playing ‘letters/c.gsm’ (language ‘de’)
– <CBAnn/KONF-12345-00000001;1> Playing ‘confbridge-join.gsm’ (language ‘en’)
– Channel Local/12345@background_spy-00000000;1 joined ‘softmix’ base-bridge <5a4c08c7-3c6d-41ed-a8ce-93ea1fab7b90>
– <Local/12345@background_spy-00000000;2> Playing ‘letters/b.gsm’ (language ‘de’)
> 0x7b4488053b00 – Strict RTP learning complete - Locking on source address 192.168.199.130:7078
– <Local/12345@background_spy-00000000;2> Playing ‘letters/a.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;2> Playing ‘letters/n.gsm’ (language ‘de’)
– <Local/12345@background_spy-00000000;2> Playing ‘letters/n.gsm’ (language ‘de’)
== Spying on channel CBAnn/KONF-12345-00000001;1
– Attaching spy channel Local/12345@background_spy-00000000;2 to CBAnn/KONF-12345-00000001;1
– Channel PJSIP/norman-linphone-00000001 left ‘softmix’ base-bridge <5a4c08c7-3c6d-41ed-a8ce-93ea1fab7b90>
– <CBAnn/KONF-12345-00000001;1> Playing ‘confbridge-leave.gsm’ (language ‘en’)
== Contact norman-linphone/sip:norman-linphone@192.168.199.130;transport=udp has been deleted
== Endpoint norman-linphone is now Unreachable
– Removed contact ‘sip:norman-linphone@192.168.199.130;transport=udp’ from AOR ‘norman-linphone’ due to request
– Stopped music on hold on PJSIP/callrouter-00000000

It is spying on the conference bridge announcement channel, not the channel you expect so your usage for getting it to spy on the right channel appears to be insufficient or incorrect. Looking at the documentation[1] it doesn’t appear as though you are actually using SPYGROUP to find the channel, as it has to be specified using the ‘g’ option to ExtenSpy to limit it.

[1] ExtenSpy - Asterisk Documentation

1 Like

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