首頁(yè)>>廠商>>CT中間件廠商>>朗深技術(shù)

UniMedia MSIX座席Jar包用Java調(diào)用實(shí)例解析

2009/05/31

目標(biāo)功能

  在Java應(yīng)用中實(shí)現(xiàn)來(lái)話(huà)通知和電話(huà)應(yīng)答。

Java調(diào)用實(shí)例

package MsiDemo;
import javax.swing.*;
import lioncen.cti.jmsi.*;
import lioncen.cti.jmsi.object.*;
import lioncen.cti.jmsi.engine.*;

public class MsiDemo extends JFrame
{
private JButton jButtonInit = null;
private JButton jButtonLogin = null;
private JButton jButtonAnswer = null;

public static MSI msi = null;
public static MsiDemo msiDemo = null;

public MsiDemo()
{
super();

this.setTitle("Msi Demo");
this.setLocation(200, 200);
this.setSize(300, 200);

JPanel jContentPane = new JPanel();
jContentPane.add(getJButtonInit());
jContentPane.add(getJButtonLogin());
jContentPane.add(getJButtonAnswer());
this.setContentPane(jContentPane);

this.addWindowListener(new java.awt.event.WindowAdapter()
{
public void windowClosing(java.awt.event.WindowEvent e)
{
System.exit(0);
}
};
}

public static void main(String[] args)
{
msi = new MSI();
MSI.msiLog.setDebug(true);
msi.ctiEventListener = new MyMSIEventHandler();

msiDemo = new MsiDemo();
msiDemo.setVisible(true);
}

private JButton getJButtonLogin()
{
if (jButtonLogin == null)
{
jButtonLogin = new JButton();
jButtonLogin.setText("Login");
jButtonLogin.addActionListener(
new java.awt.event.ActionListener()
{
public void actionPerformed(
java.awt.event.ActionEvent e)
{
int ret = msi.login(1000, true, false,
"2000", "5", "xms", "");
if (ret == CTIConst.RET_FAIL)
{
System.out.println("登錄失敗:"
+ msi.getLastErrorString());
}
else
{
System.out.println("登錄成功!");
}
}
});
}
return jButtonLogin;
}

private JButton getJButtonInit()
{
if (jButtonInit == null)
{
jButtonInit = new JButton();
jButtonInit.setText("Init");
jButtonInit.addActionListener(
new java.awt.event.ActionListener()
{
public void actionPerformed(
java.awt.event.ActionEvent e)
{
msi.setConnInfo("192.168.1.1", 10089);
msi.setDN("1000");
msi.start();
}
});
}
return jButtonInit;
}

private JButton getJButtonAnswer()
{
if (jButtonAnswer == null)
{
jButtonAnswer = new JButton();
jButtonAnswer.setText("Answer");
jButtonAnswer.addActionListener(
new java.awt.event.ActionListener()
{
public void actionPerformed(
java.awt.event.ActionEvent e)
{
int ret = msi.setHookStatus(2);
if (ret == CTIConst.RET_FAIL)
{
System.out.println("摘機(jī)失敗:"
+ msi.getLastErrorString());
}
else
{
System.out.println("摘機(jī)成功!");
}
}
});
}
return jButtonAnswer;
}

}


class MyMSIEventHandler extends MSIEventAdapter
{
public void callIncome(String AlertingDN, String CallingDN, String CalledDN, String UUD)
{
System.out.println("來(lái)電話(huà)了!");
}
}

說(shuō)明:

  1. 先初始化控件,然后登錄座席,登錄成功后打內(nèi)線電話(huà)1000或通過(guò)ACD分配到1000,應(yīng)答來(lái)話(huà)即可;

  2. SetConnInfo/SetDN/Start等函數(shù)都有返回值,可以判斷是否成功;

  3. 具體API以及事件的用法請(qǐng)參考開(kāi)發(fā)文檔。

CTI論壇報(bào)道



相關(guān)閱讀:
UniMedia 中間件典型應(yīng)用-外線座席呼叫中心 2009-09-23
UniMedia IDE集成環(huán)境訪問(wèn)網(wǎng)絡(luò)服務(wù)器實(shí)例解析 2009-09-23
UniMedia MSIX座席控件Javascript調(diào)用實(shí)例 2009-09-23
基于UniMedia融合媒體中間件的企業(yè)通信平臺(tái) 2009-07-27
PBX常用功能 2009-06-10
新密市| 蒲城县| 南开区| 临沧市| 永州市| 牡丹江市| 玉环县| 元江| 雅江县| 日照市| 深圳市| 台北市| 沾益县| 马尔康县| 嘉定区| 黎川县| 偏关县| 青浦区| 普兰县| 类乌齐县| 崇明县| 金溪县| 涡阳县| 牙克石市| 卢湾区| 富锦市| 长白| 田东县| 辽中县| 沧州市| 高密市| 梨树县| 金塔县| 鲜城| 平顺县| 临清市| 延长县| 沂水县| 临清市| 杭州市| 项城市|