0

Hello fellow developers,

I am developing SIP application using PJSIP library... Here is my code

And here is my Logcat log

The problem is application is not trying to proceed registration, and no errors at all... (Or I missed something?)

And log on my Kamailio Server (when my device tries to connect and log stucks nothing happens):

22(32406) DEBUG: <core> [ip_addr.c:229]: print_ip(): tcpconn_new: new tcp connection: 192.168.0.150
22(32406) DEBUG: <core> [tcp_main.c:985]: tcpconn_new(): on port 17749, type 3
22(32406) DEBUG: <core> [tcp_main.c:1295]: tcpconn_add(): hashes: 879:4076:3775, 50
22(32406) DEBUG: <core> [io_wait.h:376]: io_watch_add(): DBG: io_watch_add(0x9f8540, 44, 2, 0x7f6cdbbf3948), fd_no=34

ps. I tested server with ready client and everything is ok...

Thanks in advance :)

JavaMachine
  • 601
  • 1
  • 9
  • 27

1 Answers1

0

I have resolved issue...

The problem was in registering PJSIP in another thread... I was using main Thread and initializing connection on OnCreate() event in MainActivity. Which means, after OnCreate() fired and finishes its job, initialization process was getting destroyed before it connects into server...

What I did:

Before:

UaConfig ua_cfg = epConfig.getUaConfig();
ua_cfg.setUserAgent("Pjsua2 Android " + ep.libVersion().getFull());
ua_cfg.setThreadCnt(0);
ua_cfg.setMainThreadOnly(true);

After:

UaConfig ua_cfg = epConfig.getUaConfig();
ua_cfg.setUserAgent("Pjsua2 Android " + ep.libVersion().getFull());

Removing those lines makes PJSIP library to create its own worker thread...

JavaMachine
  • 601
  • 1
  • 9
  • 27