2017-03-05 3 views
1

Ich bin neu in JTAPI Ich installiere Cisco Client und teste es. und alle Dinge waren alright.Then ich entscheiden, Code zu schreiben, ein Telefon über JTAPI anrufen und ich bekam die folgende Ausnahme:jtapi Adresse ist außer Betrieb Fehler

„Adresse ist außer Betrieb“

Ich kann nicht verstehen, wo das Problem ist

Hier ist der Code:

public static final void main(String args[]) { 
    String providerName = "192.168.10.60"; 

      String login = "sajjad"; 

      String passwd = "sajjad"; 

       String providerString = providerName + ";login=" + login + ";passwd=" + passwd; 

/* 
* Create a provider by first obtaining the default implementation of 
* JTAPI and then the default provider of that implementation. 
*/ 
Provider myprovider = null; 
try { 
    JtapiPeer peer = JtapiPeerFactory.getJtapiPeer(null); 
    myprovider = peer.getProvider(providerString); 
} catch (Exception excp) { 
    System.out.println("Can't get Provider: " + excp.toString()); 
    System.exit(0); 
} 
System.out.println("Provider: " + myprovider.toString()); 

Address origaddr = null; 
Terminal origterm = null; 
try { 
    origaddr = myprovider.getAddress("101"); 
    System.out.println(origaddr.getName()); 

    /* Just get some Terminal on this Address */ 
    Terminal[] terminals = origaddr.getTerminals(); 
    if (terminals == null) { 
    System.out.println("No Terminals on Address."); 
    System.exit(0); 
    } 
    origterm = terminals[0]; 
    System.out.println("terminal " + java.util.Arrays.toString(terminals)); 
} catch (Exception excp) { 
    System.out.println("No Terminals " + excp.toString()); 
} 


    /* 
* Create the telephone call object and add an observer. 
*/ 
Call mycall = null; 
try { 
    mycall = myprovider.createCall(); 
    System.out.println("my call " + mycall); 
    mycall.addObserver(new MyOutCallObserver()); 

} catch (Exception excp) { 
    System.out.println("No call " + excp.toString()); 
} 

try { 
    //here is the exception 
    Connection c[] = mycall.connect(origterm, origaddr, "105"); 


} catch (Exception excp) { 

    System.out.println("No calling " + excp.toString()); 
} 

und der Ausgang:

Provider: (P1-sajjad) 
101 
terminal [SEP001A2F49026D] 
my call (P1-sajjad) GCID=(1,2106)->IDLE 
No calling com.cisco.jtapi.InvalidStateExceptionImpl: Address is out of service 

Jede Hilfe wird geschätzt

Antwort

0

Wenn Sie es noch nicht herausgefunden haben, stellen Sie sicher, dass das Telefon mit 101 als Adresse online ist und korrekt mit dem Cisco Call Manager verbunden ist. Stellen Sie außerdem sicher, dass Ihr Anwendungsbenutzer Zugriff auf das Telefon hat (setzen Sie es in kontrollierte Geräte in der Konfiguration des Benutzers)

Verwandte Themen