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

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

2009/05/31

目標功能

  在Java應(yīng)用中實現(xiàn)來話通知和電話應(yīng)答。

Java調(diào)用實例

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("摘機失敗:"
+ msi.getLastErrorString());
}
else
{
System.out.println("摘機成功!");
}
}
});
}
return jButtonAnswer;
}

}


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

說明:

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

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

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

CTI論壇報道



相關(guān)閱讀:
UniMedia 中間件典型應(yīng)用-外線座席呼叫中心 2009-09-23
UniMedia IDE集成環(huán)境訪問網(wǎng)絡(luò)服務(wù)器實例解析 2009-09-23
UniMedia MSIX座席控件Javascript調(diào)用實例 2009-09-23
基于UniMedia融合媒體中間件的企業(yè)通信平臺 2009-07-27
PBX常用功能 2009-06-10
旺苍县| 松桃| 锡林郭勒盟| 那曲县| 巴林左旗| 桓台县| 贵阳市| 建昌县| 武强县| 全椒县| 梁山县| 青神县| 梧州市| 越西县| 达尔| 新和县| 牟定县| 贞丰县| 富民县| 改则县| 扬州市| 曲沃县| 镇雄县| 福州市| 玉树县| 镇平县| 城固县| 兰溪市| 安丘市| 汝城县| 河东区| 淮阳县| 卓尼县| 右玉县| 凤台县| 仪陇县| 南郑县| 周至县| 无极县| 凉山| 玉树县|