android - SipManager 未注册到 SipRegistrationListener
问题描述
首先,我使用了这段代码,我的应用程序崩溃了:
mysipregistrationlistener:=TJSipRegistrationListener.create;
下一个代码正在为我运行:
mysipmanager.setRegistrationListener(mysipprofile.getUriString,mySipRegistrationListener);
mysipmanager.open(mysipprofile,mypendingintent,mySipRegistrationListener);
下一步:我使用此代码进行注册:
mysipmanager.register(mysipprofile,30,mySipRegistrationListener);
但我得到了这个错误:
android.net.sip.SipException:SipService.createSession() 返回 null。
如何将我的 SipManager 注册到我的 SipRegistrationListener?
谢谢,
此致。
编辑:我的新单位,但我缺少一些东西。
unit Androidapi.JNI.SIPREG;
interface
uses
Androidapi.JNIBridge,
Androidapi.JNI.GraphicsContentViewText,
Androidapi.JNI.JavaTypes,
Androidapi.JNI.Net;
type
TMySipRegistrationListener = class(TJavaLocal, JSipRegistrationListener)
private
public
constructor Create;
procedure onRegistering(localProfileUri: JString); cdecl;
procedure onRegistrationDone(localProfileUri: JString; expiryTime: integer); cdecl;
procedure onRegistrationFailed(localProfileUri: JString; errorCode: integer; errorMessage: JString); cdecl;
end;
implementation
constructor TMySipRegistrationListener.Create;
begin
inherited;
end;
procedure TMySipRegistrationListener.onRegistering(localProfileUri: JString);
begin
//
end;
procedure TMySipRegistrationListener.onRegistrationDone(localProfileUri: JString; expiryTime: Integer);
begin
//
end;
procedure TMySipRegistrationListener.onRegistrationFailed(localProfileUri: JString; errorCode: Integer; errorMessage: JString);
begin
//
end;
end.
解决方案
推荐阅读
- javascript - 如何使用 sendkeys 生成增量版本号
- tensorflow - 使用 TensorFlow 或 PyTorch 的图像相似度
- html - 如何使用 puppetetteer 将抓取的数据添加到 html 中
- kubernetes - Kubernetes 可以在 Pod 之间共享单个 GPU 吗?
- css - 当 textarea 有值时更改标签颜色
- php - 使用时间计算变量
- sql - 如何将 NTILE 函数应用于 SQL 列
- ssl - Logstash 不接受自签名证书并引发 sslv3 警报握手失败
- java - 如何在java中的spring数据聚合中实现$size
- php - WordPress:将查询字符串附加到所有 URL