【发布时间】:2019-06-28 17:34:43
【问题描述】:
我构建包含 SIP/VOIP 呼叫的应用程序。我在三星、Redmi、一加一中运行该应用程序它工作正常但是当我在 Micromax、Moto G 设备中运行相同的应用程序时,它在我呼叫 SIP/VOIP 时崩溃Function.It 在 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();
}
}
这背后的问题是什么? 帮我解决这个问题 提前致谢。
【问题讨论】:
-
它们都在 5.0+ 上运行吗?
-
是的@Deb,但仅限于某些设备,如三星、redmi 不在 micromax、moto g 中运行
标签: android device sip voip notsupportedexception