|
@@ -51,7 +51,7 @@ class SipCallFragment: BaseCallFragment() {
|
|
|
state: Call.State,
|
|
|
message: String
|
|
|
) {
|
|
|
- Log.d(TAG, "received call state: $state, ${call.remoteAddress}")
|
|
|
+ Log.e(TAG, "received call state: $state, ${call.remoteAddress.displayName}, $message")
|
|
|
if (state == Call.State.IncomingReceived) {
|
|
|
//来电时将自动接听
|
|
|
if (sipCore != null) {
|
|
@@ -339,7 +339,7 @@ class SipCallFragment: BaseCallFragment() {
|
|
|
Constant.interactionId = curInteractionVO.id
|
|
|
fromId = curTcpModel.fromId
|
|
|
acceptCall()
|
|
|
- if (sipCore == null && TextUtils.isEmpty(curInteractionVO.toSipId)) {
|
|
|
+ if (sipCore == null || TextUtils.isEmpty(curInteractionVO.toSipId)) {
|
|
|
//通话失败,重置并返回主界面
|
|
|
showMessage("Core或targetSipId为空!")
|
|
|
Constant.CALL_STATE = Constant.CALL_STANDBY
|
|
@@ -348,12 +348,12 @@ class SipCallFragment: BaseCallFragment() {
|
|
|
}
|
|
|
callEnd(true)
|
|
|
} else {
|
|
|
- //todo: 这里需要修改target sip
|
|
|
- val addressToCall = sipCore!!.interpretUrl("3309")
|
|
|
+ val addressToCall = sipCore!!.interpretUrl(curInteractionVO.toSipId)
|
|
|
val params = sipCore!!.createCallParams(null)
|
|
|
params.enableVideo(false)
|
|
|
if (addressToCall != null) {
|
|
|
sipCore!!.inviteAddressWithParams(addressToCall, params)
|
|
|
+ Log.d(TAG, "invite target device: " + addressToCall.asString())
|
|
|
}
|
|
|
}
|
|
|
} else if (curTcpModel.getAction() == TcpAction.VoiceAction.REJECT) {
|