Re: B2B proposal
- From: Nitzan Nissim <
- Subject: Re: B2B proposal
- Date: Mon, 17 Jun 2013 10:11:06 +0300
I am not sure that cloning the request is that obvious.
Does that mean we will have multiple requests sharing the same transaction?
What would it mean for attributes that are set on these requests?
I am not sure a change like this will be very backwards compatible or
SIP Container Architect, WebSphere SIP Infrastructure
IBM Software Group, AIM
Israel Software Lab
+972 (54) 6976107
+972 (8) 9482326
Date: 17/06/2013 07:12 AM
Subject: Re: B2B proposal
"Likely" was not an accident :-)
It is not specified anywhere. Actually, as you say below in this thread, we
should clarify that
and say it is a "must" to make it obvious for the developer.
On Friday 14 June 2013 06:15 PM, Strickland, Tom wrote:
Likely to clone the SipServletRequest when the derived session is
created? I've probably missed this (it wouldn't be the first time :-)
Where in the spec does it say that they should/may/must create the
cloned request? Quoting from the spec:
--- Start-quote ---
22.214.171.124 Derived SipSessions
A derived SipSession is essentially a copy of the SipSession
associated with the original request. It is constructed at the time
the message creating the new dialog is passed to the application. The
new SipSession differs only in the values for the tag parameter of
the address of the callee (this is the value used for the To header
in subsequent outgoing requests) and possibly the route set. These
values are derived from the dialog-establishing message as defined by
the SIP specification. The set of attributes in the cloned SipSession
is the same as that of the original—in particular, the values are not
New SipSessions corresponding to the second and subsequent 2xx
responses (or 1xx responses with To tags) are available through the
getSession method on the SipServletResponse. The “original”
SipSession of the request continues to be available through the
original request object.
12.5 Original Request and Session Cloning
The incoming request that results in creation of a SipSession is
termed as the original request, a response to this original request
can be created by the application even if the request was committed
and application does not have a reference to this request. This is
necessary because the B2BUA application may require to send more than
one successful response to a request. For example, when a downstream
proxy forked and more than one success responses are to be forwarded
upstream. This can only be required on initial requests, as only
original requests shall need such multiple responses.
B2buaHelper.createResponseToOriginalRequest(SipSession session, int
status, String reasonPhrase) throws IllegalStateException;
The response thus generated MUST have a different "To" tag from the
other responses generated to the request and must result in a
different SipSession. In this (and similar) cases the container
clones the original SipSession for the second and subsequent dialogs,
as detailed in 126.96.36.199 Derived SipSessions. The cloned session object
will contain the same application data but its createRequest method
will create requests belonging to that second or subsequent dialog,
that is, with a "To" tag specific to that dialog.
--- End-quote ---
Common sense would suggest that it would be useful if the container
cloned the request, but I don't read this text as implying that the
container may/should/must do this. I would say that it must, but
there is nothing that I can lean on in the spec text as an app
developer that would allow me to rely on that hope :-)
On 14 June 2013 12:55, Binod
> --- SipInviteRequest.getUnacknowledgedProvisionalResponse
> Why do we need to pass in the SipSession? If we do, it
seems like this
> method should be on the SipSession as opposed to the
request. Since it
> is on the request, I would assume this method would only
> responses for this particular transaction, correct? And if
> SipSession is not needed since the request you are
> explicitly is associated with a SipSession, or perhaps I'm
> Version 2 of my proposal did have this method on the
SipSession. I realised
> a problem with that as explained in the email that
accompanied version 3.
> The rseq value in a reliable provisional is only unique
for that dialog. Due
> to forking there can be several dialogs which return
> In order to locate a specific response at a UAC which is
downstream of a
> forking proxy we need to pass the session (or derived
session) along with
> the rseq to the method on SipInviteRequest.
> If we put the method on the SipSession there is still a
problem with the
> uniqueness of the rseq value. PRACK can arrive after the
> by which time a new INVITE transaction can be in progress
which also has
> provisional responses. To retrieve the correct response we
would need to
> pass it the requestId of the INVITE transaction as well as
> It seems best to avoid cluttering the SipSession interface
with methods such
> as this one.
Ok, I think you lost me but I guess my original question was
the request itself is uniquely associated with a particular
session (it cannot have two) so if you ask the request, the
session is implied. Right?
A SIP request is uniquely associated with a SIP dialog, which
is uniquely associated with a SipSession. This all seems
simple enough, until you consider forking. When downstream
forking occurs, you will have more than one SipSession, but
still only have one SipServletRequest. This is not so bad
when you are acting as a UAC, but when you are running a
B2BUA and acting as a UAS, what happens when you want to
"fork back" to the caller?
Alice B2BUA Proxy Bob1
Here we have an example of parallel downstream forking.
Assume that the B2BUA is an app running on a SipServlet
container. Everything else is a normal SIP actor outside of
the container. At step (9), the response from Bob2 leads the
container to realise that forking has occurred, and so it
creates a derived SipSession from the session used to send
the initial INVITE to Bob in step (2). When we need to send
the first response to Alice in (7), then the existing
SipSession is used, but to create the second response in (10)
requires a new SipSession to be created. After all this
forking: Alice has two SipSessions, but only one INVITE
SipServletRequest - when that SipServletRequest is queried
for Alice each has one INVITE. When you call getSession() on
the INVITE SipServletRequest, it will return the original
SipSession. All quite weird.
Containers are likely to clone the SipServletRequest when the
derived session is created.
So, though I see your point, we can not assert that there can be
more than one sipsession
for a sipservlet request.
Anyway, I suck at the prack stuff so I'm going to go with
want as long as we make sure that the methods are clear, the
documentation is there and we don't run the risk of
container implementors as well as users.
As for the PRACK stuff, we are discussing this and Keith is
writing up a further proposal that is hopefully a little more
clear when it comes to handling PRACK transactions from one
INVITE transaction overlapping with a different INVITE
transaction (and thus possibly overlapping with its PRACK
>> --- SipSession.getActiveInvites ---
>> What about getActiveXXX? i.e., what about all the other
> Only INVITE transactions require an ACK, other
transactions are complete
> once the final response is sent/received. Similarly only
INVITES can have
> reliable provisional responses.
Sure, but until you get a final response the "other" type of
are still "active". And if you are after only whether or not
received an ACK or not, wouldn't a method following the
getUnacknowledgedXXXX methods be more appropriate?
Tom Strickland, Software Developer, Thrupoint Software.
Tel: +44 (0) 2920 005110
Note: The information contained in this message may be
privileged and confidential
and protected from disclosure. If the reader of this message
is not the intended
recipient, or an employee or agent responsible for delivering
this message to the
intended recipient, you are hereby notified that any
dissemination, distribution or
copying of this communication is strictly prohibited. If you
have received this
communication in error, please notify us immediately by
replying to the message and
deleting it from your computer. Thank you. Thrupoint, Inc.
Tom Strickland, Software Developer, Thrupoint Software. Tel: +44 (0)
Note: The information contained in this message may be privileged and
and protected from disclosure. If the reader of this message is not
recipient, or an employee or agent responsible for delivering this
message to the
intended recipient, you are hereby notified that any dissemination,
copying of this communication is strictly prohibited. If you have
communication in error, please notify us immediately by replying to
the message and
deleting it from your computer. Thank you. Thrupoint, Inc.