首页 > 解决方案 > 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.

标签: androiddelphifiremonkeysip

解决方案


推荐阅读