首先,我使用以下代码,我的应用程序崩溃了:
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.