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
726181ac
Commit
726181ac
authored
Aug 25, 2022
by
万齐军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
网络质量bug fix
parent
7a9181f0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
9 deletions
+19
-9
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+14
-5
AudioApiRequestUtil.kt
m-audioim/src/main/java/com/ydl/audioim/http/AudioApiRequestUtil.kt
+4
-4
AudioNetAPi.kt
m-audioim/src/main/java/com/ydl/audioim/http/AudioNetAPi.kt
+1
-0
No files found.
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
726181ac
...
@@ -243,6 +243,8 @@ class AudioHomeActivity :
...
@@ -243,6 +243,8 @@ class AudioHomeActivity :
private
var
hasHandleRefused
=
false
private
var
hasHandleRefused
=
false
private
var
hasJoinChannel
=
false
private
val
tvNetDelay
:
TextView
by
lazy
{
findViewById
(
R
.
id
.
tvDelay
)
}
private
val
tvNetDelay
:
TextView
by
lazy
{
findViewById
(
R
.
id
.
tvDelay
)
}
private
val
tvNetDown
:
TextView
by
lazy
{
findViewById
(
R
.
id
.
tvDown
)
}
private
val
tvNetDown
:
TextView
by
lazy
{
findViewById
(
R
.
id
.
tvDown
)
}
private
val
tvNetUp
:
TextView
by
lazy
{
findViewById
(
R
.
id
.
tvUp
)
}
private
val
tvNetUp
:
TextView
by
lazy
{
findViewById
(
R
.
id
.
tvUp
)
}
...
@@ -459,9 +461,9 @@ class AudioHomeActivity :
...
@@ -459,9 +461,9 @@ class AudioHomeActivity :
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"远端用户/主播加入频道回调 channelId:${channelId}"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"远端用户/主播加入频道回调 channelId:${channelId}"
)
}
}
override
fun
onUserOffline
(
uid
:
Int
,
elapsed
:
Int
)
{
override
fun
onUserOffline
(
uid
:
Int
,
reason
:
Int
)
{
super
.
onUserOffline
(
uid
,
elapsed
)
super
.
onUserOffline
(
uid
,
reason
)
callEventSave
(
"51"
,
"uid:${uid}离开频道回调 elapsed:${
elapsed
}"
)
callEventSave
(
"51"
,
"uid:${uid}离开频道回调 elapsed:${
reason
}"
)
LogUtil
.
e
(
"[agora]远端用户$uid 离开频道回调"
)
LogUtil
.
e
(
"[agora]远端用户$uid 离开频道回调"
)
writeAgoraLog
(
"接通后通话结束:对方已挂断"
)
writeAgoraLog
(
"接通后通话结束:对方已挂断"
)
...
@@ -469,9 +471,12 @@ class AudioHomeActivity :
...
@@ -469,9 +471,12 @@ class AudioHomeActivity :
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"接通后通话结束:对方已挂断 channelId:${channelId}"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"接通后通话结束:对方已挂断 channelId:${channelId}"
)
//通话结束或挂断时,上传日志文件
//通话结束或挂断时,上传日志文件
uploadLog
()
uploadLog
()
AudioApiRequestUtil
.
reportCallEvent
(
channelId
,
RtcEvent
(
RtcEvent
.
Event
.
remoteLeave
))
AudioApiRequestUtil
.
reportCallEvent
(
channelId
,
RtcEvent
(
RtcEvent
.
Event
.
remoteLeave
)
,
retCode
=
reason
)
showToast
(
"专家已挂断"
)
showToast
(
"专家已挂断"
)
//UserOffLine之后,销毁界面,解决,userOffline有回调之后,onConnectionStateChanged(服务端踢人方法没有调),导致记录时长异常。
//UserOffLine之后,销毁界面,解决,userOffline有回调之后,onConnectionStateChanged(服务端踢人方法没有调),导致记录时长异常。
if
(
reason
==
Constants
.
USER_OFFLINE_DROPPED
)
{
YDLavManager
.
instances
.
callEndStatusUpdate
(
channelId
,
3
,
"对方超时掉线"
)
}
leaveChannel
()
leaveChannel
()
if
(
totalDisposable
!=
null
)
{
if
(
totalDisposable
!=
null
)
{
...
@@ -777,7 +782,7 @@ class AudioHomeActivity :
...
@@ -777,7 +782,7 @@ class AudioHomeActivity :
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户端点击:切换线路 channelId:${channelId}"
)
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"用户端点击:切换线路 channelId:${channelId}"
)
ActionCountUtils
.
record
(
"call_phone_page"
,
"call_phone_icon_click"
,
"0"
,
"4"
)
ActionCountUtils
.
record
(
"call_phone_page"
,
"call_phone_icon_click"
,
"0"
,
"4"
)
showChooseDialog
(
1
)
showChooseDialog
(
2
)
}
}
//挂断
//挂断
iv_hang_up
.
setOnClickListener
{
iv_hang_up
.
setOnClickListener
{
...
@@ -1136,6 +1141,7 @@ class AudioHomeActivity :
...
@@ -1136,6 +1141,7 @@ class AudioHomeActivity :
* 声网加入频道
* 声网加入频道
*/
*/
fun
joinChannel
()
{
fun
joinChannel
()
{
if
(
hasJoinChannel
)
return
callEventSave
(
"20"
,
"对方(专家)接受了通话邀请,主叫(用户)开始加入频道:$channelId"
)
callEventSave
(
"20"
,
"对方(专家)接受了通话邀请,主叫(用户)开始加入频道:$channelId"
)
writeAgoraLog
(
"对方(专家)接受了通话邀请,主叫(用户)开始加入频道:$channelId"
)
writeAgoraLog
(
"对方(专家)接受了通话邀请,主叫(用户)开始加入频道:$channelId"
)
...
@@ -1148,6 +1154,9 @@ class AudioHomeActivity :
...
@@ -1148,6 +1154,9 @@ class AudioHomeActivity :
"Extra Optional Data"
,
"Extra Optional Data"
,
YdlCommonRouterManager
.
getYdlCommonRoute
().
getUid
()
YdlCommonRouterManager
.
getYdlCommonRoute
().
getUid
()
)
)
if
(
joinCode
!=
null
&&
joinCode
==
0
)
{
hasJoinChannel
=
true
}
if
(
joinCode
!=
null
&&
joinCode
<
0
)
{
if
(
joinCode
!=
null
&&
joinCode
<
0
)
{
AudioApiRequestUtil
.
reportCallEvent
(
channelId
,
RtcEvent
(
RtcEvent
.
Event
.
joinFail
),
retCode
=
joinCode
)
AudioApiRequestUtil
.
reportCallEvent
(
channelId
,
RtcEvent
(
RtcEvent
.
Event
.
joinFail
),
retCode
=
joinCode
)
}
}
...
...
m-audioim/src/main/java/com/ydl/audioim/http/AudioApiRequestUtil.kt
View file @
726181ac
...
@@ -172,7 +172,7 @@ annotation class ReportLevel
...
@@ -172,7 +172,7 @@ annotation class ReportLevel
sealed
class
CallEvent
(
val
eventType
:
EventType
,
val
name
:
String
,
val
desc
:
String
,
@ReportLevel
val
reportLevel
:
Int
)
sealed
class
CallEvent
(
val
eventType
:
EventType
,
val
name
:
String
,
val
desc
:
String
,
@ReportLevel
val
reportLevel
:
Int
)
class
RtcEvent
(
val
event
:
Event
)
:
class
RtcEvent
(
val
event
:
Event
)
:
CallEvent
(
EventType
.
RTC
,
event
.
name
.
lowercase
(
Locale
.
getDefault
())
,
event
.
desc
,
event
.
reportLevel
)
{
CallEvent
(
EventType
.
RTC
,
event
.
name
,
event
.
desc
,
event
.
reportLevel
)
{
@Suppress
(
"EnumEntryName"
)
@Suppress
(
"EnumEntryName"
)
enum
class
Event
(
val
desc
:
String
,
@ReportLevel
val
reportLevel
:
Int
)
{
enum
class
Event
(
val
desc
:
String
,
@ReportLevel
val
reportLevel
:
Int
)
{
initSdk
(
"初始化SDK"
,
REPORT_LEVEL_WARN
),
initSdk
(
"初始化SDK"
,
REPORT_LEVEL_WARN
),
...
@@ -194,7 +194,7 @@ class RtcEvent(val event: Event) :
...
@@ -194,7 +194,7 @@ class RtcEvent(val event: Event) :
}
}
class
IMEvent
(
event
:
Event
)
:
CallEvent
(
EventType
.
IM
,
event
.
name
.
lowercase
(
Locale
.
getDefault
())
,
event
.
desc
,
event
.
reportLevel
)
{
class
IMEvent
(
event
:
Event
)
:
CallEvent
(
EventType
.
IM
,
event
.
name
,
event
.
desc
,
event
.
reportLevel
)
{
@Suppress
(
"EnumEntryName"
)
@Suppress
(
"EnumEntryName"
)
enum
class
Event
(
val
desc
:
String
,
@ReportLevel
val
reportLevel
:
Int
)
{
enum
class
Event
(
val
desc
:
String
,
@ReportLevel
val
reportLevel
:
Int
)
{
rtmLogin
(
"登录RTM"
,
REPORT_LEVEL_INFO
),
rtmLogin
(
"登录RTM"
,
REPORT_LEVEL_INFO
),
...
@@ -213,7 +213,7 @@ class IMEvent(event: Event) : CallEvent(EventType.IM, event.name.lowercase(Local
...
@@ -213,7 +213,7 @@ class IMEvent(event: Event) : CallEvent(EventType.IM, event.name.lowercase(Local
}
}
class
LoginEvent
(
event
:
Event
)
:
class
LoginEvent
(
event
:
Event
)
:
CallEvent
(
EventType
.
LOGIN
,
event
.
name
.
lowercase
(
Locale
.
getDefault
())
,
event
.
desc
,
event
.
reportLevel
)
{
CallEvent
(
EventType
.
LOGIN
,
event
.
name
,
event
.
desc
,
event
.
reportLevel
)
{
@Suppress
(
"EnumEntryName"
)
@Suppress
(
"EnumEntryName"
)
enum
class
Event
(
val
desc
:
String
,
@ReportLevel
val
reportLevel
:
Int
)
{
enum
class
Event
(
val
desc
:
String
,
@ReportLevel
val
reportLevel
:
Int
)
{
userLogin
(
"用户登录"
,
REPORT_LEVEL_INFO
),
userLogin
(
"用户登录"
,
REPORT_LEVEL_INFO
),
...
@@ -224,7 +224,7 @@ class LoginEvent(event: Event) :
...
@@ -224,7 +224,7 @@ class LoginEvent(event: Event) :
}
}
class
DeviceEvent
(
event
:
Event
)
:
class
DeviceEvent
(
event
:
Event
)
:
CallEvent
(
EventType
.
DEVICE
,
event
.
name
.
lowercase
(
Locale
.
getDefault
())
,
event
.
desc
,
event
.
reportLevel
)
{
CallEvent
(
EventType
.
DEVICE
,
event
.
name
,
event
.
desc
,
event
.
reportLevel
)
{
@Suppress
(
"EnumEntryName"
)
@Suppress
(
"EnumEntryName"
)
enum
class
Event
(
val
desc
:
String
,
@ReportLevel
val
reportLevel
:
Int
)
{
enum
class
Event
(
val
desc
:
String
,
@ReportLevel
val
reportLevel
:
Int
)
{
beForeground
(
"回到前台"
,
REPORT_LEVEL_INFO
),
beForeground
(
"回到前台"
,
REPORT_LEVEL_INFO
),
...
...
m-audioim/src/main/java/com/ydl/audioim/http/AudioNetAPi.kt
View file @
726181ac
...
@@ -22,6 +22,7 @@ import retrofit2.http.*
...
@@ -22,6 +22,7 @@ import retrofit2.http.*
interface
AudioNetAPi
{
interface
AudioNetAPi
{
@GET
(
"counselor/consultationCall/queryCallInfo"
)
@GET
(
"counselor/consultationCall/queryCallInfo"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
checkCall
(
@Query
(
"calleeUid"
)
calleeUid
:
String
?):
Observable
<
BaseAPIResponse
<
CallCheckBean
>>
fun
checkCall
(
@Query
(
"calleeUid"
)
calleeUid
:
String
?):
Observable
<
BaseAPIResponse
<
CallCheckBean
>>
/**
/**
* 通话开始回调
* 通话开始回调
...
...
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