|
板凳
楼主 |
发表于 2015-11-5 17:25:16
|
只看该作者
var NEED_ANYCHAT_APILEVEL = "0"; //插件level
var mDefaultServerAddr = "demo.anychat.cn"; // 默认服务器地址
var mDefaultServerPort = 8906; // 默认服务器端口号
var mSelfUserId = -1; //用户ID
var mSelfUserName = "user01"; //用户名
var mUserType = "1"; // 用户类型 1为客户,2为坐席
var mCurrentQueueID01 = "101"; //默认队列号
var mCurrentQueueID02 = "201"; //默认队列号
var mCurrentAreaId = "10001"; //默认营业厅号
var errorcode = BRAC_InitSDK(NEED_ANYCHAT_APILEVEL);
errorcode = BRAC_Connect(mDefaultServerAddr, mDefaultServerPort);
var loginTag = BRAC_Login( mSelfUserName, "", 0);
function OnAnyChatLoginSystem(dwUserId, errorcode) {
if (errorcode == 0) {
if (mUserType == 2) {//客服
mCurrentAgentID = dwUserId;
mObjectInitFlag=ANYCHAT_OBJECT_FLAGS_AGENT;//坐席标识
}else if(mUserType==1){
mObjectInitFlag=0;//客户
}
mSelfUserId = dwUserId;
mPriority = parseInt($("#dwPrioritySelect option:selected").val());
//登陆营业厅
var enterArea = BRAC_ObjectControl(ANYCHAT_OBJECT_TYPE_AREA, mCurrentAreaId, ANYCHAT_AREA_CTRL_USERENTER, 0, 0, 0, 0, "");
alert("yingyeting"+enterArea);
//登陆队列
var enterQueue = BRAC_ObjectControl(ANYCHAT_OBJECT_TYPE_QUEUE, mCurrentQueueID01, ANYCHAT_QUEUE_CTRL_USERENTER, 0, 0, 0, 0, "");
alert("queue"+enterQueue);
if(enterQueue == 0){
}else{
BRAC_ObjectControl(ANYCHAT_OBJECT_TYPE_QUEUE, mCurrentQueueID02, ANYCHAT_QUEUE_CTRL_USERENTER, 0, 0, 0, 0, "");
}
} else {
}
} |
|