Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
e9037c13
Commit
e9037c13
authored
May 07, 2020
by
严久程
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口参数
parent
ebe6578a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
43 deletions
+42
-43
config.gradle
config.gradle
+3
-3
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+35
-36
YDLavManager.kt
m-audioim/src/main/java/com/ydl/audioim/YDLavManager.kt
+0
-1
AudioApiRequestUtil.kt
m-audioim/src/main/java/com/ydl/audioim/http/AudioApiRequestUtil.kt
+1
-1
AudioNetAPi.kt
m-audioim/src/main/java/com/ydl/audioim/http/AudioNetAPi.kt
+3
-2
No files found.
config.gradle
View file @
e9037c13
...
...
@@ -5,7 +5,7 @@ ext {
ydlPublishVersion
=
[
// -------------- 业务模块 --------------
//第三步 若干
"m-confide"
:
"0.0.48.4
7
"
,
"m-confide"
:
"0.0.48.4
8
"
,
"m-consultant"
:
"0.0.59.10"
,
"m-fm"
:
"0.0.29.9"
,
"m-user"
:
"0.0.60.8"
,
...
...
@@ -39,7 +39,7 @@ ext {
"ydl-webview"
:
"0.0.38.31"
,
"ydl-media"
:
"0.0.21.6"
,
"ydl-pay"
:
"0.0.18.9"
,
"m-audioim"
:
"0.0.49.2
1
"
,
"m-audioim"
:
"0.0.49.2
2
"
,
"ydl-flutter-base"
:
"0.0.14.14"
,
//以下 几乎不会动
...
...
@@ -122,7 +122,7 @@ ext {
"ydl-webview"
:
"0.0.38.31"
,
"ydl-media"
:
"0.0.21.6"
,
"ydl-pay"
:
"0.0.18.9"
,
"m-audioim"
:
"0.0.49.2
1
"
,
"m-audioim"
:
"0.0.49.2
2
"
,
"ydl-flutter-base"
:
"0.0.14.14"
,
//以下 几乎不会动
...
...
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
e9037c13
...
...
@@ -191,17 +191,16 @@ class AudioHomeActivity :
runOnUiThread
{
when
(
warn
)
{
103
,
105
,
107
->
{
YDLavManager
.
instances
.
callEndStatusUpdate
(
channelId
!!
,
4
,
"收到频道回调警告信息$warn"
)
writeAgoraLog
(
"通话挂断:网络异常(${warn})"
)
showToast
(
"当前网络较差,请更换网络!"
)
//通话结束或挂断时,上传日志文件
uploadLog
()
leaveChannel
()
YDLavManager
.
instances
.
callEndStatusUpdate
(
channelId
!!
,
4
,
"收到频道回调警告信息$warn"
)
}
}
}
...
...
@@ -303,12 +302,12 @@ class AudioHomeActivity :
super
.
onConnectionStateChanged
(
state
,
reason
)
// 3 网络连接被服务器中止 该情况现在是因为后端踢人逻辑
if
(
reason
==
3
)
{
YDLavManager
.
instances
.
callEndStatusUpdate
(
channelId
!!
,
4
,
"服务端踢人触发的回调"
)
writeAgoraLog
(
"通话结束:原因(${reason})"
)
com
.
yidianling
.
common
.
tools
.
ToastUtil
.
toastShort
(
"专家已挂断"
)
//通话结束或挂断时,上传日志文件
uploadLog
()
leaveChannel
()
YDLavManager
.
instances
.
callEndStatusUpdate
(
channelId
!!
,
4
,
"服务端踢人触发的回调"
)
}
}
...
...
@@ -517,11 +516,11 @@ class AudioHomeActivity :
return
@setOnClickListener
}
if
(
isConnectSuccess
)
{
YDLavManager
.
instances
.
callEndStatusUpdate
(
channelId
!!
,
3
,
"主叫主动挂断"
)
writeAgoraLog
(
"已接通:主叫主动挂断"
)
updateExpertStatus
(
false
,
1
)
leaveChannel
()
uploadLog
()
YDLavManager
.
instances
.
callEndStatusUpdate
(
channelId
!!
,
3
,
"主叫主动挂断"
)
}
else
{
userCloseCalling
()
}
...
...
@@ -607,37 +606,37 @@ class AudioHomeActivity :
waitDisposable
=
Observable
.
interval
(
0
,
100
,
TimeUnit
.
MILLISECONDS
).
subscribeOn
(
Schedulers
.
computation
())
.
take
(
600
).
observeOn
(
AndroidSchedulers
.
mainThread
()).
subscribe
({
tv_change_time_counter
.
text
=
"${60 - it / 10}s"
var
result
=
it
.
toFloat
()
/
2.5f
progress_view
.
setProgress
(
result
)
if
(
result
>=
100f
&&
!
iv_hang_up
.
isEnabled
)
{
//挂断按钮可点击
iv_hang_up
.
isEnabled
=
true
iv_hang_up
.
setImageResource
(
R
.
drawable
.
audioim_img_hang_up
)
}
},
{
LogUtil
.
d
(
it
.
message
)
})
{
waittingStatus
()
if
(!
isConnectSuccess
)
{
//关闭音乐
stopPlaying
()
writeAgoraLog
(
"未接通挂断:60s等待倒计时结束挂断"
)
//提示切换传统线路
//发送消息通知专家用户已挂断
YDLavManager
.
instances
.
cancelCall
(
listenerUid
!!
,
channelId
!!
,
sendDoctocrMsg
!!
)
{
msg
,
code
->
writeAgoraLog
(
"未接听时:主叫主动挂断失败,msg=$msg($code),再次挂断"
)
tv_change_time_counter
.
text
=
"${60 - it / 10}s"
var
result
=
it
.
toFloat
()
/
2.5f
progress_view
.
setProgress
(
result
)
if
(
result
>=
100f
&&
!
iv_hang_up
.
isEnabled
)
{
//挂断按钮可点击
iv_hang_up
.
isEnabled
=
true
iv_hang_up
.
setImageResource
(
R
.
drawable
.
audioim_img_hang_up
)
}
//通话结束或挂断时,上传日志文件
uploadLog
()
},
{
LogUtil
.
d
(
it
.
message
)
})
{
waittingStatus
()
if
(!
isConnectSuccess
)
{
//关闭音乐
stopPlaying
()
writeAgoraLog
(
"未接通挂断:60s等待倒计时结束挂断"
)
//提示切换传统线路
//发送消息通知专家用户已挂断
YDLavManager
.
instances
.
cancelCall
(
listenerUid
!!
,
channelId
!!
,
sendDoctocrMsg
!!
)
{
msg
,
code
->
writeAgoraLog
(
"未接听时:主叫主动挂断失败,msg=$msg($code),再次挂断"
)
}
//通话结束或挂断时,上传日志文件
uploadLog
()
showChooseDialog
(
2
)
showChooseDialog
(
2
)
}
}
}
//双重保险:加入频道成功,通过服务端发推送给专家
noticeServerPush
(
true
)
...
...
m-audioim/src/main/java/com/ydl/audioim/YDLavManager.kt
View file @
e9037c13
...
...
@@ -473,7 +473,6 @@ class YDLavManager {
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
({
LogUtil
.
d
(
"callEndStatusUpdate success"
)
},
{
LogUtil
.
d
(
"callEndStatusUpdate error: ${it.message}"
)
})
...
...
m-audioim/src/main/java/com/ydl/audioim/http/AudioApiRequestUtil.kt
View file @
e9037c13
...
...
@@ -97,7 +97,7 @@ class AudioApiRequestUtil {
return
YDLHttpUtils
.
obtainApi
(
AudioNetAPi
::
class
.
java
).
listenToken
(
NetworkParamsUtils
.
getMaps
(
cmd
))
}
fun
callEndStatusUpdate
(
channelId
:
String
,
endStatus
:
Int
,
msg
:
String
):
Observable
<
BaseResponse
<
Any
>>
{
fun
callEndStatusUpdate
(
channelId
:
String
,
endStatus
:
Int
,
msg
:
String
):
Observable
<
Base
API
Response
<
Any
>>
{
return
YDLHttpUtils
.
obtainApi
(
AudioNetAPi
::
class
.
java
).
callEndStatusUpdate
(
channelId
,
endStatus
,
msg
)
}
}
...
...
m-audioim/src/main/java/com/ydl/audioim/http/AudioNetAPi.kt
View file @
e9037c13
...
...
@@ -69,8 +69,8 @@ interface AudioNetAPi {
fun
listenToken
(
@FieldMap
map
:
Map
<
String
,
String
>):
Observable
<
BaseResponse
<
ListenTokenBean
>>
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
@GET
(
"message/call-end/agora"
)
fun
callEndStatusUpdate
(
@Query
(
"channelId"
)
channelId
:
String
,
@Query
(
"endStatus"
)
endStatus
:
Int
,
@Query
(
"msg"
)
msg
:
String
):
Observable
<
BaseResponse
<
Any
>>
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
callEndStatusUpdate
(
@Query
(
"channelId"
)
channelId
:
String
,
@Query
(
"endStatus"
)
endStatus
:
Int
,
@Query
(
"msg"
)
msg
:
String
):
Observable
<
BaseAPIResponse
<
Any
>>
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment