Browse Source

卡尔主机无服务器sip版本

weizhengliang 1 year ago
parent
commit
71e67d0e37
20 changed files with 508 additions and 97 deletions
  1. 60 19
      android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/activity/NurseHomeActivity.kt
  2. 1 1
      android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/adapter/CallRecordsItemAdapter.kt
  3. 2 2
      android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/adapter/CallingItemAdapter.kt
  4. 1 1
      android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/DoctorHostFragment.kt
  5. 8 4
      android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/FramePartFragment.kt
  6. 1 1
      android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/NurseMoveFragment.kt
  7. 1 1
      android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/OtherHostFragment.kt
  8. 6 14
      android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/SipCallFragment.kt
  9. 248 0
      android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/SipComingCallFragment.kt
  10. 5 5
      android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/SkyCallFragment.kt
  11. 3 2
      android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/SystemSettingsFragment.kt
  12. 2 2
      android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/settingconfig/SettingConfig.java
  13. 43 0
      android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/util/AppUtil.java
  14. 1 1
      android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/util/CallDialogHelper.java
  15. 6 4
      android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/util/SpeechUtil.java
  16. 2 2
      android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/window/IncidentWindow.kt
  17. 25 6
      android_host/src/main/h10_wke_1h/res/layout/activity_nurse_home.xml
  18. 28 11
      android_host/src/main/h10_wke_1h/res/layout/fragment_system_settings.xml
  19. 8 4
      android_host/src/main/h10_wke_1h/res/layout/right_basic_information.xml
  20. 57 17
      android_host/src/main/h10_wke_1h/res/layout/sky_voice_call_layout.xml

+ 60 - 19
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/activity/NurseHomeActivity.kt

@@ -78,6 +78,7 @@ import org.greenrobot.eventbus.EventBus
 import org.greenrobot.eventbus.Subscribe
 import org.greenrobot.eventbus.ThreadMode
 import org.linphone.core.AccountCreator
+import org.linphone.core.Factory
 import org.linphone.core.RegistrationState
 import org.linphone.core.TransportType
 import java.io.File
@@ -251,7 +252,6 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
                 home_view_qr_code?.setImageBitmap(code)
             }
 
-
             // 初始化 GStreamer
             try {
                 GStreamer.init(BaseApplication.appContext)
@@ -510,19 +510,14 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
         currentFragment = FramePartFragment()
         supportFragmentManager.beginTransaction().replace(R.id.middle_fralyout, currentFragment, "").commitAllowingStateLoss()
 
-        currentFragmentThree = CallRecordsFragment()
-        supportFragmentManager.beginTransaction().replace(R.id.left_framlyout, currentFragmentThree, "").commitAllowingStateLoss()
+        //currentFragmentThree = CallRecordsFragment()
+        //supportFragmentManager.beginTransaction().replace(R.id.left_framlyout, currentFragmentThree, "").commitAllowingStateLoss()
 
         //presenter.loadTcpData()
         presenter.loadServerInfo()
 
         regReceiver()//注册广播
 
-        /*if(Constants.hospital_name!=null&& !Constants.hospital_name.equals("")){
-            name_of_organization_tv.text = Constants.hospital_name+ Constants.part_name
-            Log.e(TAG, Constants.hospital_name+ Constants.part_name)
-        }*/
-
         name_of_organization_tv.text = Constants.partDisplay
         Log.e(TAG, Constants.partDisplay)
 
@@ -549,12 +544,12 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
 
         startScheduledExecutor()
 
-        SettingConfiguration.getInstance().transferCall = SettingConfig.getTransferCall(activity)
+        /*SettingConfiguration.getInstance().transferCall = SettingConfig.getTransferCall(activity)
         if (SettingConfiguration.getInstance().transferCall) {
             startTransferScheduledExecutor()
         } else {
             startRemoveCallScheduledExecutor()
-        }
+        }*/
 
         //记录app启动时间
         val lastTime = SettingConfig.getAppStartTime(activity)
@@ -835,6 +830,7 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
         collocation_radio_bt.setOnClickListener(this)
         system_settings_radio_bt.setOnClickListener(this)
         led_settings_radio_bt.setOnClickListener(this)
+        sip_call_radio_bt.setOnClickListener(this)
 
         //home_view_btn_reload.isEnabled = false
         home_view_btn_reload.setOnClickListener {
@@ -1069,7 +1065,7 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
 
         if (SettingConfig.getSipEnabled(activity)) {
             //配置sip账户
-            if (WdklSipService.getCore() != null) {
+            /*if (WdklSipService.getCore() != null) {
                 mAccountCreator = WdklSipService.getCore().createAccountCreator(null)
                 // 以下三项必须
                 if (!TextUtils.isEmpty(Constants.sip_id) && !TextUtils.isEmpty(Constants.sip_ip)) {
@@ -1087,7 +1083,22 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
                 } else {
                     showMessage("SIP 数据不全")
                 }
-            }
+            }*/
+
+
+            //无服务器时端口必须,固定5060,否则拨打IP时,也需加上端口号。如:sip:192.168.1.100:6666
+            val transports = Factory.instance().createTransports()
+            transports.setUdpPort(5060)
+            transports.setTcpPort(5060)
+            WdklSipService.getCore().setTransports(transports)
+
+            //设置显示名称
+            val accountCreator = WdklSipService.getCore().createAccountCreator(null)
+            accountCreator.setUsername(Constants.sip_id) //此处就当设置为房间床位号
+            accountCreator.setDomain(NetHelper.getInstance().getLocalIP())
+            accountCreator.setTransport(TransportType.Udp)
+            val cfg = accountCreator.createProxyConfig()
+            WdklSipService.getCore().setDefaultProxyConfig(cfg)
         }
 
         loadLedDevice()
@@ -1260,6 +1271,20 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
                    select_id = 10
                }
            }
+
+           R.id.sip_call_radio_bt -> {
+               if (select_id != 11) {
+                   select_id = 11
+
+                   val fragment = SipComingCallFragment()
+                   val bundle = Bundle()
+                   bundle.putInt("call_state", 0)
+                   bundle.putBoolean("visiting", false)
+                   bundle.putBoolean("audio_only", true)
+                   fragment.arguments = bundle
+                   addCallFragment(fragment)
+               }
+           }
        }
     }
 
@@ -1523,7 +1548,7 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
                     VoiceManagerUtil.switchAudioMode(activity, true)
                     VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostCallVolume(activity))
 
-                    if (Constants.CALL_STATE == Constants.CALL_OUTGOING) {
+                    /*if (Constants.CALL_STATE == Constants.CALL_OUTGOING) {
                         //呼出取消
                         Constants.CALL_STATE = Constants.CALL_STANDBY
                         DeviceChannel.calling = false
@@ -1533,7 +1558,9 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
                         Constants.CALL_STATE = Constants.CALL_STANDBY
                         DeviceChannel.calling = false
                         EventBus.getDefault().post(MessageEvent("handoff", Constants.EVENT_END_CALL))
-                    }
+                    }*/
+
+                    EventBus.getDefault().post(MessageEvent("handoff", Constants.EVENT_END_CALL))
                 }
 
                 hookonTime = System.currentTimeMillis()
@@ -1545,12 +1572,14 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
                     VoiceManagerUtil.switchAudioMode(activity, false)
                     VoiceManagerUtil.setCallVoice(activity, SettingConfig.getHostCallVolume(activity))
 
-                    if (Constants.CALL_STATE == Constants.CALL_STANDBY) {
+                    /*if (Constants.CALL_STATE == Constants.CALL_STANDBY) {
                         //不是呼出也不是通话状态则接听电话
                         EventBus.getDefault().post(MessageEvent("hookoff", Constants.EVENT_HOOK_OFF))
                     } else if (Constants.CALL_STATE == Constants.CALL_VISITING || Constants.CALL_STATE == Constants.CALL_V_INCOMING) {
                         EventBus.getDefault().post(MessageEvent("hookoff", Constants.EVENT_V_HOOK_OFF))
-                    }
+                    }*/
+
+                    EventBus.getDefault().post(MessageEvent("hookoff", Constants.EVENT_HOOK_OFF))
                 }
 
                 hookoffTime = System.currentTimeMillis()
@@ -1911,7 +1940,7 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
                     if (tcpModel.action == TcpAction.SOSAction.CALL || tcpModel.action == TcpAction.SOSAction.ROOM_CALL) {
                         //紧急呼叫优先级最高,如果当前有通话或正在呼叫的需要将其打断
                         RingPlayHelper.stopRingTone()
-                        SpeechUtil.getInstance().stopSpeak()
+                        SpeechUtil.getInstance().stopSpeak(false)
                         if (Constants.CALL_STATE == Constants.CALL_OUTGOING) {
                             VoiceUtil.cancelAudioCall(Constants.ids, Constants.targetDeviceId)
                             EventBus.getDefault().post(MessageEvent("cancel", Constants.EVENT_END_CALL))
@@ -2147,7 +2176,7 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
                 }else if (tcpModel.type == TcpType.ENTRACEGUARD) {
                     if (tcpModel.action == TcpAction.EntraceGuardAction.STRANGER) {
                         if(Constants.CALL_STATE == Constants.CALL_STANDBY) { //空闲状态
-                            SpeechUtil.getInstance().stopSpeak()
+                            SpeechUtil.getInstance().stopSpeak(true)
                             RingPlayHelper.stopRingTone()
 
                             Constants.CALL_STATE = Constants.CALL_CALLING
@@ -2220,7 +2249,7 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
                 Constants.fromDeviceType = item.fromDeviceType
                 //callInteractionVO = interactionVO
 
-                SpeechUtil.getInstance().stopSpeak()
+                SpeechUtil.getInstance().stopSpeak(true)
                 RingPlayHelper.stopRingTone()
 
                 //通话之前先判断webrtc socket是否连接上,否则不能建立通话
@@ -2237,6 +2266,18 @@ class NurseHomeActivity  : BaseActivity<NurseHomeActivityPresenter, ActivityNurs
                 LedHelper.updateLedInfo(item, false, false)
             }
 
+            Constants.SIP_INCOMING_CALL -> {
+                val callName = messageEvent.getMessage() as String
+                val fragment = SipComingCallFragment()
+                val bundle = Bundle()
+                bundle.putInt("call_state", 1)
+                bundle.putBoolean("visiting", false)
+                bundle.putBoolean("audio_only", true)
+                bundle.putString("call_name", callName)
+                fragment.arguments = bundle
+                addCallFragment(fragment)
+            }
+
             Constants.EVENT_REJECT_CALL -> {
                 //拒接电话
                 val item = messageEvent.getMessage() as InteractionVO

+ 1 - 1
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/adapter/CallRecordsItemAdapter.kt

@@ -223,7 +223,7 @@ class CallRecordsItemAdapter(val data:ArrayList<InteractionVO>) : BaseDelegateAd
             binding.callListReply.setOnClickListener {
                 if (Constants.ids != 0) {
                     //呼出时停止语音播报及铃声
-                    SpeechUtil.getInstance().stopSpeak()
+                    SpeechUtil.getInstance().stopSpeak(true)
                     RingPlayHelper.stopRingTone()
                     if (itemData.actionDirectionType == 1 && itemData.fromDeviceId != null && itemData.fromDeviceId != Constants.ids) {
                         if (NurseHomeActivity.checkIncomingCall(itemData.fromDeviceId)) {

+ 2 - 2
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/adapter/CallingItemAdapter.kt

@@ -104,7 +104,7 @@ class CallingItemAdapter : RecyclerView.Adapter<CallingItemAdapter.ParentViewHol
     fun removeCall(interactionVO: InteractionVO, stop: Boolean) {
         if (stop) {
             RingPlayHelper.stopRingTone()
-            SpeechUtil.getInstance().stopSpeak()
+            SpeechUtil.getInstance().stopSpeak(true)
         }
 
         synchronized(this) {
@@ -123,7 +123,7 @@ class CallingItemAdapter : RecyclerView.Adapter<CallingItemAdapter.ParentViewHol
     fun removeCallByPos(position: Int, stop: Boolean) {
         if (stop) {
             RingPlayHelper.stopRingTone()
-            SpeechUtil.getInstance().stopSpeak()
+            SpeechUtil.getInstance().stopSpeak(true)
         }
 
         synchronized(this) {

+ 1 - 1
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/DoctorHostFragment.kt

@@ -120,7 +120,7 @@ class DoctorHostFragment: BaseFragment<DoctorHostPresenter, FragmentDoctorHostBi
     override fun onClick(p0: View?) {
         if (selectDevice != null) {
             //呼出时停止语音播报及铃声
-            SpeechUtil.getInstance().stopSpeak()
+            SpeechUtil.getInstance().stopSpeak(true)
             RingPlayHelper.stopRingTone()
 
             if (Constants.tcp_connected) {

+ 8 - 4
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/FramePartFragment.kt

@@ -199,7 +199,7 @@ class FramePartFragment: BaseFragment<FramePartPresenter, FragmentFramePartBindi
             } else {
                 if (frame.customerName != null && frame.bedDeviceId != null) {
                     //呼出时停止语音播报及铃声
-                    SpeechUtil.getInstance().stopSpeak()
+                    SpeechUtil.getInstance().stopSpeak(true)
                     RingPlayHelper.stopRingTone()
                     if (NurseHomeActivity.checkIncomingCall(frame.bedDeviceId)) {
                         showMessage(R.string.call_in_list)
@@ -233,7 +233,7 @@ class FramePartFragment: BaseFragment<FramePartPresenter, FragmentFramePartBindi
             } else {
                 if (frame.customerName != null && frame.bedDeviceId != null) {
                     //呼出时停止语音播报及铃声
-                    SpeechUtil.getInstance().stopSpeak()
+                    SpeechUtil.getInstance().stopSpeak(true)
                     RingPlayHelper.stopRingTone()
                     if (NurseHomeActivity.checkIncomingCall(frame.bedDeviceId)) {
                         showMessage(R.string.call_in_list)
@@ -274,8 +274,12 @@ class FramePartFragment: BaseFragment<FramePartPresenter, FragmentFramePartBindi
     }
 
     override fun showCustomerInfo(data: CustomerInfoVO) {
+        doctor_duty_relalyout.visibility = View.GONE
+        advice_layout.visibility = View.GONE
+        illness_layout.visibility = View.GONE
+
         //基本信息
-        if (SettingConfiguration.getInstance().doctorValid == 1) {
+        /*if (SettingConfiguration.getInstance().doctorValid == 1) {
             doctor_duty_relalyout.visibility = View.VISIBLE
             advice_layout.visibility = View.VISIBLE
             illness_layout.visibility = View.VISIBLE
@@ -315,7 +319,7 @@ class FramePartFragment: BaseFragment<FramePartPresenter, FragmentFramePartBindi
             var examList = ArrayList<ExaminationConfigByGroupNameDto>()
             examList.addAll(data.examinationConfigByGroupNameList)
             examAdapter?.updateData(examList)
-        }
+        }*/
     }
 
 

+ 1 - 1
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/NurseMoveFragment.kt

@@ -158,7 +158,7 @@ class NurseMoveFragment : BaseFragment<NurseMovePresenter,FragmentNurseMoveBindi
     override fun onClick(p0: View?) {
         if (selectMobile != null) {
             //呼出时停止语音播报及铃声
-            SpeechUtil.getInstance().stopSpeak()
+            SpeechUtil.getInstance().stopSpeak(true)
             RingPlayHelper.stopRingTone()
 
             if (Constants.tcp_connected) {

+ 1 - 1
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/OtherHostFragment.kt

@@ -151,7 +151,7 @@ class OtherHostFragment : BaseFragment<OtherHostPresenter, FragmentOtherHostBind
     override fun onClick(p0: View?) {
         if (selectDevice != null) {
             //呼出时停止语音播报及铃声
-            SpeechUtil.getInstance().stopSpeak()
+            SpeechUtil.getInstance().stopSpeak(true)
             RingPlayHelper.stopRingTone()
 
             if (Constants.tcp_connected) {

+ 6 - 14
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/SipCallFragment.kt

@@ -1,5 +1,7 @@
 package com.wdkl.ncs.android.component.nursehome.fragment
 
+import android.content.Context
+import android.media.AudioManager
 import android.os.CountDownTimer
 import android.os.Handler
 import android.os.Looper
@@ -15,7 +17,6 @@ import com.wdkl.ncs.android.lib.utils.showMessage
 import com.wdkl.ncs.android.middleware.common.Constants
 import com.wdkl.ncs.android.middleware.model.bean.SettingConfiguration
 import com.wdkl.ncs.android.middleware.model.dos.InteractionDO
-import com.wdkl.ncs.android.middleware.tcp.TcpClient
 import com.wdkl.ncs.android.middleware.tcp.channel.DeviceChannel
 import com.wdkl.ncs.android.middleware.tcp.channel.VoiceUtil
 import com.wdkl.ncs.android.middleware.tcp.dto.TcpModel
@@ -23,7 +24,6 @@ import com.wdkl.ncs.android.middleware.tcp.enums.TcpAction
 import com.wdkl.ncs.android.middleware.tcp.enums.TcpType
 import com.wdkl.ncs.android.middleware.utils.MessageEvent
 import com.wdkl.ncs.host.service.WdklSipService
-import com.wdkl.ncs.host.util.AudioRouteUtils
 import kotlinx.android.synthetic.main.sky_voice_call_layout.*
 import org.greenrobot.eventbus.Subscribe
 import org.greenrobot.eventbus.ThreadMode
@@ -53,7 +53,7 @@ class SipCallFragment: BaseCallFragment() {
 
         sipCore = WdklSipService.getCore()
 
-//        Log.d(TAG, "callState: $callState, local sip: ${Constants.sip_id}, target sip: ${Constants.targetSipId}")
+        //Log.d(TAG, "callState: $callState, local sip: ${Constants.sip_id}, target sip: ${Constants.targetSipId}")
         when (callState) {
             0 -> {
                 //发起通话
@@ -208,16 +208,8 @@ class SipCallFragment: BaseCallFragment() {
     }
 
     private fun toggleSpeaker(enable: Boolean) {
-        Log.d(TAG, "toggle speaker: $enable, sipCore: $sipCore")
-        if ( sipCore == null) {
-            return
-        }
-
-        if (enable) {
-            AudioRouteUtils.routeAudioToSpeaker(sipCore!!)
-        } else {
-            AudioRouteUtils.routeAudioToEarpiece(sipCore!!)
-        }
+        val audioManager = activity.getSystemService(Context.AUDIO_SERVICE) as AudioManager
+        audioManager.isSpeakerphoneOn = enable
     }
 
     @Subscribe(threadMode = ThreadMode.MAIN)
@@ -253,7 +245,7 @@ class SipCallFragment: BaseCallFragment() {
                             } else {
                                 val addressToCall = sipCore!!.interpretUrl(curIt.toSipId)
                                 val params = sipCore!!.createCallParams(null)
-                                params?.isVideoEnabled = false
+                                //params?.isVideoEnabled = false
                                 if (addressToCall != null) {
                                     sipCore!!.inviteAddressWithParams(addressToCall, params!!)
                                     Log.d(TAG, ">>>>>>>>>>> invite address: " + addressToCall.asString())

+ 248 - 0
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/SipComingCallFragment.kt

@@ -0,0 +1,248 @@
+package com.wdkl.ncs.android.component.nursehome.fragment
+
+import android.os.*
+import android.util.Log
+import android.view.View
+import android.widget.Switch
+import com.wdkl.ncs.android.component.nursehome.R
+import com.wdkl.ncs.android.component.nursehome.util.AppUtil
+import com.wdkl.ncs.android.component.nursehome.util.RingPlayHelper
+import com.wdkl.ncs.android.component.nursehome.util.SpeechUtil
+import com.wdkl.ncs.android.lib.base.BaseApplication
+import com.wdkl.ncs.android.lib.utils.showMessage
+import com.wdkl.ncs.android.middleware.common.Constants
+import com.wdkl.ncs.android.middleware.model.bean.SettingConfiguration
+import com.wdkl.ncs.android.middleware.utils.MessageEvent
+import com.wdkl.ncs.host.service.WdklSipService
+//import com.wdkl.ncs.host.util.AudioRouteUtils
+import kotlinx.android.synthetic.main.sky_voice_call_layout.*
+import org.greenrobot.eventbus.Subscribe
+import org.greenrobot.eventbus.ThreadMode
+import org.linphone.core.Core
+
+class SipComingCallFragment: BaseCallFragment() {
+    private val TAG = "SipComingCallFragment"
+
+    private val handler = Handler(Looper.getMainLooper())
+    private var callEnded: Boolean = false
+    private var outGoing: Boolean = false
+
+    //呼叫倒计时
+    lateinit var countDownTimer: CountDownTimer
+
+    private var sipCore: Core? = null
+
+    override fun getLayId(): Int {
+        return R.layout.sky_voice_call_layout
+    }
+
+    override fun init() {
+        initCountDownTimer()
+
+        sipCore = WdklSipService.getCore()
+
+        when (callState) {
+            0 -> {
+                //发起通话
+                outGoing = true
+                showCallView(true)
+                //RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.ring_back2, true)
+            }
+
+            1 -> {
+                //来电
+                outGoing = false
+                showCallView(false)
+            }
+        }
+    }
+
+    private fun initCountDownTimer() {
+        countDownTimer = object: CountDownTimer(60000, 1000) {
+            override fun onTick(millisUntilFinished: Long) {
+                //
+            }
+
+            override fun onFinish() {
+                //呼叫超时,退出呼叫界面
+                showMessage("无响应")
+                callEnd()
+            }
+        }
+    }
+
+    override fun bindEvent() {
+        //通话挂断
+        sky_voice_call_hangup.setOnClickListener {
+            countDownTimer.cancel()
+            SpeechUtil.getInstance().stopSpeak(true)
+            callEnd()
+        }
+
+        sky_voice_call_ring_reject.setOnClickListener {
+            //拒接
+            SpeechUtil.getInstance().stopSpeak(true)
+            callTerminate()
+        }
+
+        sky_voice_call_ring_pickup_audio.setOnClickListener {
+            //接听
+            SpeechUtil.getInstance().stopSpeak(true)
+            acceptSipCall()
+        }
+
+        button_call.setOnClickListener {
+            sky_voice_call_calling_text.setText(R.string.call_in_calling)
+            val addressToCall = sipCore?.interpretUrl(edit_call_number.text.toString())
+            val params = sipCore?.createCallParams(null)
+            //视频开关
+            //params?.isVideoEnabled = false
+
+            //录音文件路径
+            params?.recordFile = Environment.getExternalStorageDirectory().path + "/" + Environment.DIRECTORY_DOWNLOADS + "/" + AppUtil.getTimeFilename() + ".wav"
+
+            if (addressToCall != null) {
+                sipCore?.inviteAddressWithParams(addressToCall, params!!)
+            }
+
+            button_call.isEnabled = false
+        }
+    }
+
+    private fun acceptSipCall() {
+        if (sipCore != null && sipCore!!.callsNb > 0) {
+            var call = sipCore!!.currentCall
+            if (call == null) {
+                call = sipCore!!.calls[0]
+            }
+            val params = sipCore?.createCallParams(call)
+            //params?.isVideoEnabled = false
+
+            //录音文件路径
+            params?.recordFile = Environment.getExternalStorageDirectory().path + "/" + Environment.DIRECTORY_DOWNLOADS + "/" + AppUtil.getTimeFilename() + ".wav"
+            call?.acceptWithParams(params)
+        }
+    }
+
+    private fun callTerminate() {
+        if (sipCore != null && sipCore!!.callsNb > 0) {
+            var call = sipCore!!.currentCall
+            if (call == null) {
+                call = sipCore!!.calls[0]
+            }
+            call?.stopRecording()
+            call?.terminate()
+        }
+    }
+
+    override fun destroy() {
+        RingPlayHelper.stopRingTone()
+        SpeechUtil.getInstance().stopSpeak(true)
+
+        if (sky_voice_call_timer != null) {
+            sky_voice_call_timer.stop()
+        }
+        handler.removeCallbacksAndMessages(null)
+    }
+
+    private fun showCallView(outgoing: Boolean) {
+        if (outgoing) {
+            //呼出
+            countDownTimer.start()
+            ll_out_call.visibility = View.VISIBLE
+            sky_voice_call_calling_text.setText("")
+            sky_voice_call_incoming.visibility = View.GONE
+            sky_voice_call_outgoing.visibility = View.VISIBLE
+            sky_voice_call_timer.visibility = View.GONE
+        } else {
+            //来电
+            val nameText = AppUtil.parseCallNameByCode(callName)
+            SpeechUtil.getInstance().addSpeech(BaseApplication.appContext.getString(R.string.voice_call_speech, nameText), false)
+            sky_call_name.text = nameText
+            sky_voice_call_calling_text.setText(R.string.call_incoming)
+            sky_voice_call_incoming.visibility = View.VISIBLE
+            sky_voice_call_outgoing.visibility = View.GONE
+            sky_voice_call_timer.visibility = View.GONE
+        }
+    }
+
+    private fun showCalling(audioOnly: Boolean) {
+        if (callEnded) {
+            return
+        }
+
+        if (audioOnly) {
+            ll_voice_call.visibility = View.VISIBLE
+        } else {
+            //显示视频画面
+            fullscreen_video_frame.visibility = View.VISIBLE
+            pip_video_frame.visibility = View.VISIBLE
+            ll_voice_call.visibility = View.GONE
+        }
+
+        sky_voice_call_incoming.visibility = View.GONE
+        sky_voice_call_outgoing.visibility = View.VISIBLE
+        sky_voice_call_calling_text.setText(R.string.call_in_call)
+        sky_voice_call_timer.visibility = View.VISIBLE
+        sky_voice_call_timer.base = SystemClock.elapsedRealtime()
+        sky_voice_call_timer.start()
+    }
+
+    //通话结束
+    private fun callEnd() {
+        Log.e(TAG, ">>>>>>>>>>> call end !!!!!!!!!!!!!!!!!!")
+        RingPlayHelper.stopRingTone()
+        SpeechUtil.getInstance().stopSpeak(true)
+        countDownTimer.cancel()
+
+        synchronized(this) {
+            if (callEnded) {
+                return
+            }
+            callEnded = true
+
+            if (sky_voice_call_timer != null) {
+                sky_voice_call_timer.stop()
+            }
+
+            callTerminate()
+            backToMain()
+        }
+    }
+
+    private fun toggleSpeaker(enable: Boolean) {
+        Log.d(TAG, "toggle speaker: $enable, sipCore: $sipCore")
+        if ( sipCore == null) {
+            return
+        }
+
+        /*if (enable) {
+            AudioRouteUtils.routeAudioToSpeaker(sipCore!!)
+        } else {
+            AudioRouteUtils.routeAudioToEarpiece(sipCore!!)
+        }*/
+    }
+
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    fun onMoonEvent(messageEvent: MessageEvent) {
+        when (messageEvent.getType()) {
+            Constants.EVENT_END_CALL -> {
+                Log.d(TAG, ">>>>>>>>>>>>>> EVENT_END_CALL")
+                if (messageEvent.getMessage() is String) {
+                    callEnd()
+                }
+            }
+
+            Constants.SIP_CONNECTED -> {
+                showCalling(true)
+            }
+
+            Constants.EVENT_HOOK_OFF -> {
+                //接听
+                SpeechUtil.getInstance().stopSpeak(true)
+                acceptSipCall()
+            }
+        }
+    }
+
+}

+ 5 - 5
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/SkyCallFragment.kt

@@ -228,10 +228,10 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
             DeviceChannel.calling = false
         }
 
-        iv_accept_call.setOnClickListener {
+        sky_voice_call_ring_pickup_audio.setOnClickListener {
             //视频接听
             RingPlayHelper.stopRingTone()
-            SpeechUtil.getInstance().stopSpeak()
+            SpeechUtil.getInstance().stopSpeak(true)
             if (visiting) {
                 VideoUtil.sendVideoInCall(Constants.ids, fromId, interactionVO?.id)
             } else {
@@ -241,10 +241,10 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
             janusClient!!.connect(-1, false)
         }
 
-        iv_reject_call.setOnClickListener {
+        sky_voice_call_ring_reject.setOnClickListener {
             //视频拒绝
             RingPlayHelper.stopRingTone()
-            SpeechUtil.getInstance().stopSpeak()
+            SpeechUtil.getInstance().stopSpeak(true)
             if (visiting) {
                 VideoUtil.rejectVideoCall(Constants.ids, fromId, interactionVO?.id)
             } else {
@@ -748,7 +748,7 @@ class SkyCallFragment: BaseCallFragment(), CallSessionCallback {
                 if (!onlyAudio) {
                     //视频接听
                     RingPlayHelper.stopRingTone()
-                    SpeechUtil.getInstance().stopSpeak()
+                    SpeechUtil.getInstance().stopSpeak(true)
                     if (visiting) {
                         VideoUtil.sendVideoInCall(Constants.ids, fromId, interactionVO?.id)
                     } else {

+ 3 - 2
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/SystemSettingsFragment.kt

@@ -63,8 +63,8 @@ class SystemSettingsFragment:BaseFragment<SystemSettingsPresenter,FragmentSystem
      */
     override fun init() {
         //设置白昼初始值和结束值
-        var initialValue = doubleslide_withoutrule.timeToArray(0, SettingConfig.getInitialDayTime(this.activity))
-        var endValue = doubleslide_withoutrule.timeToArray(1, SettingConfig.getEndOfDay(this.activity))
+        val initialValue = doubleslide_withoutrule.timeToArray(0, SettingConfig.getInitialDayTime(this.activity))
+        val endValue = doubleslide_withoutrule.timeToArray(1, SettingConfig.getEndOfDay(this.activity))
 
         Log.e(TAG,"endValue "+endValue +" "+ SettingConfig.getEndOfDay(this.activity)  + ", startValue: " + initialValue + " " + SettingConfig.getInitialDayTime(this.activity))
         doubleslide_withoutrule.update(initialValue,endValue)
@@ -291,6 +291,7 @@ class SystemSettingsFragment:BaseFragment<SystemSettingsPresenter,FragmentSystem
         spinner_call_stay_time.setSelection(originTime)
 
         tv_device_ip.setText(NetHelper.getInstance().localIP)
+        tv_device_sip.setText("sip: " + Constants.sip_id)
     }
 
     //开启网络调试

+ 2 - 2
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/settingconfig/SettingConfig.java

@@ -26,7 +26,7 @@ public class SettingConfig {
 
     //播报次数
     private static final String KEY_SP_CALL_NUMBER = "KEY_SP_CALL_NUMBER";
-    private static final int call_number = 2;
+    private static final int call_number = 3;
 
     //主机白天亮度
     private static final String KEY_SP_MAIN_ENGINE_DAYTIME_BRIGHTNESS = "KEY_SP_MAIN_ENGINE_DAYTIME_BRIGHTNESS";
@@ -220,7 +220,7 @@ public class SettingConfig {
     }
 
     public static boolean getSipEnabled(Context context) {
-        return getSP(context).getBoolean(KEY_SP_SIP_ENABLE, false);
+        return getSP(context).getBoolean(KEY_SP_SIP_ENABLE, true);
     }
 
     public static void setSipEnable(Context context, boolean enable) {

+ 43 - 0
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/util/AppUtil.java

@@ -7,7 +7,9 @@ import android.util.Log;
 
 import java.io.DataOutputStream;
 import java.io.IOException;
+import java.text.SimpleDateFormat;
 import java.util.Calendar;
+import java.util.Date;
 
 public class AppUtil {
 
@@ -71,6 +73,47 @@ public class AppUtil {
         return str.substring(start, end);
     }
 
+    public static String parseCallNameByCode(String org) {
+        //org: 1001 or sip:1001@192.168.3.26
+        //sip账号匹配房号规则: 7550000506003011802201 ==> 3栋1单元1802房1分机
+        //城市编码3位+小区编码5位+片区号2位+楼栋号3位+单元号2位+楼层号2位+房号2位+设备类型1位+设备号2位
+
+        if (org == null || org.length() == 0) {
+            return "";
+        }
+
+        if (org.length() != 22) {
+            return org;
+        }
+
+        if (TextUtils.isDigitsOnly(org)) {
+            String buildingNo = org.substring(10, 13);
+            String unitNo = org.substring(13, 15);
+            String roomNo = org.substring(15, 19);
+            String deviceType = org.substring(19, 20);
+            String deviceNo = org.substring(20, 22);
+            if (deviceType.equals("2")) {
+                deviceType = "分机";
+            } else {
+                deviceType = "设备";
+            }
+
+            //x栋x单元xxxx房x分机
+            return "" + Integer.parseInt(buildingNo) + "栋"
+                    + Integer.parseInt(unitNo) + "单元"
+                    + Integer.parseInt(roomNo) + "房"
+                    + Integer.parseInt(deviceNo)
+                    + deviceType;
+        } else {
+            return org;
+        }
+    }
+
+    public static String getTimeFilename(){
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd_HHmmss");
+        Date date = new Date();
+        return dateFormat.format(date);
+    }
 
     public static void setSystemTime(Context context, int year, int month, int day, int hour, int minute, int mill) {
         Calendar c = Calendar.getInstance();

+ 1 - 1
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/util/CallDialogHelper.java

@@ -85,7 +85,7 @@ public class CallDialogHelper {
         if (callDialog != null && callDialog.isShowing()) {
             callDialog.dismiss();
             RingPlayHelper.stopRingTone();
-            SpeechUtil.getInstance().stopSpeak();
+            SpeechUtil.getInstance().stopSpeak(true);
         }
     }
 }

+ 6 - 4
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/util/SpeechUtil.java

@@ -151,7 +151,7 @@ public class SpeechUtil {
             Log.d(TAG, "truely add text speech: " + text);
 
             if (emergency) {
-                stopSpeak();
+                stopSpeak(false);
                 speechTextList.add(0, text);
             } else {
                 speechTextList.add(text);
@@ -193,14 +193,16 @@ public class SpeechUtil {
         });
     }
 
-    public void stopSpeak() {
-        speechTextList.clear();
+    public void stopSpeak(boolean removeAll) {
+        if (removeAll) {
+            speechTextList.clear();
+        }
         if (textToSpeech != null && textToSpeech.isSpeaking()) {
             textToSpeech.stop();
             isStop = true;
             speakIndex = 0;
 
-            Log.d(TAG, "stop speak");
+            Log.d(TAG, "stop speak removeAll: " + removeAll);
         }
     }
 

+ 2 - 2
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/window/IncidentWindow.kt

@@ -119,11 +119,11 @@ class IncidentWindow(var contexts: Context) {
             if (SettingConfig.getTtsMode(contexts) == SettingConfig.TTS_OFF) {
                 RingPlayHelper.stopRingTone()
             } else {
-                SpeechUtil.getInstance().stopSpeak()
+                SpeechUtil.getInstance().stopSpeak(true)
             }
             val interactionData = Gson().fromJson(data.data.toString(), InteractionVO::class.java)
             if (interactionData.actionType == TcpType.SOS.name) {
-                SpeechUtil.getInstance().stopSpeak()
+                SpeechUtil.getInstance().stopSpeak(true)
                 OtherUtil.cancelSosCall(Constants.ids, interactionData.fromDeviceId, interactionData.id)
                 if (data.action == TcpAction.SOSAction.CALL || tcpModel.action == TcpAction.SOSAction.ROOM_CALL) {
                     LedHelper.updateLedInfo(interactionData, false, true)

+ 25 - 6
android_host/src/main/h10_wke_1h/res/layout/activity_nurse_home.xml

@@ -19,7 +19,8 @@
                     android:gravity="center"
                     android:layout_marginLeft="10dp"
                     android:textColor="@color/white"
-                    android:background="@color/red_color"/>
+                    android:background="@color/red_color"
+                    android:visibility="gone"/>
 
                 <TextView
                     android:id="@+id/name_of_organization_tv"
@@ -121,7 +122,8 @@
                     android:id="@+id/left_framlyout"
                     android:layout_width="0dp"
                     android:layout_height="match_parent"
-                    android:layout_weight="0.23"/>
+                    android:layout_weight="0.23"
+                    android:visibility="gone"/>
 
 
                 <FrameLayout
@@ -172,6 +174,19 @@
                             android:textSize="24sp" />
 
                         <com.wdkl.ncs.android.lib.widget.CustomRadioButton
+                            android:id="@+id/sip_call_radio_bt"
+                            android:layout_width="wrap_content"
+                            android:layout_height="match_parent"
+                            android:layout_weight="1"
+                            android:button="@null"
+                            android:drawableLeft="@drawable/guang_bo"
+                            android:drawablePadding="10px"
+                            android:gravity="center"
+                            android:textColor="@drawable/selector_bottom_btn_text_color"
+                            android:text="呼叫"
+                            android:textSize="24sp" />
+
+                        <com.wdkl.ncs.android.lib.widget.CustomRadioButton
                             android:id="@+id/broadcast_radio_bt"
                             android:layout_width="wrap_content"
                             android:layout_height="match_parent"
@@ -209,7 +224,8 @@
                             android:gravity="center"
                             android:textColor="@drawable/selector_bottom_btn_text_color"
                             android:text="@string/str_doctor"
-                            android:textSize="24sp" />
+                            android:textSize="24sp"
+                            android:visibility="gone"/>
 
                         <com.wdkl.ncs.android.lib.widget.CustomRadioButton
                             android:id="@+id/inpatient_ward_radio_bt"
@@ -248,7 +264,8 @@
                             android:gravity="center"
                             android:textColor="@drawable/selector_bottom_btn_text_color"
                             android:text="@string/str_mobile"
-                            android:textSize="24sp" />
+                            android:textSize="24sp"
+                            android:visibility="gone"/>
 
                         <com.wdkl.ncs.android.lib.widget.CustomRadioButton
                             android:id="@+id/other_host_radio_bt"
@@ -261,7 +278,8 @@
                             android:gravity="center"
                             android:textColor="@drawable/selector_bottom_btn_text_color"
                             android:text="@string/str_other_host"
-                            android:textSize="24sp" />
+                            android:textSize="24sp"
+                            android:visibility="gone"/>
 
                         <com.wdkl.ncs.android.lib.widget.CustomRadioButton
                             android:id="@+id/collocation_radio_bt"
@@ -287,7 +305,8 @@
                             android:gravity="center"
                             android:textColor="@drawable/selector_bottom_btn_text_color"
                             android:text="@string/str_led"
-                            android:textSize="24sp" />
+                            android:textSize="24sp"
+                            android:visibility="gone"/>
 
                         <com.wdkl.ncs.android.lib.widget.CustomRadioButton
                             android:id="@+id/system_settings_radio_bt"

+ 28 - 11
android_host/src/main/h10_wke_1h/res/layout/fragment_system_settings.xml

@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <layout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:bind="http://schemas.android.com/apk/res-auto"
     xmlns:custom="http://schemas.android.com/apk/res-auto">
 
     <RelativeLayout
@@ -120,8 +119,7 @@
                         android:layout_height="wrap_content"
                         android:layout_marginTop="2dp"
                         android:layout_marginBottom="10px"
-                        android:orientation="horizontal"
-                        android:visibility="gone">
+                        android:orientation="horizontal">
 
                         <TextView
                             android:layout_width="wrap_content"
@@ -159,7 +157,8 @@
                         android:layout_height="wrap_content"
                         android:layout_marginTop="2dp"
                         android:layout_marginBottom="10px"
-                        android:orientation="horizontal">
+                        android:orientation="horizontal"
+                        android:visibility="gone">
 
                         <TextView
                             android:layout_width="wrap_content"
@@ -197,7 +196,8 @@
                         android:layout_height="wrap_content"
                         android:layout_marginTop="2dp"
                         android:layout_marginBottom="10px"
-                        android:orientation="horizontal">
+                        android:orientation="horizontal"
+                        android:visibility="gone">
 
                         <TextView
                             android:layout_width="wrap_content"
@@ -235,7 +235,8 @@
                         android:layout_height="wrap_content"
                         android:layout_marginTop="2dp"
                         android:layout_marginBottom="10px"
-                        android:orientation="horizontal">
+                        android:orientation="horizontal"
+                        android:visibility="gone">
 
                         <TextView
                             android:layout_width="wrap_content"
@@ -310,7 +311,8 @@
                     <LinearLayout
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
-                        android:layout_marginBottom="8dp">
+                        android:layout_marginBottom="8dp"
+                        android:visibility="gone">
 
                         <TextView
                             android:layout_width="wrap_content"
@@ -888,7 +890,8 @@
                     android:layout_marginTop="4px"
                     android:background="#ffffff"
                     android:orientation="vertical"
-                    android:paddingLeft="6px">
+                    android:paddingLeft="6px"
+                    android:visibility="gone">
 
                     <TextView
                         android:layout_width="wrap_content"
@@ -1309,7 +1312,8 @@
                     android:layout_marginTop="4px"
                     android:background="#ffffff"
                     android:orientation="vertical"
-                    android:paddingLeft="6px">
+                    android:paddingLeft="6px"
+                    android:visibility="gone">
 
                     <LinearLayout
                         android:layout_width="wrap_content"
@@ -1571,7 +1575,8 @@
                         android:paddingBottom="10dp"
                         android:text="@string/save_settings"
                         android:textColor="#000000"
-                        android:textSize="18sp" />
+                        android:textSize="18sp"
+                        android:visibility="gone"/>
 
                     <TextView
                         android:id="@+id/restart_tv"
@@ -1613,15 +1618,27 @@
                         android:textSize="18sp" />
 
                     <TextView
-                        android:id="@+id/tv_device_ip"
+                        android:id="@+id/tv_device_sip"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:layout_marginTop="8dp"
                         android:padding="8dp"
                         android:gravity="center"
+                        android:text="sip:"
                         android:textColor="#000000"
                         android:textSize="18sp" />
 
+                    <TextView
+                        android:id="@+id/tv_device_ip"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="8dp"
+                        android:padding="8dp"
+                        android:gravity="center"
+                        android:textColor="#000000"
+                        android:textSize="18sp"
+                        android:text="IP:"/>
+
                 </LinearLayout>
             </LinearLayout>
 

+ 8 - 4
android_host/src/main/h10_wke_1h/res/layout/right_basic_information.xml

@@ -14,7 +14,8 @@
             android:gravity="center"
             android:orientation="horizontal"
             android:layout_marginBottom="16dp"
-            android:background="#F3F9FE">
+            android:background="#F3F9FE"
+            android:visibility="gone">
 
             <TextView
                 android:id="@+id/call_the_voice_tv"
@@ -93,7 +94,8 @@
                     android:ellipsize="end"
                     android:textColor="@drawable/selt_call_records_text"
                     android:text="@string/fees_info"
-                    android:textSize="18sp" />
+                    android:textSize="18sp"
+                    android:visibility="gone"/>
 
                 <RadioButton
                     android:id="@+id/exam_radio"
@@ -108,7 +110,8 @@
                     android:ellipsize="end"
                     android:textColor="@drawable/selt_call_records_text"
                     android:text="@string/inspection_info"
-                    android:textSize="18sp" />
+                    android:textSize="18sp"
+                    android:visibility="gone"/>
             </RadioGroup>
 
             <RelativeLayout
@@ -334,7 +337,8 @@
                     android:layout_height="wrap_content"
                     android:layout_marginRight="10dp"
                     android:layout_below="@+id/nurse_duty_relalyout"
-                    android:layout_marginTop="8dp">
+                    android:layout_marginTop="8dp"
+                    android:visibility="gone">
 
                     <TextView
                         android:id="@+id/tv_nurse_config_title"

+ 57 - 17
android_host/src/main/h10_wke_1h/res/layout/sky_voice_call_layout.xml

@@ -73,6 +73,32 @@
                 android:visibility="gone"/>
 
             <LinearLayout
+                android:id="@+id/ll_out_call"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="40dp"
+                android:gravity="center"
+                android:visibility="gone">
+
+                <EditText
+                    android:id="@+id/edit_call_number"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="sip:7550000506003011802201@192.168.3.26"
+                    android:textColor="@color/white"
+                    android:textSize="28sp" />
+
+                <Button
+                    android:id="@+id/button_call"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="10dp"
+                    android:text="呼叫"
+                    android:textColor="@color/main_color"
+                    android:textSize="32sp" />
+            </LinearLayout>
+
+            <LinearLayout
                 android:id="@+id/ll_voice_call"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
@@ -127,14 +153,14 @@
                     android:layout_marginTop="32dp">
                     <ImageView
                         android:id="@+id/sky_voice_call_hangup"
-                        android:layout_width="80dp"
-                        android:layout_height="80dp"
+                        android:layout_width="100dp"
+                        android:layout_height="100dp"
                         android:src="@drawable/selector_call_hangup" />
 
                     <ImageView
                         android:id="@+id/sky_call_speaker_on"
-                        android:layout_width="84dp"
-                        android:layout_height="84dp"
+                        android:layout_width="100dp"
+                        android:layout_height="100dp"
                         android:layout_marginStart="40dp"
                         android:src="@drawable/ic_speaker_on"
                         android:visibility="gone"/>
@@ -145,27 +171,41 @@
             <!--来电-->
             <LinearLayout
                 android:id="@+id/sky_voice_call_incoming"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
+                android:layout_width="match_parent"
+                android:layout_height="140dp"
                 android:layout_alignParentBottom="true"
                 android:layout_centerHorizontal="true"
                 android:layout_marginBottom="80dp"
-                android:gravity="center"
+                android:gravity="bottom"
+                android:orientation="horizontal"
                 android:visibility="gone">
 
+                <View
+                    android:layout_width="0dp"
+                    android:layout_height="1dp"
+                    android:layout_weight="2" />
+
                 <ImageView
-                    android:id="@+id/iv_accept_call"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginRight="160dp"
-                    android:src="@drawable/selector_call_answer"/>
+                    android:id="@+id/sky_voice_call_ring_reject"
+                    android:layout_width="100dp"
+                    android:layout_height="100dp"
+                    android:src="@drawable/selector_call_hangup" />
+
+                <View
+                    android:layout_width="0dp"
+                    android:layout_height="1dp"
+                    android:layout_weight="1" />
 
                 <ImageView
-                    android:id="@+id/iv_reject_call"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginLeft="160dp"
-                    android:src="@drawable/selector_call_end"/>
+                    android:id="@+id/sky_voice_call_ring_pickup_audio"
+                    android:layout_width="100dp"
+                    android:layout_height="100dp"
+                    android:src="@drawable/selector_call_answer" />
+
+                <View
+                    android:layout_width="0dp"
+                    android:layout_height="1dp"
+                    android:layout_weight="2" />
             </LinearLayout>
         </RelativeLayout>
     </FrameLayout>