ChanSpy/eavesdrop feature using mixers?

74 views
Skip to first unread message

James Le Cuirot

unread,
May 25, 2017, 5:55:45 AM5/25/17
to Adhearsion
I wanted to add a ChanSpy/eavesdrop feature to our application. I decided to do it using Adhearsion because it allowed us to customise it with enhancements specific to our application. It also made triggering the call via HTTP easier as the Adhearsion process was already listening via Grape and Rayo has no way to invoke eavesdrop.

I found that directly joining the calls didn't work. The direction option was not respected and DTMF events were leaking through. I then tried using a mixer and that worked nicely. However, I initially only tested against calls being driven by SIPp. When I tried it for real, I found that I could hear the caller but not the prompts they were hearing. Given how mixers work, this made some sense but why did it work with SIPp? I eventually realised that the -rtp_echo option had given the illusion that it was working.

I am now rather upset because I spent a fair amount of time making the feature bulletproof (race conditions, yay!) and I can't think of a good way around this. I haven't got it to work yet but I think it's possible to play an output to the mixer. I could then have anything played to the caller repeated onto the mixer but it would mean that the spy would not hear anything initially unless I put every caller in a mixer all the time. Either way, this feels like a really nasty hack. Surely there's a better way?

Giorgio Bianchi

unread,
May 25, 2017, 10:28:36 AM5/25/17
to Adhearsion
Interesting!
Maybe you could record the call and listen to the recording : with the right audio tool and the play_url method of the AbstractPlayer in Adhearsion you could do this in nearly real time.
Let me know if this helps!

Giorgio

Luca Pradovera

unread,
May 25, 2017, 10:30:35 AM5/25/17
to adhea...@googlegroups.com
Hello,
what platform are you on? There are subtle differences in mixer capabilities between FS and Asterisk.

Best regards,

Luca

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adhearsion+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

James Le Cuirot

unread,
May 25, 2017, 10:43:41 AM5/25/17
to adhea...@googlegroups.com
> > Il giorno giovedì 25 maggio 2017 11:55:45 UTC+2, James Le Cuirot ha
> > scritto:
> >>
> >> I wanted to add a ChanSpy/eavesdrop feature to our application. I
> >> decided to do it using Adhearsion because it allowed us to
> >> customise it with enhancements specific to our application. It
> >> also made triggering the call via HTTP easier as the Adhearsion
> >> process was already listening via Grape and Rayo has no way to
> >> invoke eavesdrop.
> >>
> >> I found that directly joining the calls didn't work. The direction
> >> option was not respected and DTMF events were leaking through. I
> >> then tried using a mixer and that worked nicely. However, I
> >> initially only tested against calls being driven by SIPp. When I
> >> tried it for real, I found that I could hear the caller but not
> >> the prompts they were hearing. Given how mixers work, this made
> >> some sense but why did it work with SIPp? I eventually realised
> >> that the -rtp_echo option had given the illusion that it was
> >> working.

On Thu, 25 May 2017 16:30:33 +0200
Luca Pradovera <luca.pr...@gmail.com> wrote:

> Hello,
> what platform are you on? There are subtle differences in mixer
> capabilities between FS and Asterisk.

Sorry, I meant to say that this is FreeSWITCH. I am comfortable with
making changes to mod_rayo (I've submitted fixes to Chris before) if
that's what it would take but I don't know what would need to change. I
was hoping there would be a relevant option that I could set in
conference.conf.xml but sadly not.

Pat Burke

unread,
Jun 21, 2017, 6:02:13 PM6/21/17
to Adhearsion
Were you able to get this resolved?  If so how?

James Le Cuirot

unread,
Jun 22, 2017, 11:16:59 AM6/22/17
to adhea...@googlegroups.com
On Wed, 21 Jun 2017 14:17:57 -0700 (PDT)
Pat Burke <phb...@gmail.com> wrote:

> Were you able to get this resolved? If so how?

Sadly not and we ended up doing the poor man's alternative of just
triggering eavesdrop via fs_cli. Giorgio's idea of playing a
live recording was so crazy that it might just work though I think
there's a currently bug that prevents the URI from being retrieved
until the recording has finished. That aside, it's still not ideal.
Further ideas would be welcome.

James
Reply all
Reply to author
Forward
0 new messages