0
我有代碼:不穩定得到結果
CiscoJtapiPeer peer = (CiscoJtapiPeer) JtapiPeerFactory.getJtapiPeer(null);
CiscoProvider provider = (CiscoProvider) peer.getProvider(host+";login="+ login +";passwd=" + pass);
provider.addObserver(new ProviderObserver() {
@Override
public void providerChangedEvent (ProvEv [] eventList) {
if (eventList == null) return;
for (int i = 0; i < eventList.length; ++i) {
if (eventList[i] instanceof ProvInServiceEv) {
inService.set();
}
}
}
});
inService.waitTrue();
System.out.println("In servise.");
CiscoAddress srcAddr = (CiscoAddress) provider.getAddress(dn);
srcAddr.addCallObserver(new MyCallControlCallObserver(dn, provider))
和觀察員的地址:
@Override
public void callChangedEvent(CallEv[] evlist)throws Exception{
for (CallEv evlist1 : evlist) {
if (evlist1.getID() == CiscoTermConnRecordingEndEv.ID) {
call = provider.getCall(callid);
if (call != null) {
System.out.println("From: " + call.getCallingAddress() + " To: " + call.getCalledAddress());
}
else {System.out.println("Call is null");}
}
}
}
功能provider.getCall(呼叫ID)返回的對象不是穩定。像這樣 -
From: 4403 To: 5215
Call is null
Call is null
From: 4403 To: 5215
From: 4403 To: 5215
Call is null
Call is null
From: 4403 To: 5215
通話間隔5-15秒,持續時間3-7秒。我試圖改變處理事件 - 相同的結果。 我在做什麼錯?也許這是由於CUCM是一個集羣?每次通話都有不同的CiscoProvider?
我試圖使用兩個提供程序(在每個節點集羣上) - 相同的結果。 – Slot555