answer call on CTI Routepoint
Stephan Steiner <[email protected]>
| Newsgroups | gmane.comp.java.sun.jtapi |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
Hi
This is basically about the same subject as my previous mails, but a whole
different problem so I figured I start a new thread.
My CTI Routepoint is registered as follows:
term = (CiscoRouteTerminal)p.getTerminal(name);
CiscoMediaCapability [] caps = new CiscoMediaCapability[1];
caps[0] = new CiscoG711MediaCapability ();
term.register(caps, CiscoRouteTerminal.DYNAMIC_MEDIA_REGISTRATION);
Upon getting a CallCtlConnAlertingEv (ev), I do the following:
CallControlConnection ccc =
(CallControlConnection)((CallCtlConnAlertingEv)ev).getConnection();
TerminalConnection[] tcs = ccc.getTerminalConnections();
TerminalConnection tc = ccc.getTerminalConnections()[0];
tcr.incomingTC = (CiscoTerminalConnection)tc;
tcr.incomingTC.answer();
tcr.incomingTC.hold();
I registered a TerminalObserver, which when catch a
CiscoMediaOpenLogicalChannelEv event does the following:
CiscoMediaOpenLogicalChannelEv c = (CiscoMediaOpenLogicalChannelEv)ev;
CiscoRTPHandle crh = c.getCiscoRTPHandle();
CiscoProvider cprov = (CiscoProvider)prov;
CiscoRTPParams crp = new CiscoRTPParams(this.ipAddr, this.port);
try
{
term.setRTPParams(crh, crp);
}
catch (Exception e){}
I think that should cover about everything. However, the hold method fails
with yet another internal JTAPI error that doesn't make any sense:
PlatFormExceptionImpl: unhandled com.cisco.cti.client.CCNException
So I figured, let's give the poor guy a bit of time while it sets the RTP
parameters and put the hold command to only be executed in a later event (I
make some outgoing calls from the Routepoint and one is picked up I trigger
more activity). And indeed, that helps. But, after putting the incoming call
on hold (and actually hearing the MOH) and after the RTP parameters for the
call that has just been picked up have been set, I try to transfer the two
calls together. If I don't set the transfercontroller on both calls, I get
an InvalidStateException stating that no transfer controller was set and
none could be determined (weird, but okay), but if I set the
transfercontroller, I get another CCNException.
Here's the respective code:
(incomingTC is the CiscoTerminalConnection of the incoming call at the
Routepoint)
tcr.incomingTC.hold(); // that works -> triggers moh
Connection[] cons = call.getConnections();
TerminalConnection[] tcs = cons[0].getTerminalConnections();
CallControlTerminalConnection cctc1 = (CallControlTerminalConnection)tcs[0];
tcr.incomingCall.setTransferController(tcr.incomingTC);
call.setTransferController(cctc1);
call.transfer(tcr.incomingCall);
System.out.println("transfer successful");
(try/catch left out). call.transfer triggers the CCNException and that's
that. Since the RTP parameters have been set up for both calls prior to
trying to make the transfer, I'm at a loss to explain the exception (which
is undocumented so I figure it should never be seen by non Cisco programmers
anyway).
Ideas would be much welcome.
Regards
Stephan
===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JTAPI-INTEREST". For general help, send email to
[email protected] and include in the body of the message "help".