EAVESDROP not functioning

Status
Not open for further replies.

Andrew Byrd

Member
Feb 16, 2018
309
10
18
53
I press *33102 (*33 for eavesdrop and 102 for the ext) it asks for the pin, I enter the pin, then the call terminates

Any ideas on why this is? I can see in the logs below that it is executing the dial plan but I don't see why the dial plan is wrong? I have attached a copy of the dial plan

2020-01-29 13:02:23.277419 [NOTICE] mod_dptools.c:1406 Channel [sofia/internal/105@abn3.npusa.us] has been answered
2020-01-29 13:02:23.277419 [DEBUG] switch_channel.c:3865 (sofia/internal/105@abn3.npusa.us) Callstate Change EARLY -> ACTIVE
2020-01-29 13:02:23.277419 [DEBUG] sofia.c:7301 Channel sofia/internal/105@abn3.npusa.us entering state [completed][200]
EXECUTE [depth=0] sofia/internal/105@abn3.npusa.us set(pin_number=5409)
2020-01-29 13:02:23.277419 [DEBUG] mod_dptools.c:1672 SET sofia/internal/105@abn3.npusa.us [pin_number]=[5409]
EXECUTE [depth=0] sofia/internal/105@abn3.npusa.us lua(eavesdrop.lua 602)
2020-01-29 13:02:23.277419 [DEBUG] switch_ivr_play_say.c:1492 Codec Activated L16@16000hz 1 channels 20ms
2020-01-29 13:02:23.277419 [DEBUG] switch_ivr_async.c:1641 No silence detection configured; assuming start of speech
2020-01-29 13:02:23.357428 [DEBUG] sofia.c:7301 Channel sofia/internal/105@abn3.npusa.us entering state [ready][200]
2020-01-29 13:02:23.437421 [DEBUG] switch_rtp.c:7720 Correct audio ip/port confirmed.
2020-01-29 13:02:23.437421 [DEBUG] switch_core_io.c:448 Setting BUG Codec G722:9
2020-01-29 13:02:26.037417 [DEBUG] switch_ivr_play_say.c:1933 done playing file /usr/share/freeswitch/sounds/en/us/callie/ivr/ivr-please_enter_pin_followed_by_pound.wav
2020-01-29 13:02:26.497419 [DEBUG] switch_rtp.c:7963 RTP RECV DTMF 5:1520
2020-01-29 13:02:26.497419 [INFO] switch_channel.c:522 RECV DTMF 5:1520
2020-01-29 13:02:26.918135 [DEBUG] switch_rtp.c:7963 RTP RECV DTMF 4:800
2020-01-29 13:02:26.918135 [INFO] switch_channel.c:522 RECV DTMF 4:800
2020-01-29 13:02:27.457415 [DEBUG] switch_rtp.c:7963 RTP RECV DTMF 0:1200
2020-01-29 13:02:27.457415 [INFO] switch_channel.c:522 RECV DTMF 0:1200
2020-01-29 13:02:27.837420 [DEBUG] switch_rtp.c:7963 RTP RECV DTMF 9:640
2020-01-29 13:02:27.837420 [INFO] switch_channel.c:522 RECV DTMF 9:640
2020-01-29 13:02:28.317417 [DEBUG] switch_rtp.c:7963 RTP RECV DTMF #:640
2020-01-29 13:02:28.317417 [INFO] switch_channel.c:522 RECV DTMF #:640
2020-01-29 13:02:28.317417 [NOTICE] switch_cpp.cpp:1443 [eavesdrop] pin is correct
2020-01-29 13:02:28.317417 [DEBUG] switch_cpp.cpp:1187 sofia/internal/105@abn3.npusa.us destroy/unlink session from object
2020-01-29 13:02:28.317417 [NOTICE] switch_core_state_machine.c:386 sofia/internal/105@abn3.npusa.us has executed the last dialplan instruction, hanging up.
2020-01-29 13:02:28.317417 [NOTICE] switch_core_state_machine.c:388 Hangup sofia/internal/105@abn3.npusa.us [CS_EXECUTE] [NORMAL_CLEARING]
2020-01-29 13:02:28.317417 [DEBUG] switch_core_state_machine.c:651 (sofia/internal/105@abn3.npusa.us) State EXECUTE going to sleep
2020-01-29 13:02:28.317417 [DEBUG] switch_core_state_machine.c:585 (sofia/internal/105@abn3.npusa.us) Running State Change CS_HANGUP (Cur 1 Tot 164)
2020-01-29 13:02:28.317417 [DEBUG] switch_ivr_async.c:1446 Stop recording file /var/lib/freeswitch/recordings/abn3.npusa.us/archive/2020/Jan/29/d9071de3-1aa5-4c51-8607-e796daf1b750.wav
2020-01-29 13:02:28.337415 [DEBUG] switch_ivr_async.c:1521 Channel is hung up
2020-01-29 13:02:28.337415 [DEBUG] switch_core_media_bug.c:1295 Removing BUG from sofia/internal/105@abn3.npusa.us
2020-01-29 13:02:28.337415 [DEBUG] switch_core_state_machine.c:848 (sofia/internal/105@abn3.npusa.us) Callstate Change ACTIVE -> HANGUP
2020-01-29 13:02:28.337415 [DEBUG] switch_core_state_machine.c:850 (sofia/internal/105@abn3.npusa.us) State HANGUP
2020-01-29 13:02:28.337415 [DEBUG] mod_sofia.c:453 Channel sofia/internal/105@abn3.npusa.us hanging up, cause: NORMAL_CLEARING
2020-01-29 13:02:28.337415 [DEBUG] mod_sofia.c:507 Sending BYE to sofia/internal/105@abn3.npusa.us
2020-01-29 13:02:28.337415 [DEBUG] switch_core_state_machine.c:60 sofia/internal/105@abn3.npusa.us Standard HANGUP, cause: NORMAL_CLEARING
2020-01-29 13:02:28.337415 [DEBUG] switch_core_state_machine.c:850 (sofia/internal/105@abn3.npusa.us) State HANGUP going to sleep
2020-01-29 13:02:28.337415 [DEBUG] switch_core_state_machine.c:620 (sofia/internal/105@abn3.npusa.us) State Change CS_HANGUP -> CS_REPORTING
2020-01-29 13:02:28.337415 [DEBUG] switch_core_state_machine.c:585 (sofia/internal/105@abn3.npusa.us) Running State Change CS_REPORTING (Cur 1 Tot 164)
2020-01-29 13:02:28.337415 [DEBUG] switch_core_state_machine.c:936 (sofia/internal/105@abn3.npusa.us) State REPORTING
2020-01-29 13:02:28.377417 [DEBUG] switch_core_state_machine.c:174 sofia/internal/105@abn3.npusa.us Standard REPORTING, cause: NORMAL_CLEARING
2020-01-29 13:02:28.377417 [DEBUG] switch_core_state_machine.c:936 (sofia/internal/105@abn3.npusa.us) State REPORTING going to sleep
2020-01-29 13:02:28.377417 [DEBUG] switch_core_state_machine.c:611 (sofia/internal/105@abn3.npusa.us) State Change CS_REPORTING -> CS_DESTROY
2020-01-29 13:02:28.377417 [DEBUG] switch_core_session.c:1726 Session 164 (sofia/internal/105@abn3.npusa.us) Locked, Waiting on external entities
2020-01-29 13:02:28.377417 [NOTICE] switch_core_session.c:1744 Session 164 (sofia/internal/105@abn3.npusa.us) Ended
2020-01-29 13:02:28.377417 [NOTICE] switch_core_session.c:1748 Close Channel sofia/internal/105@abn3.npusa.us [CS_DESTROY]
2020-01-29 13:02:28.377417 [DEBUG] switch_core_state_machine.c:739 (sofia/internal/105@abn3.npusa.us) Running State Change CS_DESTROY (Cur 0 Tot 164)
2020-01-29 13:02:28.377417 [DEBUG] switch_core_state_machine.c:749 (sofia/internal/105@abn3.npusa.us) State DESTROY
2020-01-29 13:02:28.377417 [DEBUG] mod_sofia.c:364 sofia/internal/105@abn3.npusa.us SOFIA DESTROY
2020-01-29 13:02:28.377417 [DEBUG] switch_core_state_machine.c:181 sofia/internal/105@abn3.npusa.us Standard DESTROY
2020-01-29 13:02:28.377417 [DEBUG] switch_core_state_machine.c:749 (sofia/internal/105@abn3.npusa.us) State DESTROY going to sleep
 

Attachments

  • 5712834091286528.png
    5712834091286528.png
    69 KB · Views: 30

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,388
364
83
Was 102 active with a call at the time you dialled *33102? It will hang up immediately after the pin if there is no call to eavesdrop on.
 

Andrew Byrd

Member
Feb 16, 2018
309
10
18
53
oh,ok. I thought it would stay monitoring the ext despite a call in progress. I am from the freepbx world and it would constantly monitor the entire IP , not just that one ext

Thank you
 

toolfolks

Member
May 1, 2020
73
5
8
64
Found it thanks.
For anyone else.
In the Dial Plan manager find eavesdrop, click on and change there.
 

toolfolks

Member
May 1, 2020
73
5
8
64
I am trying to implement 3 commands by sending key codes.
If I use my dial pad and dial *331009 the system asks for the pin I enter 1111 and I join the call.
If I send the code on a button click *331009,,,,1111# I still get prompted for the pin code.
I thought ',' pauses for a second so the above should send *331009 pause 4 seconds then send the pin.
However I still get asked to enter the pin.

What is the correct codes to do the following:
Listen In
Join
Finish the call ( ie actually end the call for all parties )

Also not understanding the docs

*33 <ext>EavesdropListen to the call. Press 1 remote, 2 local, 3 full conversation, 0 mute



Cheers
 

toolfolks

Member
May 1, 2020
73
5
8
64
I got the above working. In the app I initiate a call with in my app
startCall('*331009');

sleep(2000);
sendDTMFTone('1');
sendDTMFTone('1');
sendDTMFTone('1');
sendDTMFTone('1');
sendDTMFTone('#');

This allows me to join the call.

1. What are the key code to listen in only ?
2. How do I leave the call?
3. How do I end the call completely ( ie all parties end the call ) ?

Cheers
 

vespaman

Member
Jul 28, 2017
49
2
8
tried this today.

as you found I couldn't enter the *33extnpin# in one string either.

* lets you leave the call

I couldn't figure out how to end the call.
 

jeetz

Member
Oct 15, 2019
73
0
6
40
Hi,

@Adrian Fretwell can I change eavesdrop.lua to stay connected (play MOH) when the spied extension is not on call?

Would you have the lua? Do you mind sharing with me? :)

Thanks in advace.

Jeet.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,388
364
83
I cannot provide specific help like this, it would take time away from my paying customers.

To stay connected you will probably need a conference room.
My guess is that you would need to create a conference room (maybe on the fly), and then from a specific dial plan condition run some lua to originate a call to bridge the monitored extension with eavesdrop application and conference room.

I did something similar a few years ago, not with a permanently connected extension or conference room, but one that was called in autoanswer mode to monitor voicemails in real time, I also added a binding so the caller leaving the message could be intercepted by the monitoring extension. You are welcome to look at that code, but do not ask me to support it.. th elua file is called vm_call_screen.lua:

Code:
--    vm_call_screen.lua
--    FusionPBX
--    Version: MPL 1.1
--
--    The contents of this file are subject to the Mozilla Public License Version
--    1.1 (the "License"); you may not use this file except in compliance with
--    the License. You may obtain a copy of the License at
--    http://www.mozilla.org/MPL/
--
--    Software distributed under the License is distributed on an "AS IS" basis,
--    WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
--    for the specific language governing rights and limitations under the
--    License.
--
--    The Original Code is FusionPBX
--
--    The Initial Developer of the Original Code is
--    Mark J Crane <markjcrane@fusionpbx.com>
--    Copyright (C) 2010-2020
--    the Initial Developer. All Rights Reserved.
--
--    Contributor(s):
--    Adrian Fretwell <adrian@a2es.co.uk>
--
--    call this from the dialplan as a destination with voicemail extension and eavesdrop extension as parameters:
--    <extension name="vm_call_screen" continue="false" uuid="40caf546-e343-404d-9931-0364c7bc7527">
--        <condition field="destination_number" expression="^6201$">
--        <action application="lua" data="vm_call_screen.lua 201 201"/>
--        </condition>
--    </extension>


-- set up API object and get parameters
    api = freeswitch.API();
    vm_destination = argv[1];
    ev_destination = argv[2];


-- make sure the session is ready
    if ( session:ready() ) then
        -- answer the call
            session:answer();
        -- get the dialplan variables and set them as local variables
            destination_number = session:getVariable("destination_number");
            domain_name = session:getVariable("domain_name");
            sounds_dir = session:getVariable("sounds_dir");
            rtp_secure_media = session:getVariable("rtp_secure_media");
            caller_id_name = session:getVariable("caller_id_name");
            caller_id_number = session:getVariable("caller_id_number");
            sip_from_user = session:getVariable("sip_from_user");
            mute = session:getVariable("mute");

            call_uuid = session:get_uuid();

        -- set the sounds path for the language, dialect and voice
            default_language = session:getVariable("default_language");
            default_dialect = session:getVariable("default_dialect");
            default_voice = session:getVariable("default_voice");
            if (not default_language) then default_language = 'en'; end
            if (not default_dialect) then default_dialect = 'gb'; end
            if (not default_voice) then default_voice = 'rachael'; end

        -- set rtp_secure_media to an empty string if not provided.
            if (rtp_secure_media == nil) then
                rtp_secure_media = 'false';
            end


        -- set the caller id
            if (caller_id_name) then
                --caller id name provided do nothing
            else
                effective_caller_id_name = session:getVariable("effective_caller_id_name");
                caller_id_name = effective_caller_id_name;
            end

            if (caller_id_number) then
                --caller id number provided do nothing
            else
                effective_caller_id_number = session:getVariable("effective_caller_id_number");
                caller_id_number = effective_caller_id_number;
            end

            if (not vm_destination or vm_destination == "") then
                freeswitch.consoleLog("NOTICE", "[vm_call_screen] vm_destination (argv[1]) is not valid\n");
                session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/ivr/ivr-invalid_number_format.wav");
                session:hangup("INVALID_NUMBER_FORMAT");
                return;
            end
            if (not ev_destination or ev_destination == "") then
                freeswitch.consoleLog("NOTICE", "[vm_call_screen] ev_destination (argv[2]) is not valid\n");
                session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/ivr/ivr-invalid_number_format.wav");
                session:hangup("INVALID_NUMBER_FORMAT");
                return;
            end


        -- transfer the call to voicemail
        -- check to see if the user extension exists
            local cmd = "user_exists id ".. vm_destination .." "..domain_name;
            local result = api:executeString(cmd);
            if result == "true" then
                session:execute("transfer", "*99"..vm_destination.." XML "..domain_name);
            else
                freeswitch.consoleLog("NOTICE", "[vm_call_screen] unallocated number transfer "..vm_destination.." XML "..domain_name);
                session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/ivr/ivr-unallocated_number.wav");
                session:hangup("UNALLOCATED_NUMBER");
                return;
            end

            session:sleep(1000);

        -- Originate call to bridge eavesdrop extension and eavesdrop application
        -- On answer execute bind_meta_app so it will execute an intercept id *5 is pressed
            local cmd = "user_exists id ".. ev_destination .." "..domain_name;
            local result = api:executeString(cmd);
            if result == "true" then
                cmd_string = "bgapi originate {sip_auto_answer=true,sip_h_Alert-Info='Ring Answer',execute_on_answer='bind_meta_app 5 a i transfer::intercept:"..call_uuid.." inline',hangup_after_bridge=false,rtp_secure_media="..rtp_secure_media..",origination_caller_id_name='"..caller_id_name.."',origination_caller_id_number="..caller_id_number..",effective_caller_id_number="..caller_id_number..",effective_caller_id_name='"..caller_id_name.."',caller_destination="..ev_destination.."}user/"..ev_destination.."@"..domain_name.." eavesdrop:"..call_uuid.." inline";
                api:executeString(cmd_string);
            else
                freeswitch.consoleLog("NOTICE", "[vm_call_screen] unallocated number eavesdrop "..ev_destination.."@"..domain_name);
            end
            return;
    end
 
  • Like
Reactions: pksml

mehoffnm

New Member
Sep 19, 2018
1
0
1
45
Hello everyone,

I am having issues with eavesdrop. It is not working when I dial *331001. I have 3 FusionPBX's working in a cluster for HA and Failover (Behind 2 OpenSIPS proxies). I notice that the call from ext 1001 is on Node #1, but my ext tries to establish the eavesdrop call on Node #2. I see that eavesdrop.lua is called with 1001 as a parameter, and I also see the call UUID returned by eavesdrop.lua. However right after eavesdrop.lua returns the UUID, Fusion/Freeswitch goes straight to "destroy/unlink session from object."
  1. Is this the correct forum?
  2. Am I correct in my thinking that the multi-node is causing the calls to fail?
    1. If so, does anyone know a work around?
Thank you very much for your assistance.
 
Status
Not open for further replies.