Hi,
i'm having prolem when i try to call sip.register doesn't invoke any event and receive nothing. I think that i need to unregister the device that is already registered.
I found this code to unregister profile :
and implement after sip.registration but it goes in error
Have you any ideas?
Where am I going wrong?
Regards.
i'm having prolem when i try to call sip.register doesn't invoke any event and receive nothing. I think that i need to unregister the device that is already registered.
I found this code to unregister profile :
B4X:
Dim r As Reflector
r.Target = Sip
Dim manager As JavaObject = r.GetField("manager")
Dim profile As JavaObject = r.GetField("me")
manager.RunMethod("unregister", Array(profile, Null))
and implement after sip.registration but it goes in error
B4X:
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:131)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at com.xxx.xxx.incomingcall.onCreate(incomingcall.java:56)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3378)
at android.app.ActivityThread.-wrap4(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1706)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
Caused by: android.net.sip.SipException: SipService.createSession() returns null
at android.net.sip.SipManager.unregister(SipManager.java:540)
... 19 more
Have you any ideas?
Where am I going wrong?
Regards.