始终调用状态:"ERROR_USER_UNAVAILABLE" Linphone 管理器 Android
Call State Always : "ERROR_USER_UNAVAILABLE" Linphone manager Android
我想制作可以使用 Linphone 库调用的应用程序,但是为什么当我想调用一个号码时(这个号码可以使用通常的 phone 应用程序调用),它总是状态:"ERROR_USER_UNAVAILABLE"
private void call(String ticket_id) {
updateState("CALLING");
Log.d(TAG_CALL, "try to call");
LinphoneManager.getInstance().newOutgoingCall(msisdn, ticket_id);
callingAttemptHandler.postDelayed(callingAttempt, 1000 * 30);
}
@Override
public void onCallStateChanged(LinphoneCall call, State state, String message) {
Log.d(TAG_CALL, "state: " + state.toString() + " value: " + state.value());
Log.d(TAG_CALL, "message: " + message);
int stateValue = state.value();
switch (stateValue) {
case 1:// incoming received
// startActivity(new Intent(this, IncomingCallActivity.class));
startActivity(new Intent(this, WhenIncomingActivity.class));
break;
case 2:// outgoing init
break;
case 3:// outgoing progress
break;
case 4:// outgoing ringing
break;
case 5:// outgoing early
break;
case 6:// connected
break;
case 7:// connected streaming
break;
case 8:// pausing
break;
case 9:// paused
break;
case 10:// resuming
break;
case 12:// error: User not found, User is temporary unavailable, Request
// timeout
if (CallResponse.ERROR_BUSY.equalsIgnoreCase(message)) {
displayCustomToast(getString(R.string.call_error_user_busy), Toast.LENGTH_LONG);
} else if (CallResponse.ERROR_INCOMPATIBLE.equalsIgnoreCase(message)) {
displayCustomToast(getString(R.string.error_incompatible_media), Toast.LENGTH_LONG);
} else if (CallResponse.ERROR_NOT_FOUND.equalsIgnoreCase(message)) {
displayCustomToast(getString(R.string.call_error_user_not_found), Toast.LENGTH_LONG);
} else if (CallResponse.ERROR_USER_UNAVAILABLE.equalsIgnoreCase(message)
|| CallResponse.ERROR_SERVICE_UNAVAILABLE.equalsIgnoreCase(message)) {
displayCustomToast(getString(R.string.call_error_user_unavailable), Toast.LENGTH_LONG);
} else {
displayCustomToast(getString(R.string.call_error_user_unavailable), Toast.LENGTH_LONG);
}
break;
case 13:// call end: Call Ended, Call Declined, Call Terminated
if (CallResponse.CALL_DECLINED.equalsIgnoreCase(message)) {
displayCustomToast(getString(R.string.call_end_declined), Toast.LENGTH_LONG);
}
break;
case 15:// updated by remote
break;
case 18:// call released
break;
default:
break;
}
}
有人有解决方案吗?
询问提供商后,提供商告诉我 phone 号码不再有效。
所以响应状态CallResponse.ERROR_NOT_FOUND或CallResponse.ERROR_NOT_FOUND可能是由于使用的号码不再有效。
我想制作可以使用 Linphone 库调用的应用程序,但是为什么当我想调用一个号码时(这个号码可以使用通常的 phone 应用程序调用),它总是状态:"ERROR_USER_UNAVAILABLE"
private void call(String ticket_id) {
updateState("CALLING");
Log.d(TAG_CALL, "try to call");
LinphoneManager.getInstance().newOutgoingCall(msisdn, ticket_id);
callingAttemptHandler.postDelayed(callingAttempt, 1000 * 30);
}
@Override
public void onCallStateChanged(LinphoneCall call, State state, String message) {
Log.d(TAG_CALL, "state: " + state.toString() + " value: " + state.value());
Log.d(TAG_CALL, "message: " + message);
int stateValue = state.value();
switch (stateValue) {
case 1:// incoming received
// startActivity(new Intent(this, IncomingCallActivity.class));
startActivity(new Intent(this, WhenIncomingActivity.class));
break;
case 2:// outgoing init
break;
case 3:// outgoing progress
break;
case 4:// outgoing ringing
break;
case 5:// outgoing early
break;
case 6:// connected
break;
case 7:// connected streaming
break;
case 8:// pausing
break;
case 9:// paused
break;
case 10:// resuming
break;
case 12:// error: User not found, User is temporary unavailable, Request
// timeout
if (CallResponse.ERROR_BUSY.equalsIgnoreCase(message)) {
displayCustomToast(getString(R.string.call_error_user_busy), Toast.LENGTH_LONG);
} else if (CallResponse.ERROR_INCOMPATIBLE.equalsIgnoreCase(message)) {
displayCustomToast(getString(R.string.error_incompatible_media), Toast.LENGTH_LONG);
} else if (CallResponse.ERROR_NOT_FOUND.equalsIgnoreCase(message)) {
displayCustomToast(getString(R.string.call_error_user_not_found), Toast.LENGTH_LONG);
} else if (CallResponse.ERROR_USER_UNAVAILABLE.equalsIgnoreCase(message)
|| CallResponse.ERROR_SERVICE_UNAVAILABLE.equalsIgnoreCase(message)) {
displayCustomToast(getString(R.string.call_error_user_unavailable), Toast.LENGTH_LONG);
} else {
displayCustomToast(getString(R.string.call_error_user_unavailable), Toast.LENGTH_LONG);
}
break;
case 13:// call end: Call Ended, Call Declined, Call Terminated
if (CallResponse.CALL_DECLINED.equalsIgnoreCase(message)) {
displayCustomToast(getString(R.string.call_end_declined), Toast.LENGTH_LONG);
}
break;
case 15:// updated by remote
break;
case 18:// call released
break;
default:
break;
}
}
有人有解决方案吗?
询问提供商后,提供商告诉我 phone 号码不再有效。
所以响应状态CallResponse.ERROR_NOT_FOUND或CallResponse.ERROR_NOT_FOUND可能是由于使用的号码不再有效。