« Back to Cisco JTAPI Questions

RE: JTAPI Silent Monitoring

Combination View Flat View Tree View
Threads [ Previous | Next ]
Hi-
I was wondering if anyone has any very simple examples of how to use JTAPI to trigger built-in bridge silent monitoring?  I understand that I will want to call startMonitor on a CiscoCall object, but I'm not having any luck with the code I am testing.  Any help would be appreciated.
Thanks,
Peter

You create a new CiscoCall object from the provider and call startMonitor, passing in the address and terminal objects for the initiator plus some flags.  
 
You need to check the settings on the Phone record in CUCM for a couple of things on both the supervisor (Must be in the monitoring calling search space) and the user to be monitored (built-in bridge).   Also not all phone models support it. Not supported on 7910,7912,7931,7940 & 7960.

Does the monitoring destination phone ring then, or does it need to be offhook before the startMonitor call?  I'm getting a device Out Of Service with the code I am playing around with.

I forgot to mention you also pass the terminal connection for the call you are monitoring. So a target call needs to be in progress - and I think the connection must be in the established state.
 
 

Here is the code I am trying to get working:
srcAddr = provider.getAddress("1111"); // Agent DN to be monitored
srcAddr.addCallObserver(new CallObserver() { public void callChangedEvent(CallEv[]eventList) { } });
CiscoCall aCall = ((CiscoCall) provider.getCalls()[0];
try {
 aCall.startMonitor(provider.getTerminal("SEPBADBADBADB",   // Supervisor Phone MAC
   provider.getAddress("1234"),       // Supervisor DN
   aCall.getCurrentCallingTerminal().getTerminalConnections()[0],       // Agent call to be monitored
   CiscoCall.SILENT_MONITOR,
   CiscoCall.PLAYTONE_BOTHLOCALANDREMOTE);
} catch (Exception e) {
 e.printStackTrace();
}
 
I am seeing the following exception:
 
com.cisco.jtapi.InvalidStateExceptionImpl: Did not meet pre-conditions -- call must be IDLE.
Supervisor Agent DN is IDLE, no calls in progress and Agent DN has an ACTIVE call.
Is my calling sequence on startMonitor() backwards?

I haven't tested this for a while but the call object that I call start monitor is not an already active call.
 
Eg:
 
CiscoCall monitorCall = provider.createCall();
monitorCall.startMonitor( superviserTerm, supervisorAddress,
activeCall_termCon,CiscoCall.SILENT_MONITOR,CiscoCall.PLAYTONE_LOCALONLY);
 
Where activeCall_termCon is the terminal connection for the agent on the active call.

Closer, but I'm seeing the following now:
 
2163: Feb 27 11:11:39.809 CST %JTAPI-JTAPI-7-UNKemoticonP1-rmcmuser)[(P1-rmcmuser) GCID=(1,2262750)->IDLE]Request: startMonitor ([SEPC40ACB4C8FFD/[89201199:Cluster DN Presence Allowed:1/(P1-rmcmuser) GCID=(2,3317132)->ACTIVE]->ESTABLISHED]->TALKING)
2164: Feb 27 11:11:39.809 CST %JTAPI-JTAPI-7-UNKemoticonP1-rmcmuser)[(P1-rmcmuser) GCID=(1,2262750)->IDLE]Request: startMonitor (SEPE80462EA148A, 4235 , 41752281, 89201199, SEPC40ACB4C8FFD, 1 2
2165: Feb 27 11:11:39.810 CST %JTAPI-JTAPI-7-UNK:[4235]InvalidStateExceptionImpl caught: Address is out of service

Hi,
 
Sorry not sure why it isnt working now. Reminder on the checks:
1. Correct phone models
2. Agent is established on a call
3. Supervisor phone idle
4.create new call from provider object
 
Not in a position at the moment to test my code but it has worked. If I get time I will fire it up.

When adding an Observer (provider/terminal/address) generally the app will need to wait for the corresponding 'InService' event, which indicates that the object is operational and ready to accept commands.  If the app adds an address observer and immediately attempts a command (like start monitor), then this creates a race condition where the command could be attempted before the address is operational.

Not sure that's what you are seeing, but it's a step that is sometimes overlooked.

Ok, I have this working now, but the quality is really poor on the supervising terminal.  Is this normal?  The sound quality when calling between the two terminals is 100% fine, just the observed audio stream seems to have issues with quality.

We are currently investigating an issue where certain phone/firmware combinations may be incorrectly marking the 'sequence' field in RTP packets being forked to recording services, i.e. the sequence numbers are all odd or all even - skipping sequence numbers.  This results in poor audio quality at the recorder.

If you can obtain a network packet capture of the RTP stream towards your monitoring device, you should be able to see if this is the case for you.  Feel free to attach pcap here.

Yes, it appears this is the case.  I've attached a screen cap of the packet data from wireshark.  This is between a 7962G (monitor src) and 7965G (monitor dest). Phone loads as follows: SCCP42.9-2-1S SCCP45.9-2-1S
Attachment

Attachments: capture.PNG (5.3k)

Very interesting...it looks like there is a newer firmware version available: cmterm-7942_7962-sccp.9-3-1SR2-1.cop.sgn
 
Can you reproduce using this latest load?

Yes, it seems as bad if not worse.  It almost seems like there is not enough processing power on the supervised phone to be able to send the forked audio stream or something.

Should I open a TAC case regarding these issues?  It does not appear to be related to anything I am or am not doing in the code.

If you have a CDN Developer Support contract, go ahead and open a case (regular TAC will not be able to assist as this is an API-related issue.)

We are already investigating an identical issue, so may have more information (for example a defect ID) shortly.