cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

Who Me Too'd this topic

com.cisco.jtapi.InvalidStateExceptionImpl: Address is out of service

asan.lic
Level 1
Level 1

Hi. I am new in JTAPI development. I have to write custom application for my company. As a start i want to write simple call app for testing functionality of JTAPI. I created Call call object and tried its connect method but it throws Address is out of service exception. Please help me to solve this. Below is my code:

package bakcellcalltest;

import javax.telephony.events.*;

import javax.telephony.*;

import com.cisco.cti.util.Condition;

public class BakcellCallTest {

    static Provider provider;

    static Address srcAddress;

    static Address dstAddress;

    static Condition provInService = new Condition();

    static ProviderObserver po;

    static CallObserver co1, co2;

    public static void main(String[] args) {

        String providerString = "cucm_ip;login=my_login;passwd=my_pass";

        try {

            JtapiPeer peer = JtapiPeerFactory.getJtapiPeer(null);

            provider = peer.getProvider(providerString);

            provider.addObserver(po);

            if (provider != null) {

                srcAddress = provider.getAddress("2302");

                dstAddress = provider.getAddress("2307");

                srcAddress.addCallObserver(co1);

                dstAddress.addCallObserver(co2);

                provInService.waitTrue(1000);

                Call call = provider.createCall();

                provInService.set();

                call.connect(srcAddress.getTerminals()[0], srcAddress, dstAddress.getName());

            }

        } catch (Exception e) {

            e.printStackTrace();

            System.out.println(e.getMessage());

        }

    }

com.cisco.jtapi.InvalidStateExceptionImpl: Address is out of service

  at com.cisco.jtapi.IntraProviderAddress.assertValidState(IntraProviderAddress.java:1140)

  at com.cisco.jtapi.CallImpl.connect(CallImpl.java:1070)

  at com.cisco.jtapi.CallImpl.connect(CallImpl.java:1020)

Who Me Too'd this topic