我构建包含 SIP/VOIP 呼叫的应用程序。我在三星、Redmi、一加一中运行该应用程序它工作正常但是当我在 Micromax、Moto G 设备中运行相同的应用程序时,它在我调用 SIP/VOIP 功能时崩溃。它的在 Logcat 中显示错误。
错误:
Error when trying to close manager. android.net.sip.SipException: VOIP API is not supported
我的功能是
public void initiateCall() {
EditText Concode;
Concode=(EditText)findViewById(R.id.ConfCode);
String sipadd="sip address";
if(sipadd!= null && !sipadd.isEmpty()){
// updateStatus(sipAddress);
try {
SipAudioCall.Listener listener = new SipAudioCall.Listener() {
// Much of the client's interaction with the SIP Stack will
// happen via listeners. Even making an outgoing call, don't
// forget to set up a listener to set things up once the call is established.
@Override
public void onCallEstablished(SipAudioCall call) {
call.startAudio();
call.setSpeakerMode(false);
// call.toggleMute();
//updateStatus(call);
}
@Override
public void onCallEnded(SipAudioCall call) {
//updateStatus("Ready.");
}
};
call = manager.makeAudioCall(me.getUriString(), sipadd, listener, 30);
}
catch (Exception e) {
Log.i("JoinConfWithoutLogin/InitiateCall", "Error when trying to close manager.", e);
if (me != null) {
try {
manager.close(me.getUriString());
} catch (Exception ee) {
Log.i("MainActivity/InitiateCall",
"Error when trying to close manager.", ee);
ee.printStackTrace();
}
}
if (call != null) {
call.close();
}
}}
else {
new AlertDialog.Builder(this)
.setTitle("Error")
.setMessage("Enter Conferance Code")
.setNegativeButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// do nothing
}
})
.setIcon(android.R.drawable.ic_dialog_alert)
.show();
}
}
这背后的问题是什么?帮我解决这个问题提前谢谢。