Misc. Dialplan Tools eavesdrop

From FreeSWITCH Wiki
Jump to: navigation, search

Contents

Description

Provides the ability to spy on a channel. It often referred to as call barge. For persistent spying on a user see Mod_spy.

Usage

eavesdrop [<uuid>|all]

Variables

<action application="set" data="eavesdrop_require_group=<groupID>"/>
<action application="set" data="eavesdrop_indicate_failed=/sounds/failed.wav"/>
<action application="set" data="eavesdrop_indicate_new=/sounds/new_chan_announce.wav"/>
<action application="set" data="eavesdrop_indicate_idle=/sounds/idle.wav"/>
<action application="set" data="eavesdrop_enable_dtmf=true"/> 

DTMF signals during eavesdrop

  • 2 to speak with the uuid
  • 1 to speak with the other half
  • 3 to engage a three way
  • 0 to restore eavesdrop.
  • * to next channel.

If "eavesdrop_require_group" is specified, eavesdrop only works with channels that have an "eavesdrop_group" channel variable set to the same name.

If '*' is used on an eavesdrop with out the data = all parameter set, the eavesdrop will be terminated.

Simulating DTMF

You can send DTMF using uuid_recv_dtmf

DTMF Speak to callee Example

   <extension name="eavesdrop_speak_to_callee" continue="true">
     <condition field="destination_number" expression="^88(.*)$|^\*0(.*)$">
       <action application="answer"/>
       <action application="set" data="eavesdrop_enable_dtmf=true"/>
       <action application="queue_dtmf" data="w1@500"/>
       <action application="eavesdrop" data="${db(select/spymap/$1$2)}"/>
     </condition>
   </extension>

DTMF Speak to caller Example

   <extension name="eavesdrop_speak_to_caller" continue="true">
     <condition field="destination_number" expression="^88(.*)$|^\*0(.*)$">
       <action application="answer"/>
       <action application="set" data="eavesdrop_enable_dtmf=true"/>
       <action application="queue_dtmf" data="w2@500"/>
       <action application="eavesdrop" data="${db(select/spymap/$1$2)}"/>
     </condition>
   </extension>

Examples

From the Dialplan

This is available in the default.xml dialplan. To use it from your phone dial 88[extension number]. For example to eavesdrop on extension 1001 dial 881001.

   <extension name="global" continue="true">
     <condition>
       <action application="info"/>
       <action application="db" data="insert/spymap/${caller_id_number}/${uuid}"/>
       <action application="db" data="insert/last_dial/${caller_id_number}/${destination_number}"/>
       <action application="db" data="insert/last_dial/global/${uuid}"/>
     </condition>
   </extension>
   <extension name="eavesdrop">
     <condition field="destination_number" expression="^88(.*)$|^\*0(.*)$">
       <action application="answer"/>
       <action application="eavesdrop" data="${db(select/spymap/$1$2)}"/>
     </condition>
   </extension>

From the mod_event_socket

In this example you originate a call to extension 2001 and start spying the channel with UUID c7709e9c-1517-11dc-842a-d3a3942d3d63

api originate sofia/default/2001@yourvsp.com &eavesdrop(c7709e9c-1517-11dc-842a-d3a3942d3d63)

or another example with SRTP

originate {sip_secure_media=true}user/1000 &eavesdrop(52d87034-4173-11de-99ef-f1acc19bfdf1)

In this example an eavesdrop is made of UUID a28739d0-00f0-4a59-8c82-7a5a74ab6861 to extension 1001, however the eavesdrop is started with DTMF option 2 (w2@500) to allow speaking directly to the UUID with out the other party hearing (whisper).

originate user/1001 'queue_dtmf:w2@500,eavesdrop:a28739d0-00f0-4a59-8c82-7a5a74ab6861' inline

Specifying a group

You can specify a "group" to limit the channels that an eavesdrop applies to. This may be useful for privacy reasons.

For example, if you only want to eavesdrop on incoming sales calls, you could set the "eavesdrop_group" variable on the original incoming channel:

   <action application="set" data="eavesdrop_group=sales_call_eavesdrop"/>

Then create an eavesdrop command that only affects that "sales_call_eavesdrop" group:

   <extension name="eavesdrop">
     <condition field="destination_number" expression="^779$">
       <action application="answer"/>
       <action application="set" data="eavesdrop_require_group=sales_call_eavesdrop"/>
       <action application="eavesdrop" data="all"/>
     </condition>
   </extension>
  • Note: You should set the var eavesdrop_require_group=foo before you run the app and on all calls that are not using G729, set the var eavesdrop_group=foo in the dialplan in order to avoid call drops on G.729, if you don't have the codec licenses since they require transcoding.

See Also