0

I am writing an application in Java to make calls and view when people are in calls, their phone is ringing or are idle, using the library Jain-Sip and at the moment am trying to correctly implement presence with SUBSCRIBE and NOTIFY messages. I am able to get presence data to be received, but after a while the presence data stops being displayed by my program.

I believe this is because the overridden method "processRequest" is not being called. This is the earliest point in the program where NOTIFY messages are being handled and not even the print statements are being output.

The bizarre thing about this is that the notify messages are being sent when I make calls, and the presence data is there. I know this because I have done Wireshark traces when running the program.

Note: No exceptions are occurring during execution of the program, to cause erroneous behaviour.

If anybody has any insight into why this is happening, I would be very grateful.

Thanks a lot, Adam

1 Answers1

0

Make sure you add your listener class correctly. The only other possible cause would be if the NOTIFY is unsolicited, which should not be the case but it happens. Try to enable this flag gov.nist.javax.sip.DELIVER_UNSOLICITED_NOTIFY. See more about it here https://jsip.ci.cloudbees.com/job/jsip/javadoc/gov/nist/javax/sip/SipStackImpl.html

Otherwise you will need to attach DEBUG logs to figure it out, could be malformed request or something of the sort.

Vladimir Ralev
  • 1,371
  • 9
  • 18
  • What makes this problem more complicated is that the presence works for a period of time (like five minutes) and then stops. I've tried extending the value for the expires header of the request to no avail. – user3279210 Apr 20 '14 at 15:05
  • Well, you have to send me debug logs to see that. Are you using the latest jsip? – Vladimir Ralev Apr 20 '14 at 17:43
  • I'm using 1.1, it was the version being used when I took over the project. Nothing is printed to the std output since the last the last request, nothing concerning the latest requests which wireshark says are happening. – user3279210 Apr 20 '14 at 18:43
  • You need to configure your logger to print DEBUG statements. See gov.nist.javax.sip.TRACE_LEVEL here https://jsip.ci.cloudbees.com/job/jsip/javadoc/gov/nist/javax/sip/SipStackImpl.html – Vladimir Ralev Apr 21 '14 at 09:12
  • Done this now, looking at the debug logs and server logs. One thing that stands out in the debug log is a timeoutTimer being enabled. – user3279210 Apr 22 '14 at 10:15
  • Timeout timer is normal. Look for lines that drop the message, retransmissions or malformed requests. – Vladimir Ralev Apr 22 '14 at 11:38
  • Looking now, I am finding a lot of "retransmissionTicks" though.I believe that the requests are fine because if it was working before, they should, shouldn't they? – user3279210 Apr 22 '14 at 12:29
  • Well if there are retransmissions then look for transport problem, wrong port/host or tcp/udp mismatch, bad contact etc. Can't tell anything without seeing the logs and pcaps. – Vladimir Ralev Apr 22 '14 at 21:01
  • Thank you for all your help, here are copies of the debug log, server log and packet trace. https://www.dropbox.com/s/zly8lpsicbx21l7/debugLog.log https://www.dropbox.com/s/ghkzk0jlihw11zt/serverLog.txt https://www.dropbox.com/s/ybzeoboamlvoqy3/packetTraceExample.txt – user3279210 Apr 26 '14 at 11:13
  • You need gov.nist.javax.sip.TRACE_LEVEL=32 to created debug log. These logs don't tell that much. I see you are mixing at least 3 subnets here and there is NAT and DNS, so my money is on a NAT issue. – Vladimir Ralev Apr 26 '14 at 12:31
  • I thought I had that set up correctly, I have the following line in the code I use to initialise the SIP listening part of the program. properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "32"); Perhaps I am missing the correct file or haven't imported the correct class? – user3279210 Apr 28 '14 at 08:11
  • I believe that I might be missing some classes in the package "gov.nist.java.sip". I have the version of jsip from jsip.java.net, but am missing things such as SipStackExt. – user3279210 Apr 29 '14 at 11:02
  • Sorry to bother you with this, I have seen the below example on the web. Could you point me in the direction of the jar files needed, please. I'm using the example there as the basis for my authorization. http://dev.telestax.com/jain-sip/source/browse/#git%2Fsrc%2Fexamples%2Fauthorization%253Fstate%253Dclosed – user3279210 Apr 30 '14 at 14:35
  • Vladimir, I was able to get a more detailed debug by using a newer version of the library. I would be very grateful if you could take a look at this. https://www.dropbox.com/s/3covgxqwmhe9yrz/applicationDebugLog.log – user3279210 May 27 '14 at 12:52