问题出在土耳其语区域中的sip呼叫。
如果设备上当前的语言环境为土耳其语,则任何工作域的任何sip注册都以-4的注册错误结束(仅在Xiaomi Mi MIX2错误-5上)。
而且,最有趣的是,在其他任何语言环境(在RU,PL,PT,FR,DE上测试)上,sip都可以正常工作,没有任何错误。
除三星S8和三星S9以外,几乎所有的Android设备(在土耳其语环境中)都存在此问题。
作为解决该问题的方法,针对一种有效的语言环境对配置中的语言环境进行了测试,但未发生任何更改-注册以上述错误结束。
在android.sip中,我们分别传递上下文,这种想法是从比赛中看到的内容,然后用工作区域的数据代替,但是sip的所有内容 上下文是packageName,在所有语言环境中,此名称都是相同且正确的。
我使用android.sip的官方实现。我只删除注册码,因为成功注册后,通话正常工作:
private final SipRegistrationListener callIfReadyListener = new SipRegistrationListener () {
public void onRegistering (String localProfileUri) {
Log.d (TAG, "Registering with SIP Server ...");
}
public void onRegistrationDone (String localProfileUri, long expiryTime)
{
Log.d (TAG, "Ready");
if (! cancel)
handler.post (new Runnable () {
@Override
public void run () {
startCall ();
}
});
}
public void onRegistrationFailed (String localProfileUri, int errorCode,
String errorMessage) {
Log.d (TAG, "Registration failed. Please check settings.");
Log.d (TAG, "Registration failed with errorCode" \ n "errorMessage");
if (errorCode! = SipErrorCode.IN_PROGRESS) {
retryCall ();
}
}
};
SipProfile.Builder builder = new SipProfile.Builder (username, domain);
String displayName = repository.getPrefix () + "_Android_" + String.valueOf (repository.getUserId());
builder.setDisplayName(displayName);
builder.setPassword(password);
me = builder.build();
Intent i = new Intent();
i.setAction("android.SipDemo.INCOMING_CALL");
PendingIntent pi = PendingIntent.getBroadcast (context, 0, i, Intent.FILL_IN_DATA);
manager.open(me, pi, null);
manager.register(me, 30, callIfReadyListener);
Logs with an error:
I / PermissionHelper: PERMISSION: Permission Granted
D / SipPresenter: Initialize Profile
Android_displayname
Registering with SIP Server ...
Registration failed. Please check settings.
Registration failed with -4
registration timed out
retry calling
Initialize profile
Android_displayname
Registering with SIP Server ...
Registration failed. Please check settings.
Registration failed with -4
Work Logs:
PERMISSION: Permission Granted
D / SipPresenter: Initialize Profile
D / SipPresenter: Android_displayname
W / System.err: android.net.sip.SipException: SipService.createSession() returns null
W / System.err: at android.net.sip.SipManager.register(SipManager.java e13)
W / System.err: SipPresenter.initializeLocalProfile(SipPresenter.java:150)
W / System.err: SipPresenter.initializeManager SipPresenter.java:120)
W / System.err: SipPresenter $ 5.run (SipPresenter.java:214)
D / SipPresenter: retry calling
D / SipPresenter: Connection Error.
D / SipPresenter: Initialize Profile
D / SipPresenter: Android_displayname
D / SipPresenter: Registering with SIP Server ...
D / SipPresenter: Ready
D / SipPresenter: sip: name__token @ domain
D / SipPresenter: TR @ domain
D / SipPresenter: android.net.sip.SipAudioCall@3a08306
D / SipPresenter: call established
D / AudioGroup: stream [96] is configured as GSM 8kHz 20ms mode 0
D / AudioGroup: stream [114] is configured as RAW 8kHz 32ms mode 0
D / AudioGroup: stream [114] joins group [113]
D / AudioGroup: stream [96] joins group [113]
D / AudioGroup: group [113] switches from mode 0 to 2
D / AudioGroup: reported frame count: output 328, input 320
D / AudioGroup: adjusted frame count: output 512, input 512
D / AudioTrack: Client defaulted notificationFrames to 170 for frameCount 512
D / AudioGroup: latency: output 112, input 64
D / AudioGroup: stream [96] leaves group [113]
D / AudioGroup: stream [96] is dead
D / AudioTrack: stop() called with 16384 frames delivered
D / AudioGroup: stream [114] is dead
D / AudioGroup: group [113] is dead
此外,这些调用在另一个库org.pjsip.pjsua2上进行了测试,所有内容在土耳其语区域设置中均正常运行。有建议表明,问题是在各种设备上对Android的优化不佳 除了Samsung,尽管该库仅从上下文中获取packageName,但在深度上使用android.os功能。
在这件事上,我寻求帮助,可以在土耳其语环境中使用哪种设置或拐杖。预先谢谢你。