0

I am currently attempting to build an application using Jain-Sip and am having difficulty implementing a feature which will re-subscribe to the contacts I wish to continue receiving presence updates from. I am currently attempting to do this using dialogs, as in the following guide: http://www.oracle.com/technetwork/articles/entarch/introduction-jain-sip2-085495.html

I am wanting to do this for various contacts, so I have maintained an array of dialogs which I can hopefully use when dealing with the various contacts. The problem is, I receive an exception which says as follows:

javax.sip.SipException: Dialog (dialog) not yet established or terminated Terminated Dialog

If you could point me in the right direction I would be very grateful, Adam

1 Answers1

0

You should attach post debug logs to see what is going on. Typically it will be obvious why a dialog is terminated - either a timeout, manual delete or error from somewhere.

Vladimir Ralev
  • 1,371
  • 9
  • 18
  • Thank you for getting in touch with me Vladimir, not sure if you saw my previous message to you, regarding the issue I was having with subscription duration. I managed to get a better debug log. – user3279210 May 28 '14 at 15:01
  • Also is it actually possible to SUBSCRIBE to multiple people and then keep a copy of the dialog, than refer to the stored dialog later, when wanting to refresh the subscription. Sorry about all these questions, is it actually essential to have the request used to refresh the subscription in a dialog? – user3279210 May 28 '14 at 15:04
  • I can't find the logs in any message? As far as JAIN SIP goes, yes, it's possible to subscribe to multiple people, it depends on the other party if you will be allowed though. Sometimes you can subscribe in bulk with a presence server. You need to see which RFCs you are implementing. – Vladimir Ralev May 29 '14 at 04:48
  • Sorry, I should have given a link to it. Here it is: . Thanks, I'm looking at RFCs 3261 and 3265. Specifically I'm trying to implement this "If the subscriber wishes to re-subscribe to the state, he does so by composing an unrelated initial SUBSCRIBE request with a freshly-generated Call-ID and a new, unique "From" tag (see section 3.1.4.1.)" to include re-subscription functionality. My problem is that I receive the following error when trying to re-subscribe to a person using the dialog from the first time subscribing. "Dialog not yet established or terminated Terminated Dialog" – user3279210 May 29 '14 at 08:14
  • This is the log I was talking about: dropbox.com/s/3covgxqwmhe9yrz/applicationDebugLog.log – user3279210 May 29 '14 at 08:15
  • In short, what I'm currently doing is this (see "sending messages inside a dialog"): http://www.oracle.com/technetwork/articles/entarch/introduction-jain-sip2-085495.html But having a dialog for each person I'm subscribing to, and then using the dialog for that person when I want to re-subscribe. – user3279210 May 29 '14 at 08:19
  • I forgot to say, I'm also looking at RFC 3856 and am trying to implement this rather than anything else. "sending a SUBSCRIBE refresh within the same dialog established by the initial SUBSCRIBE. This SUBSCRIBE is nearly identical to the initial one, but contains a tag in the To header field, a higher CSeq header field value, and possibly a set of Route header field values that identify the path of proxies the request is to take" – user3279210 May 29 '14 at 08:53
  • I don't see SipException in those logs. There are many app exceptions such as this project.ctiapp2.SipConnectionListener.subscribeToPeople(SipConnectionListener.java:606) Otherwise everything seems fine. You should probably change the from tags to be different to avoid some problems with dialog matching. – Vladimir Ralev May 29 '14 at 12:18
  • Yes, that's right, there is no notification that says anything has changed in the application. All I can really say is, for some reason the program stops showing presence updates. The odd thing about it is that this happens before the expiry timer has run out. – user3279210 May 29 '14 at 12:24
  • Also, I am now trying to work with one dialog for all people I am subscribing to, a bit less clean in my opinion but I need to work on other things. – user3279210 May 29 '14 at 12:26
  • The first post mentions a SipException. If that's resolved and the app exceptions are fine, it's the remote party responsibility to deliver the NOTIFYs. Do you know if the remote party is sending anything? – Vladimir Ralev May 29 '14 at 12:37
  • I believe there is some confusion, the log I sent you was regarding an earlier problem you were helping me with, one from another month where you asked me to provide you with a log and was concerning the program not showing presence changes before the expires value ended. Nothing alerts me to what causes the program to do this. It also occurs that Wireshark doesn't show any notifies after this point. – user3279210 May 29 '14 at 12:54
  • If the remote side doesnt send NOTIFYs you should be looking at their logs. I don't understand your app very well. IMHO you should fix the exceptions and provide clean log. Also take a look at Jitsi, I think they support p2p presence in the way you are trying to implement it with JSIP. – Vladimir Ralev May 29 '14 at 14:16
  • Sorry to keep on bothering you, it seems that this area of software development, while being active is a little niche. So finding help for your problems can be a little tricky. I didn't really explain what the app does to be honest, just went into detail regarding the problems. A problem with the exceptions is that I don't see any appear at all during the operation of the program, nothing written to stderr. Also, I would much prefer to stay with JSIP, I believe it's suitable for what I am trying to achieve, but perhaps a little low level. – user3279210 May 30 '14 at 08:19
  • Also, could I ask you another question if it is not too much trouble, what is the correct way to use SIP dialogs when doing subscribes. I give the request a unique tag in the to header and a unique tag in the from header, resulting in Wireshark to say that the subscribe is "in-dialog", but my server rejects the subscribe. The application keeps trying to subscribe and then I receive a timeout. – user3279210 May 30 '14 at 08:23
  • It doesn't really get much easier than JSIP :) Changing the tags and the call id should be enough for any server to respect as a new dialog identifier. When you say the subscribe times out that implies the server doesn't respond at all. If your server doesn't respond with an error code to the subscribe then make sure to understand why. If that server is just dropping requests with no response it's probably a bad server. Capture a few working examples and repeat them. Also watch out for the CSeq to be up to date. JSIP will take care of it if you are dialog stateful, but still keep an eye on it. – Vladimir Ralev May 30 '14 at 16:25
  • Thank you for your help, I managed to solve it by getting the dialog from the response events of each of the first subscribes and then using then for the subsequent subscribes. If there is a better way of doing it, that would be great. – user3279210 Jun 02 '14 at 08:27