gpt4 book ai didi

java - Android SIP 注册失败 (-9 IN_PROGRESS)

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:02:42 24 4
gpt4 key购买 nike

这是我的注册码:

    protected void initializeManagerOpen(){
consoleWrite("initializeOpen");
if(mSipManager==null) {
return;
}
SipProfile.Builder builder;
try {
builder = new SipProfile.Builder("13", "10.0.0.4");
builder.setPassword("13");
builder.setPort(5062);
builder.setProtocol("UDP");
mSipProfile = builder.build();

try {
Intent intent = new Intent();
intent.setAction("android.SipDemo.INCOMING_CALL");
PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, intent, Intent.FILL_IN_DATA);
mSipManager.open(mSipProfile, pendingIntent, null);

mSipManager.setRegistrationListener(mSipProfile.getUriString(), new SipRegistrationListener() {

public void onRegistering(String localProfileUri) {
mNotificationTask.endNotification();
mNotificationTask.createNotification(R.drawable.ic_stat_connecting,"Test","Connecting");

consoleWrite("Registering with SIP Server...");
}

public void onRegistrationDone(String localProfileUri, long expiryTime){
mNotificationTask.endNotification();
mNotificationTask.createNotification(R.drawable.ic_stat_connected,"Test","Connected");

consoleWrite("Ready");
}

public void onRegistrationFailed(String localProfileUri, int errorCode, String errorMessage){
mNotificationTask.endNotification();
mNotificationTask.createNotification(R.drawable.ic_stat_disconnected,"Test","Failed to connect:"+errorCode);

consoleWrite("Registration failed. Please check settings.");
consoleWrite(""+errorCode);
consoleWrite(errorMessage);
}

});
} catch (SipException e) {
e.printStackTrace();
}
} catch (ParseException e) {
e.printStackTrace();
}
}

虽然有时它注册成功,但大多数时候我得到一个错误代码-9:

Registration failed.  Please check settings.
-9
0

我在引用网站上找到了这个描述:

public static final int IN_PROGRESS
The client is in a transaction and cannot initiate a new one.
Constant Value: -9 (0xfffffff7)

具体是什么意思?我的电话上没有运行任何其他 SIP 应用程序。

附言。第一次尝试连接时,它正在工作。但是第二次它返回-9。也许我没有正确关闭连接?我想我有问题,因为我正在尝试关闭连接但它没有关闭...

public void closeLocalProfile() {
if(mSipManager==null){
return;
}
try{
if(mSipProfile!=null){
mSipManager.close(mSipProfile.getUriString());

consoleWrite("mSipManager Closed - "+mSipProfile.getUriString());
}
}catch(Exception e){
consoleWrite("Failed to close local profile. - "+e);
}
}

最佳答案

从调用参数中删除所有 SIP 帐户并重试:

调用App->参数->调用账号internet删除所有帐户

PS:对不起,名字菜单,我的手机不是英文的

关于java - Android SIP 注册失败 (-9 IN_PROGRESS),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20594095/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com