SipManager doesn’t be registered to SipRegistrationListener

  

Firstly, I used this code and my app crashed:

mysipregistrationlistener:=TJSipRegistrationListener.create;

Next code is running for me:

mysipmanager.setRegistrationListener(mysipprofile.getUriString,mySipRegistrationListener);
mysipmanager.open(mysipprofile,mypendingintent,mySipRegistrationListener);

Next step: I used this code for registration:

mysipmanager.register(mysipprofile,30,mySipRegistrationListener);

But I got this error:

android.net.sip.SipException:
SipService.createSession() returns null.

How can I do registered my SipManager to my SipRegistrationListener?

Thanks,

Best Regards.

Editted: My new Unit, But some things missing for me.

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.

Comments are closed.