|
@@ -32,7 +32,7 @@ public class DeviceChannel {
|
|
|
|
|
|
//Log.e(TAG,"DeviceChannel tcp: " + tcpModel.toJson() + ", calling: " + calling);
|
|
|
|
|
|
- switch (tcpModel.getType()){
|
|
|
+ switch (tcpModel.getType()) {
|
|
|
case VOICE:
|
|
|
if (tcpModel.getAction()== TcpAction.VoiceAction.CALL || tcpModel.getAction()== TcpAction.VoiceAction.VCALL
|
|
|
|| tcpModel.getAction()== TcpAction.VoiceAction.HCALL) { //语音呼入
|
|
@@ -53,9 +53,9 @@ public class DeviceChannel {
|
|
|
return responseTcpModel;
|
|
|
}*/
|
|
|
|
|
|
- responseTcpModel = VoiceUtil.voiceSuccess(tcpModel.getTid(), tcpModel.getToId(), tcpModel.getFromId());
|
|
|
+ //responseTcpModel = VoiceUtil.voiceSuccess(tcpModel.getTid(), tcpModel.getToId(), tcpModel.getFromId());
|
|
|
EventBus.getDefault().post(new MessageEvent(tcpModel, Constants.EVENT_TCP_MSG));
|
|
|
- return responseTcpModel;
|
|
|
+ //return responseTcpModel;
|
|
|
} else if (tcpModel.getAction()== TcpAction.VoiceAction.ACCEPT){ //我方呼出,对方接受
|
|
|
//todo: 通话中界面更新;建立数据通话
|
|
|
EventBus.getDefault().post(new MessageEvent(tcpModel, Constants.EVENT_TCP_MSG));
|
|
@@ -124,6 +124,7 @@ public class DeviceChannel {
|
|
|
break;
|
|
|
case IM:
|
|
|
if (tcpModel.getAction()== TcpAction.IMAction.MSG){
|
|
|
+ responseTcpModel = ImUtil.imReceived(tcpModel);
|
|
|
//todo: 从接口重新获取左侧数据;使用通话中界面,显示有语音留言,停留3秒,结束至正常界面
|
|
|
EventBus.getDefault().post(new MessageEvent(tcpModel, Constants.EVENT_TCP_MSG));
|
|
|
} else if (tcpModel.getAction()== TcpAction.IMAction.MSG_READ){ //语音已读取
|
|
@@ -132,17 +133,16 @@ public class DeviceChannel {
|
|
|
}
|
|
|
break;
|
|
|
case EVENT:
|
|
|
- if (tcpModel.getAction()== TcpAction.EventAction.KEY_CLICK){ //有新事件过来
|
|
|
+ if (tcpModel.getAction()== TcpAction.EventAction.KEY_CLICK) { //有新事件过来
|
|
|
+ responseTcpModel = EventUtil.eventReceived(tcpModel);
|
|
|
//todo: 服务端通过data给出具体的事件名称放置data。从接口重新获取左侧数据;使用通话中界面,显示事件名称,停留3秒,结束至正常界面
|
|
|
- Log.e(TAG,"收到事件tcp");
|
|
|
- EventBus.getDefault().post(new MessageEvent(tcpModel, Constants.EVENT_TCP_MSG));
|
|
|
-
|
|
|
- } else if (tcpModel.getAction()== TcpAction.EventAction.RESPONSE){ //事件已处理,仅分机用
|
|
|
+ } else if (tcpModel.getAction()== TcpAction.EventAction.RESPONSE) { //事件已处理,仅分机用
|
|
|
//todo: 从data得到事件id,使用通话中界面,显示事件名称及已响应字样,停留3秒,结束至正常界面;更新左侧
|
|
|
- Log.e(TAG,"");
|
|
|
- EventBus.getDefault().post(new MessageEvent(tcpModel, Constants.EVENT_TCP_MSG));
|
|
|
- Log.e(TAG,"收到事件已处理tcp");
|
|
|
+ Log.d(TAG,"收到事件已处理tcp");
|
|
|
+ } else if(tcpModel.getAction() == TcpAction.EventAction.CANCEL) { //收到取消
|
|
|
+ responseTcpModel = EventUtil.eventCancelReceived(tcpModel); //返回确认收到取消
|
|
|
}
|
|
|
+ EventBus.getDefault().post(new MessageEvent(tcpModel, Constants.EVENT_TCP_MSG));
|
|
|
break;
|
|
|
case DATA:
|
|
|
case DEVICE:
|