Re: Re: SUBSCRIBE problem

"Jens Tinfors" <[email protected]> Wed, 17 Jan 2007 17:57:29 +0100
Newsgroups gmane.comp.voip.nist-sip
Message-ID <[email protected]>
The problem seems to spring down to
src/gov/nist/javax/sip/parser/SubscriptionStateParser.java -- have a look
around row 106 in where it does: subscriptionState.setExpires(expires); and
from which the exception is thrown.

I added System.out.println(subscriptionState.getState() + " " + expires);
to just above where it setExpires(expires) and get:
terminated 0

I submitted an Issue at java.net.
regards/jens

On 1/17/07, M. Ranganathan <[email protected]> wrote:
>
> Looking at HeaderFactory.java, I see the following:
>
>
> /**
>      * Creates a new ExpiresHeader based on the newly supplied expires
> value.
>      *
>      * @param expires the new integer value of the expires.
>      * @throws InvalidArgumentException if supplied expires is less
>      * than zero.
>      * @return the newly created ExpiresHeader object.
>      */
>     public ExpiresHeader createExpiresHeader(int expires)
>                                     throws InvalidArgumentException;
>
>
>
> I don't see any issue with the above. Are you using the current version?
>
>
> On Wed, 2007-01-17 at 16:41 +0100, Jens Tinfors wrote:
> > hi,
> >
> > That it pretty much what i do:
> > final ExpiresHeader expHeader =
> > headerFactory.createExpiresHeader(expiresInt);
> > message.setExpires(expHeader);
> >
> > Yes I saw in the javadoc it says 0 is invalid but surely this is a
> > mistake since that is what you use
> > when you want to unsubscribe:
> > from RFC3265: "A natural consequence of this scheme is that a
> > SUBSCRIBE with an
> >    'Expires' of 0 constitutes a request to unsubscribe from an event."
> >
> > The RFC also says:
> > "In addition to being a request to unsubscribe, a SUBSCRIBE message
> >       with 'Expires' of 0 also causes a fetch of state; see section
> >       3.3.6."
> >
> > Which got me thinking that the state in the stack may not match the 0
> > indicating it being terminated...!?
> > Anyone with good insight could perhaps shed a light!?
> > Im using some pre-1.2 release which I fetched from
> > jain-sip.dev.java.net in December.
> >
> > thanks/j =)
> > On 1/17/07, niepin <[email protected]> wrote:
> >         Hi,
> >         try to use this:
> >         ExpiresHeader expires =
> >         MessageListener.headerFactory.createExpiresHeader(0);
> >         request.setHeader(expires);
> >
> >         In the API, it clearly states the The expires value MUST be
> >         between zero and
> >         (2**31)-1. I guess 0 is an invalid value.
> >
> >         But code above is taken from Applet-Phone ua. There is no
> >         exception when I test
> >         it.
> >
> >         BR
> >
> >         niepin
> >
> >         _______________________________________________
> >         nist-sip mailing list
> >         [email protected]
> >         http://www-x.antd.nist.gov/mailman/listinfo/nist-sip
> >
> > _______________________________________________
> > nist-sip mailing list
> > [email protected]
> > http://www-x.antd.nist.gov/mailman/listinfo/nist-sip
>
>

_______________________________________________
nist-sip mailing list
[email protected]
http://www-x.antd.nist.gov/mailman/listinfo/nist-sip