Re: CallControlCall.transfer(CallControlCall) not working

Jörg Wiesmann <[email protected]> Tue, 21 Mar 2006 09:12:20 +0100
Newsgroups gmane.comp.java.sun.jtapi
Message-ID <[email protected]>
if you just want to transfer a call, you may try this:

    public void transferCall(CallControlConnection connectionMaster,
String numberToTransferTo) {

        if (observedAddress.getConnections() != null &&
observedAddress.getConnections()[0].getState() == Connection.CONNECTED) {
            CiscoCall callMaster = (CiscoCall)
observedAddress.getConnections()[0].getCall();
            CiscoCall callCreateNew;
            try {
                callCreateNew = (CiscoCall) provider.createCall();
                try {
                    ((CallControlTerminalConnection)
observedAddress.getTerminals()[0].getTerminalConnections()[0]).hold();
                    ((CiscoConnection)
observedAddress.getConnections()[0]).redirect(numberToTransferTo,
CiscoConnection.REDIRECT_NORMAL,
                            CiscoConnection.ADDRESS_SEARCH_SPACE);
                    // callCreateNew.transfer(callMaster);
                } catch (Exception e) {
                    TerminalConnection terminalNewCreated =
observedAddress.getTerminals()[0].getTerminalConnections()[0];
                    if (callMaster.getConferenceController() == null) {


callMaster.setConferenceController(terminalNewCreated);
                        callCreateNew.setTransferEnable(true);
                    }
                    callCreateNew.consult(terminalNewCreated,
numberToTransferTo);
                    callMaster.transfer(callCreateNew);
                }
            } catch (Exception e) {
                Logger.getLogger(this.getClass()).warn("Transfer failed
created " + e);
            }
        } else {
            Logger.getLogger(this.getClass()).info("Connection must be
established to transfer a call");
        }
    }

hope this helps
greets Jörg Wiesmann

Paul Yago wrote:
>
> Hello, does anyone have any ideas why this fails:
>
>
>
> I'm using Cisco's implementation of jtapi with their 4.0.3 release.
> Jtapi 1.2.
>
> The original call is coming in through a CTI port extension.
>
> 8001 is the extension of a SCCP phone.
>
>
>
> I'm attempting the following, where call2 is an existing call.
>
>
>
> CallControlCall consultCall = (CallControlCall)jtapiProvider.createCall();
>
> consultCall.consult(tc, "8001");
>
>
>
> Thread.sleep(5000); // calling sleep to give the called party time to
> answer.
>
>
>
> consultCall.transfer(call2);
>
>
>
>
>
> I keep getting the following during the transfer() call.
>
> com.cisco.jtapi.InvalidStateExceptionImpl: Did not meet pre-conditions.
>
>
>
>
>
> However the following pre-conditions are all met:
>
>
>
> //                    Check for preconditions
>
> //                    Let tc1 be the transfer controller on this Call
>
> //                    Let tc2 be the transfer controller on otherCall
>
> //                    this != otherCall
>
> //                    (this.getProvider()).getState() ==
> Provider.IN_SERVICE
>
> //                    this.getState() == Call.ACTIVE
>
> //                    otherCall.getState() == Call.ACTIVE
>
> //                    tc1.getCallControlState() ==
> CallControlTerminalConnection.TALKING or
> CallControlTerminalConnection.HELD
>
> //                    tc2.getCallControlState() ==
> CallControlTerminalConnection.TALKING or
> CallControlTerminalConnection.HELD
>
> ===========================================================================
> 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".
> ===========================================================================
> 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".


===========================================================================
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".