Selaa lähdekoodia

智利项目需求

weizhengliang 2 vuotta sitten
vanhempi
commit
d18a63af96
19 muutettua tiedostoa jossa 142 lisäystä ja 55 poistoa
  1. 4 6
      android_mobile/src/main/yd_w_qin2_2_chile/code/com/wdkl/ncs/android/component/home/activity/NewEventListActivity.kt
  2. 35 8
      android_mobile/src/main/yd_w_qin2_2_chile/code/com/wdkl/ncs/android/component/home/adapter/NewEventItemAdapter.kt
  3. 5 1
      android_mobile/src/main/yd_w_qin2_2_chile/code/com/wdkl/ncs/android/component/home/adapter/WatchCallRecordsItemAdapter.kt
  4. 39 1
      android_mobile/src/main/yd_w_qin2_2_chile/code/com/wdkl/ncs/android/component/home/service/WdKeepAliveService.kt
  5. 2 2
      android_mobile/src/main/yd_w_qin2_2_chile/code/com/wdkl/ncs/android/component/home/settingconfig/SettingConfig.java
  6. 7 5
      android_mobile/src/main/yd_w_qin2_2_chile/code/com/wdkl/ncs/android/component/home/ui/FragmentAudio.java
  7. 8 6
      android_mobile/src/main/yd_w_qin2_2_chile/code/com/wdkl/ncs/android/component/home/util/SpeechUtil.java
  8. 2 1
      android_mobile/src/main/yd_w_qin2_2_chile/res/layout/adapter_watch_contacts_item.xml
  9. 3 3
      android_mobile/src/main/yd_w_qin2_2_chile/res/layout/av_p2p_audio_incoming.xml
  10. 2 3
      android_mobile/src/main/yd_w_qin2_2_chile/res/layout/event_list_item.xml
  11. 2 1
      android_mobile/src/main/yd_w_qin2_2_chile/res/layout/watch_activity_event_detail.xml
  12. 8 5
      android_mobile/src/main/yd_w_qin2_2_chile/res/layout/watch_activity_home2.xml
  13. 0 1
      middleware/src/main/code/com/wdkl/ncs/android/middleware/logic/contract/home/NewEventListContract.kt
  14. 4 5
      middleware/src/main/code/com/wdkl/ncs/android/middleware/tcp/channel/DeviceChannel.java
  15. 10 0
      middleware/src/main/code/com/wdkl/ncs/android/middleware/tcp/channel/VoiceUtil.java
  16. 4 3
      resource/src/main/res/values-es/strings.xml
  17. 2 1
      resource/src/main/res/values-ru/strings.xml
  18. 3 2
      resource/src/main/res/values-zh/strings.xml
  19. 2 1
      resource/src/main/res/values/strings.xml

+ 4 - 6
android_mobile/src/main/yd_w_qin2_2_chile/code/com/wdkl/ncs/android/component/home/activity/NewEventListActivity.kt

@@ -14,9 +14,7 @@ import com.wdkl.ncs.android.component.home.databinding.ActivityEventListBinding
 import com.wdkl.ncs.android.component.home.launch.HomeLaunch
 import com.wdkl.ncs.android.component.home.service.WdKeepAliveService
 import com.wdkl.ncs.android.component.home.settingconfig.SettingConfig
-import com.wdkl.ncs.android.component.home.util.ClerkDialogHelper
-import com.wdkl.ncs.android.component.home.util.ImPlayDialogHelper
-import com.wdkl.ncs.android.component.home.util.MediaPlayHelper
+import com.wdkl.ncs.android.component.home.util.*
 import com.wdkl.ncs.android.lib.base.BaseApplication
 import com.wdkl.ncs.android.middleware.common.Constants
 import com.wdkl.ncs.android.lib.utils.AppTool
@@ -125,16 +123,16 @@ class NewEventListActivity : BaseActivity<NewEventListPresenter, ActivityEventLi
     }
 
     override fun destory() {
-//        SpeechUtil.getInstance().stopSpeak()
+        SpeechUtil.getInstance().stopSpeak()
         MediaPlayHelper.getInstance().stopMusic(true)
-        //RingPlayHelper.stopRingTone()
+        RingPlayHelper.stopRingTone()
         if (mVibrator!=null) {
             mVibrator.cancel()
         }
         Constants.eventList.clear()
     }
 
-    override fun renderData(data: ArrayList<InteractionVO>) {
+    fun renderData(data: ArrayList<InteractionVO>) {
         Log.e(TAG,"返回的数据 "+data.size)
         //data.sortByDescending { it.id }
         //srl_event_list.finishRefresh()

+ 35 - 8
android_mobile/src/main/yd_w_qin2_2_chile/code/com/wdkl/ncs/android/component/home/adapter/NewEventItemAdapter.kt

@@ -77,26 +77,30 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
                 toDeviceId = itemData.fromDeviceId
             }
             binding.eliMemberName.text = showName
+            binding.eliCallout.visibility = View.GONE
 
-            binding.eliVoiceRecorder.visibility = View.VISIBLE
+            /*binding.eliVoiceRecorder.visibility = View.VISIBLE
             binding.eliVoiceRecorder.setOnClickListener{
                 var intent = Intent(activity,VoiceMsgActivity::class.java)
                 intent.putExtra(VoiceMsgActivity.TO_DEVICE_ID,toDeviceId)
                 activity.startActivity(intent)
-            }
+            }*/
 
             when (itemData.actionType){
                 TcpType.EVENT.name->{
                     binding.eliImRead.visibility = View.GONE
                     binding.eliEventResponse.visibility = View.VISIBLE
+                    binding.eliEventResponse.setImageResource(R.drawable.icon_switch_off)
                     binding.eliEventName.text = itemData.data
                     if (itemData.actionEndMemberId!=null){
-                        binding.eliEventResponse.visibility = View.GONE
+                        binding.eliEventResponse.visibility = View.INVISIBLE
                         binding.eliEventName.setTextColor(Color.GREEN)
                     } else {
                         binding.eliEventName.setTextColor(activity.resources.getColor(R.color.warn_orange))
                         binding.eliEventResponse.setOnClickListener {
                             loadingDialog.show()
+                            //binding.eliEventResponse.setImageResource(R.drawable.icon_switch_on)
+                            binding.eliEventResponse.visibility = View.INVISIBLE
                             val tcpModel = EventUtil.eventResponse(Constants.deviceId, itemData.fromDeviceId, itemData.id)
                             val transaction: TcpCallback = object : TcpCallback(tcpModel.tid) {
                                 override fun onSuccess(jsonObject: JSONObject) {
@@ -141,11 +145,11 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
                         //binding.eliVoiceRecorder.visibility = View.GONE
                     //}
                 }
+
                 TcpType.IM.name->{
                     binding.eliEventName.setText(R.string.event_voice_msg)
-                    binding.eliEventResponse.visibility = View.GONE
+                    binding.eliEventResponse.visibility = View.INVISIBLE
                     if (itemData.actionEnd!=null){
-                        binding.eliEventResponse.visibility = View.GONE
                         binding.eliImRead.visibility = View.VISIBLE
                         binding.eliEventName.setTextColor(Color.GREEN)
 
@@ -202,18 +206,22 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
                         }
                     }
                 }
+
                 TcpType.SOS.name->{
                     binding.eliEventName.setTextColor(activity.resources.getColor(R.color.warn_orange))
                     binding.eliImRead.visibility = View.GONE
                     binding.eliEventResponse.visibility = View.VISIBLE
+                    binding.eliEventResponse.setImageResource(R.drawable.icon_switch_off)
                     binding.eliEventName.text = "SOS"
 //                    binding.eliEventName.setBackgroundResource(R.drawable.sos_96)
                     if (itemData.actionEnd!=null){
-                        binding.eliEventResponse.visibility = View.GONE
+                        binding.eliEventResponse.visibility = View.INVISIBLE
                         binding.eliEventName.setTextColor(Color.GREEN)
                     } else {
                         binding.eliEventResponse.setOnClickListener {
                             loadingDialog.show()
+                            //binding.eliEventResponse.setImageResource(R.drawable.icon_switch_on)
+                            binding.eliEventResponse.visibility = View.INVISIBLE
                             val tcpModel = OtherUtil.SOSCancel(Constants.deviceId, itemData.fromDeviceId, itemData.id)
                             val transaction: TcpCallback = object : TcpCallback(tcpModel.tid) {
                                 override fun onSuccess(jsonObject: JSONObject) {
@@ -259,13 +267,32 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
                         }
                     }
                 }
+
                 TcpType.VOICE.name->{
                     binding.eliEventName.setText(R.string.event_voice_call)
-                    binding.eliEventResponse.visibility = View.GONE
+                    if (Constants.oldEvent) {
+                        binding.eliCallout.visibility = View.VISIBLE
+                        binding.eliEventResponse.visibility = View.INVISIBLE
+                    } else {
+                        binding.eliVoiceRecorder.visibility = View.GONE
+                        binding.eliEventResponse.visibility = View.VISIBLE
+                        binding.eliEventResponse.setImageResource(R.drawable.icon_switch_off)
+                        binding.eliEventResponse.setOnClickListener {
+                            //binding.eliEventResponse.setImageResource(R.drawable.icon_switch_on)
+                            binding.eliEventResponse.visibility = View.INVISIBLE
+                            val responseTcp = VoiceUtil.voiceResponse(Constants.deviceId, itemData.fromDeviceId, itemData.id)
+                            TcpClient.getInstance().sendMsg(responseTcp.toJson())
+
+                            //移除该条记录
+                            Constants.eventList.remove(itemData)
+                            EventBus.getDefault().post(MessageEvent(responseTcp, Constants.EVENT_UPDATE_EVENT))
+                        }
+                    }
                 }
+
                 TcpType.PHONE.name->{
                     binding.eliEventName.setText(R.string.event_voice_call)
-                    binding.eliEventResponse.visibility = View.GONE
+                    binding.eliEventResponse.visibility = View.INVISIBLE
                 }
             }
 

+ 5 - 1
android_mobile/src/main/yd_w_qin2_2_chile/code/com/wdkl/ncs/android/component/home/adapter/WatchCallRecordsItemAdapter.kt

@@ -189,7 +189,11 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
                     binding.playTv.visibility = View.GONE
                     binding.treatmentStateImagev.visibility = View.GONE
                     binding.processingTimeTv.visibility = View.GONE
-
+                } else {
+                    binding.projectTv.visibility = View.GONE
+                    binding.playTv.visibility = View.GONE
+                    binding.treatmentStateImagev.visibility = View.GONE
+                    binding.processingTimeTv.visibility = View.GONE
                 }
             }
 

+ 39 - 1
android_mobile/src/main/yd_w_qin2_2_chile/code/com/wdkl/ncs/android/component/home/service/WdKeepAliveService.kt

@@ -343,6 +343,35 @@ class WdKeepAliveService : AbsWorkService() {
                 Util.wakeUpAndUnlock()
 
                 val tcpModel = messageEvent.getMessage() as TcpModel
+                if (tcpModel.getAction() === TcpAction.VoiceAction.HCALL) {
+                    //手柄呼叫以事件的方式提示
+                    eventSpeechOut(tcpModel)
+                    //震动提醒
+                    handleVibrator()
+
+                    val interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
+                    if (Constants.oldEvent) {
+                        Constants.eventList.clear()
+                    }
+                    Constants.oldEvent = false
+                    Constants.eventList.add(interactionVO)
+
+                    if (!mNewEventListActive) {
+                        Thread(Runnable {
+                            while (RecordHelper.getInstance().isRecording) {
+                                Thread.sleep(400)
+                            }
+
+                            val intent = Intent()
+                            intent.setClass(this, NewEventListActivity::class.java)
+                            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+                            startActivity(intent)
+                        }).start()
+                    } else {
+                        EventBus.getDefault().post(MessageEvent(tcpModel, Constants.EVENT_UPDATE_EVENT))
+                    }
+                }
+
                 if (tcpModel.getAction() == TcpAction.VoiceAction.SUCCESS) {
                     EventBus.getDefault().post(MessageEvent(tcpModel, 1))
                 } else if (tcpModel.getAction() == TcpAction.VoiceAction.CALL) {
@@ -841,13 +870,22 @@ class WdKeepAliveService : AbsWorkService() {
                     RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.event, false)
                 }
             }
+        } else if (model.type == TcpType.VOICE && model.action == TcpAction.VoiceAction.HCALL) {
+            val callRoom = Util.appendSpace(interactionVO.fromFrameFullName.replace("-", ""))
+            val callStr = BaseApplication.appContext.getString(R.string.voice_call_speech, callRoom)
+            val speechText = "$callStr,$callStr"
+            if (Constants.ttsState == 2) {
+                SpeechUtil.getInstance().newSpeech(speechText, false)
+            } else {
+                RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.ring_tone, false)
+            }
         }
     }
 
     private fun handleVibrator() {
         mVibrator.cancel()
         //开启振动后 等待0.1s振动 振动2s 等待1s 振动2s 等待1s
-        val pattern = longArrayOf(100, 2000, 1000, 2000)
+        val pattern = longArrayOf(100, 2000)
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
             mVibrator.vibrate(VibrationEffect.createWaveform(pattern, -1))
         } else {

+ 2 - 2
android_mobile/src/main/yd_w_qin2_2_chile/code/com/wdkl/ncs/android/component/home/settingconfig/SettingConfig.java

@@ -30,7 +30,7 @@ public class SettingConfig {
 
     public static int getLanguageId(Context context) {
         //0--auto, 1--English, 2--中文, 3--西班牙语, 4--俄语
-        return getSP(context).getInt(KEY_LANGUAGE_ID, 0);
+        return getSP(context).getInt(KEY_LANGUAGE_ID, 3);
     }
 
     public static void setLanguageId(Context context, int id) {
@@ -38,7 +38,7 @@ public class SettingConfig {
     }
 
     public static int getLanguageMode(Context context) {
-        return getSP(context).getInt(KEY_LANGUAGE_MODE, 0);
+        return getSP(context).getInt(KEY_LANGUAGE_MODE, 1);
     }
 
     public static void setLanguageMode(Context context, int mode) {

+ 7 - 5
android_mobile/src/main/yd_w_qin2_2_chile/code/com/wdkl/ncs/android/component/home/ui/FragmentAudio.java

@@ -147,7 +147,7 @@ public class FragmentAudio extends SingleCallFragment implements View.OnClickLis
             if (interactionVO.getFromDeviceId().equals(Constants.Companion.getDeviceId())) {
                 if (interactionVO.getToClerkId() == null) {
                     showName = interactionVO.getToFrameFullName() + " " + interactionVO.getToMemberName();
-                    portraitImageView.setImageResource(R.drawable.face_customer);
+                    //portraitImageView.setImageResource(R.drawable.face_customer);
                 } else {
                     showName = interactionVO.getToMemberName();
                     portraitImageView.setImageResource(R.drawable.face_clerk);
@@ -157,11 +157,13 @@ public class FragmentAudio extends SingleCallFragment implements View.OnClickLis
             else {
                 //是客户
                 if (interactionVO.getFromClerkId() == null) {
-                    showName = interactionVO.getFromFrameFullName() + " " + interactionVO.getFromMemberName();
-                    portraitImageView.setImageResource(R.drawable.face_customer);
+                    //showName = interactionVO.getFromFrameFullName() + " " + interactionVO.getFromMemberName();
+                    //portraitImageView.setImageResource(R.drawable.face_customer);
+                    showName = interactionVO.getFromFrameFullName();
 
-                    if (!isOutgoing && Constants.Companion.getUserRoleName().contains("护士") || Constants.Companion.getUserRoleName().contains("组长")) {
-                        transLinearLayout.setVisibility(View.VISIBLE);
+                    if (!isOutgoing /*&& Constants.Companion.getUserRoleName().contains("护士") || Constants.Companion.getUserRoleName().contains("组长")*/) {
+                        //transLinearLayout.setVisibility(View.VISIBLE);
+                        hangupLinearLayout.setVisibility(View.VISIBLE);
                     }
                 }
                 //是同事

+ 8 - 6
android_mobile/src/main/yd_w_qin2_2_chile/code/com/wdkl/ncs/android/component/home/util/SpeechUtil.java

@@ -49,16 +49,17 @@ public class SpeechUtil {
                 @Override
                 public void onInit(int status) {
                     if (status == TextToSpeech.SUCCESS) {
-                        int supported = textToSpeech.setLanguage(Locale.CHINESE);
+                        Locale locale = LocaleMangerUtils.getApplicationLocale();
+                        int supported = textToSpeech.setLanguage(locale);
                         if ((supported != TextToSpeech.LANG_AVAILABLE) && (supported != TextToSpeech.LANG_COUNTRY_AVAILABLE)) {
                             Constants.Companion.setTtsState(1);
-                            Log.d(TAG, "onInit: 当前不支持中文");
+                            Log.d(TAG, "onInit: 当前不支持" + locale.getLanguage());
                             if (callback != null) {
                                 callback.initFailed();
                             }
                         } else {
                             Constants.Companion.setTtsState(2);
-                            Log.d(TAG, "onInit: 支持中文");
+                            Log.d(TAG, "onInit: 支持" + locale.getLanguage());
                             if (callback != null) {
                                 callback.initSuccess();
                             }
@@ -78,16 +79,17 @@ public class SpeechUtil {
                 @Override
                 public void onInit(int status) {
                     if (status == TextToSpeech.SUCCESS) {
-                        int supported = textToSpeech.setLanguage(Locale.CHINESE);
+                        Locale locale = LocaleMangerUtils.getApplicationLocale();
+                        int supported = textToSpeech.setLanguage(locale);
                         if ((supported != TextToSpeech.LANG_AVAILABLE) && (supported != TextToSpeech.LANG_COUNTRY_AVAILABLE)) {
                             Constants.Companion.setTtsState(1);
-                            Log.d(TAG, "onInit: 当前不支持中文");
+                            Log.d(TAG, "onInit: 当前不支持" + locale.getLanguage());
                             if (callback != null) {
                                 callback.initFailed();
                             }
                         } else {
                             Constants.Companion.setTtsState(2);
-                            Log.d(TAG, "onInit: 支持中文");
+                            Log.d(TAG, "onInit: 支持" + locale.getLanguage());
                             if (callback != null) {
                                 callback.initSuccess();
                             }

+ 2 - 1
android_mobile/src/main/yd_w_qin2_2_chile/res/layout/adapter_watch_contacts_item.xml

@@ -43,7 +43,8 @@
                 android:layout_marginEnd="10dp"
                 android:layout_centerVertical="true"
                 android:layout_width="32dp"
-                android:layout_height="22dp"/>
+                android:layout_height="22dp"
+                android:visibility="gone"/>
             <Button
                 android:id="@+id/awci_btn_call_out"
                 android:layout_marginRight="10dp"

+ 3 - 3
android_mobile/src/main/yd_w_qin2_2_chile/res/layout/av_p2p_audio_incoming.xml

@@ -33,7 +33,7 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginTop="10dp"
-                android:text=""
+                android:text="@string/str_call_transfer"
                 android:textColor="@android:color/white" />
 
         </LinearLayout>
@@ -57,7 +57,7 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginTop="10dp"
-                android:text=""
+                android:text="@string/str_call_handoff"
                 android:textColor="@android:color/white" />
 
         </LinearLayout>
@@ -80,7 +80,7 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginTop="10dp"
-                android:text=""
+                android:text="@string/str_call_accept"
                 android:textColor="@android:color/white" />
 
         </LinearLayout>

+ 2 - 3
android_mobile/src/main/yd_w_qin2_2_chile/res/layout/event_list_item.xml

@@ -82,7 +82,7 @@
             android:layout_height="wrap_content"
             android:layout_marginEnd="4dp"
             android:layout_marginTop="8dp"
-            android:gravity="right"
+            android:gravity="end"
             android:orientation="horizontal">
 
             <ImageView
@@ -97,8 +97,7 @@
                 android:id="@+id/eli_callout"
                 android:layout_width="32dp"
                 android:layout_height="32dp"
-                android:src="@drawable/yu_yin_jie_ting"
-                android:visibility="gone" />
+                android:src="@drawable/yu_yin_jie_ting" />
 
             <ImageView
                 android:id="@+id/eli_event_response"

+ 2 - 1
android_mobile/src/main/yd_w_qin2_2_chile/res/layout/watch_activity_event_detail.xml

@@ -108,7 +108,8 @@
                     android:layout_height="wrap_content"
                     android:layout_gravity="left|center_vertical"
                     android:layout_marginLeft="4dp"
-                    android:background="@drawable/yu_yin_jie_ting" />
+                    android:background="@drawable/yu_yin_jie_ting"
+                    android:visibility="gone"/>
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"

+ 8 - 5
android_mobile/src/main/yd_w_qin2_2_chile/res/layout/watch_activity_home2.xml

@@ -28,6 +28,7 @@
                     android:layout_height="match_parent"
                     android:layout_weight="1"
                     android:background="#00B5DC"
+                    android:padding="6dp"
                     android:gravity="center"
                     android:orientation="vertical">
 
@@ -53,6 +54,7 @@
                     android:layout_height="match_parent"
                     android:layout_weight="1"
                     android:background="#E56D37"
+                    android:padding="6dp"
                     android:gravity="center"
                     android:orientation="vertical">
 
@@ -106,6 +108,7 @@
                         android:layout_width="match_parent"
                         android:layout_height="match_parent"
                         android:layout_below="@id/view_center_line"
+                        android:padding="6dp"
                         android:gravity="center"
                         android:background="#F78B8F"
                         android:orientation="vertical">
@@ -133,6 +136,7 @@
                         android:layout_width="match_parent"
                         android:layout_height="match_parent"
                         android:layout_above="@id/channel_im_layout"
+                        android:padding="6dp"
                         android:gravity="center"
                         android:orientation="vertical"
                         android:background="#5CB615">
@@ -172,7 +176,8 @@
                             android:layout_height="wrap_content"
                             android:layout_marginTop="6dp"
                             android:textColor="#ffffff"
-                            android:textSize="14sp" />
+                            android:textSize="14sp"
+                            android:visibility="gone"/>
                     </LinearLayout>
                 </RelativeLayout>
 
@@ -292,8 +297,7 @@
                                 android:id="@+id/sip_state_tv"
                                 android:layout_width="8dp"
                                 android:layout_height="8dp"
-                                android:background="#FF0000"
-                                 />
+                                android:background="#FF0000" />
 
                             <ImageView
                                 android:layout_width="wrap_content"
@@ -307,8 +311,7 @@
                                 android:text="@string/reconnect"
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
-                                android:textColor="@color/warn_orange"
-                                />
+                                android:textColor="@color/warn_orange" />
 
                         </LinearLayout>
 

+ 0 - 1
middleware/src/main/code/com/wdkl/ncs/android/middleware/logic/contract/home/NewEventListContract.kt

@@ -6,7 +6,6 @@ import com.wdkl.ncs.android.middleware.model.vo.InteractionVO
 
 interface NewEventListContract {
     interface View : BaseContract.BaseView{
-        fun renderData(data : ArrayList<InteractionVO>)
 
         fun showClerks(clerks: ArrayList<ClerkDO>)
 

+ 4 - 5
middleware/src/main/code/com/wdkl/ncs/android/middleware/tcp/channel/DeviceChannel.java

@@ -31,14 +31,16 @@ public class DeviceChannel {
                 if (tcpModel.getAction()==TcpAction.VoiceAction.SUCCESS) {
                     Log.e(TAG, "call success 1111111");
                     EventBus.getDefault().post(new MessageEvent(tcpModel, Constants.EVENT_NEW_TCP));
-                    //EventBus.getDefault().post(new MessageEvent(tcpModel, 1));
+                } else if(tcpModel.getAction() == TcpAction.VoiceAction.HCALL) {
+                    EventBus.getDefault().post(new MessageEvent(tcpModel, Constants.EVENT_NEW_TCP));
+                    responseTcpModel = VoiceUtil.voiceSuccess(tcpModel.getTid(), tcpModel.getToId(), tcpModel.getFromId());
+                    return responseTcpModel;
                 } else if(tcpModel.getAction() == TcpAction.VoiceAction.CALL){
                     if (calling) {
                         Log.d(TAG,"通话中,来电 " + tcpModel.getFromId() + "<>" + callId);
                         //相同来源,重新建立通话
                         if (tcpModel.getFromId().equals(callId)){
                             EventBus.getDefault().post(new MessageEvent(tcpModel, Constants.EVENT_NEW_TCP));
-                            //EventBus.getDefault().post(new MessageEvent(tcpModel, 11));
                         } else {
                             InteractionVO interactionVO = new Gson().fromJson(tcpModel.getData().toString(), InteractionVO.class);
                             responseTcpModel = VoiceUtil.voiceCalling(tcpModel.getTid(), Constants.Companion.getDeviceId(), tcpModel.getFromId(), interactionVO.getId());
@@ -47,7 +49,6 @@ public class DeviceChannel {
                         }
                     } else { //得到通话
                         EventBus.getDefault().post(new MessageEvent(tcpModel, Constants.EVENT_NEW_TCP));
-                        //EventBus.getDefault().post(new MessageEvent(tcpModel, 1));
                         responseTcpModel = VoiceUtil.voiceSuccess(tcpModel.getTid(), tcpModel.getToId(), tcpModel.getFromId());
                         return responseTcpModel;
                     }
@@ -69,12 +70,10 @@ public class DeviceChannel {
                                     e.printStackTrace();
                                 }
                                 EventBus.getDefault().post(new MessageEvent(tm, Constants.EVENT_NEW_TCP));
-                                //EventBus.getDefault().post(new MessageEvent(tm, 2));
                             }
                         }).start();
                     } else {
                         EventBus.getDefault().post(new MessageEvent(tcpModel, Constants.EVENT_NEW_TCP));
-                        //EventBus.getDefault().post(new MessageEvent(tcpModel, 2));
                     }
                 }
                 break;

+ 10 - 0
middleware/src/main/code/com/wdkl/ncs/android/middleware/tcp/channel/VoiceUtil.java

@@ -30,6 +30,16 @@ public class VoiceUtil {
 //    }
 
 
+    public static TcpModel voiceResponse(Integer fromId, Integer toId,Integer InteractionId){
+        TcpModel tcpModel = new TcpModel(null);
+        tcpModel.setType(TcpType.VOICE);
+        tcpModel.setAction(TcpAction.VoiceAction.HRESPONSE);
+        tcpModel.setFromId(fromId);
+        tcpModel.setToId(toId);
+        tcpModel.setData(InteractionId);
+        return tcpModel;
+    }
+
     public static TcpModel voiceAccept(String tid, Integer fromId, Integer toId, Integer interactionId){
         TcpModel tcpModel = new TcpModel(tid);
         tcpModel.setType(TcpType.VOICE);

+ 4 - 3
resource/src/main/res/values-es/strings.xml

@@ -79,7 +79,7 @@
     <string name="call_success">Llamada exitosa</string>
     <string name="call_in_calling">Llamando…</string>
     <string name="call_connecting">Conectando…</string>
-    <string name="call_in_call">Conectado…</string>
+    <string name="call_in_call">En llamada…</string>
     <string name="call_disconnect">Desconectar</string>
     <string name="call_error">Error de conexión</string>
     <string name="call_reject">Rechazar</string>
@@ -87,9 +87,10 @@
     <string name="call_incoming">llamada.</string>
     <string name="call_failed">Error de llamada</string>
     <string name="call_end">Fin de llamada</string>
+    <string name="str_call_accept">Aceptar</string>
+    <string name="str_call_transfer">Traslado</string>
     <string name="str_call_mute">Silencio</string>
-    <string name="str_call_handoff">Transferencia</string>
-    <string name="str_call_accept">Respuesta</string>
+    <string name="str_call_handoff">Cuelga</string>
     <string name="str_call_speaker">Altavoz</string>
     <string name="voice_call_speech">%s llamando</string>
 

+ 2 - 1
resource/src/main/res/values-ru/strings.xml

@@ -86,9 +86,10 @@
     <string name="call_incoming">звонок.</string>
     <string name="call_failed">Ошибка вызова</string>
     <string name="call_end">Завершение вызова</string>
+    <string name="str_call_accept">Ответ</string>
+    <string name="str_call_transfer">Transfer</string>
     <string name="str_call_mute">Отключить звук</string>
     <string name="str_call_handoff">Переключение</string>
-    <string name="str_call_accept">Ответ</string>
     <string name="str_call_speaker">Speaker</string>
     <string name="voice_call_speech">%s Звать</string>
     <string name="countdown_time">%ds</string>

+ 3 - 2
resource/src/main/res/values-zh/strings.xml

@@ -87,9 +87,10 @@
     <string name="call_incoming">来电.</string>
     <string name="call_failed">对方离线或不存在,呼叫失败</string>
     <string name="call_end">通话结束</string>
+    <string name="str_call_accept">接听</string>
+    <string name="str_call_transfer">转接</string>
     <string name="str_call_mute">静音</string>
     <string name="str_call_handoff">挂断</string>
-    <string name="str_call_accept">接听</string>
     <string name="str_call_speaker">免提</string>
     <string name="voice_call_speech">%s呼叫</string>
 
@@ -164,7 +165,7 @@
     <string name="tts_init_failed">异常</string>
 
     <string name="event_voice_msg">语音留言</string>
-    <string name="event_voice_call">呼叫</string>
+    <string name="event_voice_call">通话</string>
     <string name="event_undo">未处理</string>
     <string name="event_responded">已响应</string>
     <string name="device_change_check">是否确认切换?</string>

+ 2 - 1
resource/src/main/res/values/strings.xml

@@ -87,9 +87,10 @@
     <string name="call_incoming">Incoming call.</string>
     <string name="call_failed">Call error</string>
     <string name="call_end">Call end</string>
+    <string name="str_call_accept">Accept</string>
+    <string name="str_call_transfer">Transfer</string>
     <string name="str_call_mute">Mute</string>
     <string name="str_call_handoff">Handoff</string>
-    <string name="str_call_accept">Accept</string>
     <string name="str_call_speaker">Speaker</string>
     <string name="voice_call_speech">%s calling</string>