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

JTAPI Silent Monitoring

Harrison Kiprono
Beginner
Beginner

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
Contributor
Contributor

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?

Please here is the JTAPI  log generated. The phone extension(2091) is for the supervisor, 8002 is for the customer and 2030 is for the agent being monitored.

Cisco Jtapi version 11.0(1.10000)-2 Release

3381: Jul 20 13:07:15.553 EAT %JTAPI-CTIIMPL-7-UNK:(P1-192.168.1.67) EventThread handling event com.cisco.cti.protocol.StopReceptionEvent[247]

3382: Jul 20 13:07:15.553 EAT %JTAPI-CTI-7-UNK:Call:[GCID=(1001217/1),CID=26782524] On Device:(P1-rmcm66) faisalqa1(1,774) StopReception MediaConnectionMode:3

3383: Jul 20 13:07:15.553 EAT %JTAPI-JTAPI-7-UNK:(P1-rmcm66) [faisalqa1] CiscoRTPInputStoppedEv [#54] Cause:100 CallCtlCause:0 CiscoCause:0 FeatReason:12

3384: Jul 20 13:07:15.553 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Originator@758f4f03]ObserverProxy.queueEvents: queuing asynchronously

3385: Jul 20 13:07:15.553 EAT %JTAPI-MISC-7-UNK:ObserverThread(wispher.Originator@758f4f03): queuing com.cisco.jtapi.JtapiTerminalEventSet

3386: Jul 20 13:07:15.553 EAT %JTAPI-CTIIMPL-7-UNK:(P1-192.168.1.67) EventThread handling event com.cisco.cti.protocol.CallStateChangedEvent_V2[248]

3387: Jul 20 13:07:15.554 EAT %JTAPI-CTI-7-UNK:(P1-rmcm66){Line:faisalqa1:2091::(1,774)|Call:[GCID=(1001217/1),CID=26782524]} CallStateChanged (V2) [state=IDLE cause=NOERROR destType=IN_CLUSTER destCM=0 fwdDest=: SecStat=1 unCg=2091 unCd= unOrigCd=2030 unLRP=2030 cg=2091 cgN= ed= edN=Monitoring 2030 orig=2030 origN= lrp=2030 lrpN=Monitoring 2030 origin=OUTBOUND reason=CALL_MONITORING activeTone=0 devN=faisalqa1 RIU=false Priv=false Select=0 CgPI=True CgNPI=True CdPI=True CdNPI=True OrigPI=True OrigNPI=True LRPPI=True LRPNPI=True UcodeCgPN= Locale=1 UcodeCdPN= Locale=1 CgIP=null CgIPv6=null LineIdDn=2030 Parti= globCg= CdNType=0 CgPNType=0 Pre=true Priority=1 UniqueIdentifier=00000000000F47010198AB3C00000000 cgHuntDN=: cdHuntDN=: cgPat=2 cdpat=3 cgVideoCap=0 cgTelepresInfo=0 cgNoScreens=-1 cdVideoCap=0 cdTelepresInfo=0 cdNoScreens=-1]

3388: Jul 20 13:07:15.554 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Receiver@27e0f2f5]ObserverProxy.deliverEvents() completed

3389: Jul 20 13:07:15.554 EAT %JTAPI-JTAPIIMPL-7-UNK:ObserverThread(wispher.Originator@758f4f03): delivering JTES[1]

3390: Jul 20 13:07:15.554 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Originator@758f4f03]ObserverProxy.deliverEvents()

3391: Jul 20 13:07:15.554 EAT %JTAPI-JTAPIIMPL-7-UNK:ObserverThread(wispher.Receiver@27e0f2f5): delivering JCES[2]

3392: Jul 20 13:07:15.554 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Receiver@27e0f2f5]ObserverProxy.deliverEvents()

3393: Jul 20 13:07:15.554 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Originator@758f4f03]delivering to terminalChangedEvent

3394: Jul 20 13:07:15.554 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Receiver@27e0f2f5]delivering to callChangedEvent

3395: Jul 20 13:07:15.554 EAT %JTAPI-JTAPIIMPL-7-UNK:(P1-rmcm66) getCallManager() Found existing CallManager

3396: Jul 20 13:07:15.555 EAT %JTAPI-JTAPIIMPL-7-UNK:{(P1-rmcm66) GCID=(1,1001217)->ACTIVE} CallManager.processCallStateChange:Handling STATE_IDLE for 2091::1

3397: Jul 20 13:07:15.555 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Originator@758f4f03]ObserverProxy.deliverEvents() completed

3398: Jul 20 13:07:15.555 EAT %JTAPI-CTI-7-UNK:{ALL EXTERNAL ADDRESSES|Call:(P1-rmcm66) GCID=(1,1001217)->ACTIVE} ExternalCallStateChanged [ state=IDLE cause=100 processEvent= reason =31 ]

3399: Jul 20 13:07:15.555 EAT %JTAPI-JTAPIIMPL-7-UNK:{(P1-rmcm66) GCID=(1,1001217)->ACTIVE} Handling External STATE_IDLE for 2030::5

3400: Jul 20 13:07:15.555 EAT %JTAPI-JTAPI-7-UNK:(P1-rmcm66) 1001217/1 ConnDisconnectedEv 2030::5 [#55] Cause:100 CallCtlCause:0 CiscoCause:0 FeatReason:31

3401: Jul 20 13:07:15.555 EAT %JTAPI-JTAPI-7-UNK:(P1-rmcm66) 1001217/1 CallCtlConnDisconnectedEv 2030::5 [#56] Cause:100 CallCtlCause:100 CiscoCause:0 FeatReason:31

3402: Jul 20 13:07:15.555 EAT %JTAPI-JTAPIIMPL-7-UNK:(P1-rmcm66) GCID=(1,1001217)->ACTIVECallManager.deliverEvents: deliver 2 events with METACODE 131

3403: Jul 20 13:07:15.556 EAT %JTAPI-JTAPI-7-UNK:[1001217/1]CallImpl.deliverEvents(): for all 2 observers

3404: Jul 20 13:07:15.556 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Originator$1@50eb08c4]ObserverProxy.queueEvents: queuing asynchronously

3405: Jul 20 13:07:15.556 EAT %JTAPI-MISC-7-UNK:ObserverThread(wispher.Originator$1@50eb08c4): queuing com.cisco.jtapi.JtapiCallEventSet

3406: Jul 20 13:07:15.556 EAT %JTAPI-JTAPI-7-UNK:[1001217/1]CallImpl.deliverEvents(): for all 2 observers

3407: Jul 20 13:07:15.556 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Originator@758f4f03]ObserverProxy.queueEvents: queuing asynchronously

3408: Jul 20 13:07:15.556 EAT %JTAPI-MISC-7-UNK:ObserverThread(wispher.Originator@758f4f03): queuing com.cisco.jtapi.JtapiCallEventSet

3409: Jul 20 13:07:15.556 EAT %JTAPI-JTAPIIMPL-7-UNK:ObserverThread(wispher.Originator@758f4f03): delivering JCES[2]

3410: Jul 20 13:07:15.556 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Originator@758f4f03]ObserverProxy.deliverEvents()

3411: Jul 20 13:07:15.556 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Originator@758f4f03]delivering to callChangedEvent

3412: Jul 20 13:07:15.557 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Receiver@27e0f2f5]ObserverProxy.deliverEvents() completed

3413: Jul 20 13:07:15.557 EAT %JTAPI-JTAPIIMPL-7-UNK:ObserverThread(wispher.Receiver@27e0f2f5): delivering JCES[5]

3414: Jul 20 13:07:15.557 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Receiver@27e0f2f5]ObserverProxy.deliverEvents()

3415: Jul 20 13:07:15.557 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Receiver@27e0f2f5]delivering to callChangedEvent

3416: Jul 20 13:07:15.557 EAT %JTAPI-JTAPI-7-UNK:(P1-rmcm66) 1001217/1 TermConnDroppedEv faisalqa1 [#57] Cause:100 CallCtlCause:0 CiscoCause:0 FeatReason:31

3417: Jul 20 13:07:15.557 EAT %JTAPI-JTAPIIMPL-7-UNK:ObserverThread(wispher.Originator$1@50eb08c4): delivering JCES[2]

3418: Jul 20 13:07:15.557 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Originator$1@50eb08c4]ObserverProxy.deliverEvents()

3419: Jul 20 13:07:15.557 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Originator$1@50eb08c4]delivering to callChangedEvent

3420: Jul 20 13:07:15.558 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Originator$1@50eb08c4]ObserverProxy.deliverEvents() completed

3421: Jul 20 13:07:15.557 EAT %JTAPI-JTAPI-7-UNK:{ CcnCall=Call:[GCID=(1001217/1),CID=26782524] TerminalConnection=[faisalqa1/[2091::1/(P1-rmcm66) GCID=(1,1001217)->ACTIVE]->ESTABLISHED]->TALKING :removing CCNCall to from TermConn ccnCallsVectorSize=0}

3422: Jul 20 13:07:15.558 EAT %JTAPI-JTAPI-7-UNK:(P1-rmcm66) 1001217/1 CallCtlTermConnDroppedEv faisalqa1 [#58] Cause:100 CallCtlCause:100 CiscoCause:0 FeatReason:31

3423: Jul 20 13:07:15.558 EAT %JTAPI-JTAPIIMPL-7-UNK:[wispher.Originator@758f4f03]ObserverProxy.deliverEvents() completed

3424: Jul 20 13:07:15.558 EAT %JTAPI-JTAPI-7-UNK:(P1-rmcm66) 1001217/1 ConnDisconnectedEv 2091::1 [#59] Cause:100 CallCtlCause:0 CiscoCause:0 FeatReason:31

3425: Jul 20 13:07:15.559 EAT %JTAPI-JTAPI-7-UNK:(P1-rmcm66) 1001217/1 CallCtlConnDisconnectedEv 2091::1 [#60] Cause:100 CallCtlCause:100 CiscoCause:0 FeatReason:31

3426: Jul 20 13:07:15.559 EAT %JTAPI-JTAPI-7-UNK:Removing reference to external addresses 2030 in partition  addrType 4 from hashtable (size=2)

3427: Jul 20 13:07:15.559 EAT %JTAPI-JTAPI-7-UNK:Removing reference to external addresses 2030 in partition  addrType 5 from hashtable (size=1)

3428: Jul 20 13:07:15.559 EAT %JTAPI-JTAPI-7-UNK:(P1-rmcm66) 1001217/1 CallInvalidEv [#61] Cause:100 CallCtlCause:0 CiscoCause:0 FeatReason:31

3429: Jul 20 13:07:15.559 EAT %JTAPI-JTAPIIMPL-7-UNK:(P1-rmcm66) GCID=(1,1001217)->INVALIDCallManager.deliverEvents: deliver 5 events with METACODE 132

3430: Jul 20 13:07:15.560 EAT %JTAPI-JTAPI-7-UNK:[1001217/1]CallImpl.deliverEvents(): for all 2 observers

(P1-rmcm66) 1001217/1 ConnDisconnectedEv 2030::5 [#55] Cause:100 CallCtlCause:0 CiscoCause:0 FeatReason:31

This event indicates that the connection is created to address 2030 of type 5 (MONITORING_TARGET). We should not be seeing this call physical phone.

The same snippet of the log you at attached only shows the call at faisalqa1:2091 going to IDLE state. It doesn't cover the events when or the call to startMonitor API.

If you are seeing the call which is used to issue startMonitor request on agents physical phone, this needs to be investigated further and you may need to raise a case with developer support team.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: