Properly handle transfer request when original call is already closed
This commit is contained in:
@@ -1182,20 +1182,38 @@ class MainActivity : AppCompatActivity() {
|
|||||||
startActivity(i)
|
startActivity(i)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
val call = Call.ofCallp(callp)!!
|
val call = Call.ofCallp(callp)
|
||||||
val target = Utils.friendlyUri(this, ev[1], acc)
|
val target = Utils.friendlyUri(this, ev[1], acc)
|
||||||
with(MaterialAlertDialogBuilder(this, R.style.AlertDialogTheme)) {
|
with(MaterialAlertDialogBuilder(this, R.style.AlertDialogTheme)) {
|
||||||
|
if (call != null) {
|
||||||
setTitle(R.string.transfer_request)
|
setTitle(R.string.transfer_request)
|
||||||
setMessage(String.format(getString(R.string.transfer_request_query),
|
setMessage(
|
||||||
target))
|
String.format(
|
||||||
|
getString(R.string.transfer_request_query),
|
||||||
|
target
|
||||||
|
)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
setTitle(R.string.call_request)
|
||||||
|
setMessage(
|
||||||
|
String.format(
|
||||||
|
getString(R.string.call_request_query),
|
||||||
|
target
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
setPositiveButton(getString(R.string.yes)) { dialog, _ ->
|
setPositiveButton(getString(R.string.yes)) { dialog, _ ->
|
||||||
if (call in Call.calls())
|
if (call in Call.calls())
|
||||||
acceptTransfer(ua, call, ev[1])
|
acceptTransfer(ua, call!!, ev[1])
|
||||||
|
else {
|
||||||
|
callUri.setText(ev[1])
|
||||||
|
makeCall()
|
||||||
|
}
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
}
|
}
|
||||||
setNeutralButton(getString(R.string.no)) { dialog, _ ->
|
setNeutralButton(getString(R.string.no)) { dialog, _ ->
|
||||||
if (call in Call.calls())
|
if (call in Call.calls())
|
||||||
call.notifySipfrag(603, "Decline")
|
call!!.notifySipfrag(603, "Decline")
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
}
|
}
|
||||||
show()
|
show()
|
||||||
|
|||||||
@@ -533,6 +533,8 @@
|
|||||||
<string name="verify_sas">Todennatko SAS:n <%1$s>\?</string>
|
<string name="verify_sas">Todennatko SAS:n <%1$s>\?</string>
|
||||||
<string name="transfer_request">Siirtopyyntö</string>
|
<string name="transfer_request">Siirtopyyntö</string>
|
||||||
<string name="transfer_request_query">Hyväksytkö tämän puhelun siirron kohteeseen \'%1$s\'\?</string>
|
<string name="transfer_request_query">Hyväksytkö tämän puhelun siirron kohteeseen \'%1$s\'\?</string>
|
||||||
|
<string name="call_request">Soittopyyntö</string>
|
||||||
|
<string name="call_request_query">Hyväksytkö pyynnön soittaa kohteeseen \'%1$s\'\?</string>
|
||||||
<string name="redirect_notice">Automaattinen uudelleenohjaus kohteeseen \'%1$s\'\</string>
|
<string name="redirect_notice">Automaattinen uudelleenohjaus kohteeseen \'%1$s\'\</string>
|
||||||
<string name="redirect_request">Uudelleenohjauspyyntö</string>
|
<string name="redirect_request">Uudelleenohjauspyyntö</string>
|
||||||
<string name="redirect_request_query">Hyväksytkö puhelun uudelleenohjauksen kohteeseen \'%1$s\'\?</string>
|
<string name="redirect_request_query">Hyväksytkö puhelun uudelleenohjauksen kohteeseen \'%1$s\'\?</string>
|
||||||
|
|||||||
@@ -505,6 +505,8 @@
|
|||||||
<string name="verify_sas">Do you want to verify SAS <%1$s>\?</string>
|
<string name="verify_sas">Do you want to verify SAS <%1$s>\?</string>
|
||||||
<string name="transfer_request">Transfer Request</string>
|
<string name="transfer_request">Transfer Request</string>
|
||||||
<string name="transfer_request_query">Do you accept to transfer this call to \'%1$s\'\?</string>
|
<string name="transfer_request_query">Do you accept to transfer this call to \'%1$s\'\?</string>
|
||||||
|
<string name="call_request">Call Request</string>
|
||||||
|
<string name="call_request_query">Do you accept request to call \'%1$s\'\?</string>
|
||||||
<string name="redirect_notice">Automatic redirection to \'%1$s\'\</string>
|
<string name="redirect_notice">Automatic redirection to \'%1$s\'\</string>
|
||||||
<string name="redirect_request">Redirect Request</string>
|
<string name="redirect_request">Redirect Request</string>
|
||||||
<string name="redirect_request_query">Do you accept call redirection to \'%1$s\'\?</string>
|
<string name="redirect_request_query">Do you accept call redirection to \'%1$s\'\?</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user