cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3881
Views
3
Helpful
13
Replies

JTAPI Silent Monitoring

Hi Everyone,

I have wrote a small class to implements silent monitoring, however I am getting an error while invoking start monitor and I don't know where I have gone wrong in this code.

              srcAdd = provider.getAddress("2030"); // Agent DN to be monitored

              srcAdd.addCallObserver(new CallObserver() { public void callChangedEvent(CallEv[]eventList) { } });

              CiscoCall aCall =   (CiscoCall) provider.createCall();

              System.out.println ( "Cisco Call deatils"+aCall);

            try {

             aCall.startMonitor(provider.getTerminal("faisalqa1"),provider.getAddress("2091"),

                    

                     aCall.getCurrentCallingTerminal().getTerminalConnections()[0],

                    

                     CiscoCall.SILENT_MONITOR,CiscoCall.PLAYTONE_BOTHLOCALANDREMOTE);

             System.out.println ( "Cisco Call try block"+aCall);

            } catch (Exception e) {

             e.printStackTrace();

            }

This code "aCall.getCurrentCallingTerminal().getTerminalConnections()[0]" keeps on throwing a null Pointer exception yet I have an active call on (2030) extension which I want to monitor

Someone to help

13 Replies 13

mpotluri
Level 5
Level 5

Silent monitor is done for a call on agent phone from a supervisor phone.

The third parameter in startMonitor is the terminal connection of the call on agent phone. You can monitor a call only if it is connected and media is setup. You need to find the call on the agent, make sure that the terminal connection of the agent is in TALKING state and then call startMonitor API.

If you want to monitor an incoming call to agent, add code in your call observer to create a new thread when it receives TALKING state for the terminal connection of agent Terminal and call startMonitor in the new thread.

HTH

The call to be monitored is already in Talking state on agent phone though this procedure "aCall.getCurrentCallingTerminal().getTerminalConnections()[0]" doesn't return active call on agent's terminal. Instead fires an exception. Kindly, is there something I missed out or in my code above.

aCall is a call object created by provider.createCall() and it will not have any connections till you call connect() API on it.


To get to the call on agent you need to use

srcAdd.getConnections()[0].getTerminalConnections()[0]    //if there is only one call on agent address


Try this:

aCall.startMonitor(provider.getTerminal("faisalqa1"),

                              provider.getAddress("2091"),

                              srcAdd.getConnections()[0].getTerminalConnections()[0] ,

                     CiscoCall.SILENT_MONITOR,CiscoCall.PLAYTONE_BOTHLOCALANDREMOTE);

Let us know the result.

This is currently the code snippet and I will be able to test it tomorrow and give feedback

srcAdd = makecall.provider.getAddress("2030"); // Agent DN to be monitored

                        srcAddress.addCallObserver(new CallObserver() { public void callChangedEvent(CallEv[]eventList) { } });

                        CiscoCall aCall =   (CiscoCall) makecall.provider.createCall();

                        aCall.connect ( srcAddress.getTerminals ()[0], srcAddress, destAddress );

                        System.out.println ( "Cisco Call deatils"+aCall);

                        try {

                            aCall.startMonitor(makecall.provider.getTerminal("faisalqa1"),makecall.provider.getAddress("2091"),

                                    srcAdd.getConnections()[0].getTerminalConnections()[0],

                                    CiscoCall.SILENT_MONITOR,CiscoCall.PLAYTONE_BOTHLOCALANDREMOTE);

                            System.out.println ( "Cisco Call try block"+aCall);

                           } catch (Exception e) {

                            e.printStackTrace();

                           }

Thanks

You will mostly likely see an exception if you do connect and startMonitor API calls back to back.

After you call connect API, it takes a few seconds for the call to ring the destination, get answered and for media to setup.

startMonitor will succeed only if call is answered and media is setup. You need to wait a second or 2 after you answer the aCall before calling startMonitor.

But I thought when initializing silent monitor the call should not ring at agent's phone but rather be auto-answered by the system. Because, an agent shouldn't  actually know that someone is monitoring him?No

In typical call center scenario the call is routed to an agent where it is answered. Now customer and agent are talking on say Call1.

Supervisor now wants to monitor the call. She can listen to the conversation between customer and agent by initiating silentMonitor request on behalf of her phone. This is a separate call from supervisor phone - say call2.

If you specify CiscoCall.PLAYTONE_BOTHLOCALANDREMOTE in call2.startMonitor request,  agent will hear a monitor tone periodically till supervisor hangs up. You need to use PLAYTONE_NOLOCAL_OR_REMOTE if you don't want agent to know about it.



The third parameter in call2.startMonitor should be terminal connection of agent from Call1.

HTH

This code is working now. However, the monitor call initiated by the supervisor is visible on agents end and the controls like barge in is not available on supervisor end. Is there anything else needed to be added to avail this control?

You may want to look at Feature Configuration Guide for Cisco Unified Communications Manager, Release 10.5(2) - Silent Monitoring [Cisco Unifi… for details of Silent Monitoring feature.

Monitor call should not be visible on agent phone. Is customer to agent call in connected state? How are you creating this call?

As mentioned in my previous update, you should see 2 calls: call1 between agent and customer and call2 on supervisor.

Yes, customer & agent call is connected and in Talking state on agent's Finesse screen and apart from this, monitor call is being displayed on agent machine as well (i.e 2 calls) and (another 1 call )on supervisor desktop.

This is the code that generates the silent monitor call.

srcAdd = makecall.provider.getAddress("2030"); // Agent DN to be monitored

                       

                        srcAddress.addCallObserver(new CallObserver() { public void callChangedEvent(CallEv[]eventList) { } });

                        CiscoCall aCall =   (CiscoCall) makecall.provider.createCall();

                        //aCall.connect ( srcAddress.getTerminals ()[0], srcAddress, destAddress );

                        //System.out.println ( "Cisco Call deatils"+aCall);

                       

                        try {

                            wait (2000);

                           

                            aCall.startMonitor(makecall.provider.getTerminal("faisalqa1"),makecall.provider.getAddress("2091"),

                                    srcAdd.getConnections()[0].getTerminalConnections()[0],

                                    CiscoCall.SILENT_MONITOR,CiscoCall.PLAYTONE_LOCALONLY);

                            //System.out.println ( "Cisco Call try block|"+srcAdd.getConnections()[0].getTerminalConnections()[0]+"|"+aCall);

                           } catch (Exception e) {

                            e.printStackTrace();

                           }

setCallProgressState ( false );

Kindly, Is there anything wrong?

Code looks ok. Can you attach or copy JTAPI logs from the time agent answered the call to the time after startMonitor API call?