Translate liblinphone error messages and display if call declined
This commit is contained in:
parent
5bad3c1abd
commit
47cab32935
3 changed files with 12 additions and 6 deletions
|
@ -357,4 +357,6 @@
|
|||
<string name="pref_rfc2833_dtmf">Envoyer les DTMFs RFC2833</string>
|
||||
<string name="pref_sipinfo_dtmf">Envoyer les DTMFs en SIP INFO</string>
|
||||
|
||||
<string name="error_call_declined">Appel rejeté</string>
|
||||
<string name="error_user_not_found">Utilisateur non trouvé</string>
|
||||
</resources>
|
||||
|
|
|
@ -403,4 +403,7 @@
|
|||
|
||||
<string name="pref_rfc2833_dtmf">Send RFC2833 DTMFs</string>
|
||||
<string name="pref_sipinfo_dtmf">Send SIP INFO DTMFs</string>
|
||||
|
||||
<string name="error_call_declined">Call declined</string>
|
||||
<string name="error_user_not_found">User not found</string>
|
||||
</resources>
|
||||
|
|
|
@ -823,12 +823,7 @@ public class LinphoneActivity extends FragmentActivity implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onCallStateChanged(LinphoneCall call, State state,
|
||||
String message) {
|
||||
if (state == State.Error) {
|
||||
displayCustomToast(message, Toast.LENGTH_LONG);
|
||||
}
|
||||
|
||||
public void onCallStateChanged(LinphoneCall call, State state, String message) {
|
||||
if (state == State.IncomingReceived) {
|
||||
startActivity(new Intent(this, IncomingCallActivity.class));
|
||||
} else if (state == State.OutgoingInit) {
|
||||
|
@ -838,6 +833,12 @@ public class LinphoneActivity extends FragmentActivity implements
|
|||
startIncallActivity(call);
|
||||
}
|
||||
} else if (state == State.CallEnd || state == State.Error || state == State.CallReleased) {
|
||||
// Convert LinphoneCore message for internalization
|
||||
if (message != null && message.equals("Call declined.")) {
|
||||
displayCustomToast(getString(R.string.error_call_declined), Toast.LENGTH_LONG);
|
||||
} else if (message != null && message.equals("User not found.")) {
|
||||
displayCustomToast(getString(R.string.error_user_not_found), Toast.LENGTH_LONG);
|
||||
}
|
||||
resetClassicMenuLayoutAndGoBackToCallIfStillRunning();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue