|
@@ -344,8 +344,6 @@ class CallingbedActivity :BaseActivity<BedCallingbedActivityPresenter, Callingbe
|
|
|
|
|
|
HardWareFactory.getHardTools().setSerial(this)
|
|
HardWareFactory.getHardTools().setSerial(this)
|
|
|
|
|
|
- SoundPoolManager.getInstance().init()
|
|
|
|
-
|
|
|
|
//更新状态图标
|
|
//更新状态图标
|
|
updateNetState()
|
|
updateNetState()
|
|
|
|
|
|
@@ -1238,6 +1236,49 @@ class CallingbedActivity :BaseActivity<BedCallingbedActivityPresenter, Callingbe
|
|
|
|
|
|
EventBus.getDefault().post(MessageEvent("updateCustom", Constant.EVENT_UPDATE_CUSTOM))
|
|
EventBus.getDefault().post(MessageEvent("updateCustom", Constant.EVENT_UPDATE_CUSTOM))
|
|
|
|
|
|
|
|
+ Log.e(TAG, "part settings voice type: " + partSetting.voiceType)
|
|
|
|
+ //语音通话协议以科室配置为准
|
|
|
|
+ val orgSipEnable = SettingConfig.getSipEnabled(activity)
|
|
|
|
+ if (!TextUtils.isEmpty(partSetting.voiceType)) {
|
|
|
|
+ //科室有配置通话协议
|
|
|
|
+ if (partSetting.voiceType == "SIP") {
|
|
|
|
+ //sip模式
|
|
|
|
+ SettingConfig.setSipEnable(activity, true)
|
|
|
|
+ if (!orgSipEnable) {
|
|
|
|
+ AppTool.Time.delay(8000) {
|
|
|
|
+ AppUpdateHelper.restartApp(activity)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ //webrtc模式
|
|
|
|
+ SettingConfig.setSipEnable(activity, false)
|
|
|
|
+ if (orgSipEnable) {
|
|
|
|
+ AppTool.Time.delay(8000) {
|
|
|
|
+ AppUpdateHelper.restartApp(activity)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ //科室未配置通话协议,按全局配置
|
|
|
|
+ if ("sip".equals(Constant.voice_type)) {
|
|
|
|
+ //使用sip通话
|
|
|
|
+ SettingConfig.setSipEnable(activity, true)
|
|
|
|
+ if (!orgSipEnable) {
|
|
|
|
+ AppTool.Time.delay(8000) {
|
|
|
|
+ AppUpdateHelper.restartApp(activity)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ //使用webrtc通话
|
|
|
|
+ SettingConfig.setSipEnable(activity, false)
|
|
|
|
+ if (orgSipEnable) {
|
|
|
|
+ AppTool.Time.delay(8000) {
|
|
|
|
+ AppUpdateHelper.restartApp(activity)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
//配置sip账号并连接sip服务器
|
|
//配置sip账号并连接sip服务器
|
|
if (SettingConfig.getSipEnabled(activity) && !sipReg) {
|
|
if (SettingConfig.getSipEnabled(activity) && !sipReg) {
|
|
//配置sip账户
|
|
//配置sip账户
|
|
@@ -1291,23 +1332,12 @@ class CallingbedActivity :BaseActivity<BedCallingbedActivityPresenter, Callingbe
|
|
}
|
|
}
|
|
|
|
|
|
if (data.voiceType != null) {
|
|
if (data.voiceType != null) {
|
|
- val orgSipEnable = SettingConfig.getSipEnabled(activity)
|
|
|
|
if ("sip".equals(data.voiceType)) {
|
|
if ("sip".equals(data.voiceType)) {
|
|
//使用sip通话
|
|
//使用sip通话
|
|
- SettingConfig.setSipEnable(activity, true)
|
|
|
|
- if (!orgSipEnable) {
|
|
|
|
- handler.postDelayed({
|
|
|
|
- AppUpdateHelper.reboot(activity)
|
|
|
|
- }, 8000)
|
|
|
|
- }
|
|
|
|
|
|
+ Constant.voice_type = "sip"
|
|
} else {
|
|
} else {
|
|
//使用webrtc通话
|
|
//使用webrtc通话
|
|
- SettingConfig.setSipEnable(activity, false)
|
|
|
|
- if (orgSipEnable) {
|
|
|
|
- handler.postDelayed({
|
|
|
|
- AppUpdateHelper.reboot(activity)
|
|
|
|
- }, 8000)
|
|
|
|
- }
|
|
|
|
|
|
+ Constant.voice_type = "webrtc"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|