You may need to listen someone else's call. First of all be sure to be compliant with international laws and regulations and those of your country: Rumors that the Alphabet Soup is wiretapping the whole world will not shield you from a lawsuit or a criminal investigation. If you're positive you have the right to listen, FreeSWITCH has two dialplan applications to choose from: eavesdrop
will allow you to listen to an arbitrary call (defined as an uuid argument to the app), while userspy
will constantly eavesdrop on calls involving a specific user.
Using eavesdrop
on a call (also known as call barging) requires knowing its uuid (you may use all
as uuid, but you'll end up listening to all existing calls mixed together). One such technique is implemented in the standard dialplan. When a call is processed, its uuid is added to a spymap
db table, indexed on extension. You can then dial a prefix + extension, and if there is a call involving that extension the uuid will be retrieved and fed to the eavesdrop application:
<extension name="global" continue="true"> <condition> <action application="db" data="insert/spymap/${caller_id_number}/${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>
You will dial 88 + extension or *0 + extension to listen to calls, and you may then talk to the caller, callee, or both (pressing 2, 1 or 3), or just lurk there. Refer to eavesdrop documentation for full options and variables.
The userspy
is a way to automate the eavesdropping on a particular user. You will need to compile mod_spy
and load it into FreeSWITCH.
cd /usr/src/freeswitch make mod_spy-install
Once loaded it adds the dialplan application userspy
.
You will then add to the dialplan an extension where the action is like:
<action application="userspy" data="[email protected] ${hash(select/${domain_name}-spymap/1000)}"/>
The two parameters are user@domain
to listen to future calls, and an optional uuid of an active call to immediately begin to barge in on. In between active calls, you'll be listening to MOH.
18.118.119.229