Subject: [Sip] Handling of REFER/NOTIFY by Stateful Proxy

From: Loh Kok Jeng <[email-masked]>
Date: Mon, 9 Dec 2002 17:03:53 +0800

Dear all,

I have a question regarding the handling of REFER/NOTIFY that is tied to 
a session initiated with INVITE, i.e. REFER/NOTIFY belongs to the same 
dialog as INVITE.  What should a stateful proxy do when it receives a 
NOTIFY whose dialog has been terminated?  I have 2 specific scenarios in 
mind, and both of them are illustrated in the diagrams below.

Case 1:
The Referrer terminates the session with BYE.  The stateful proxy receives
NOTIFY after 200 OK for BYE.  At that particular instance, the stateful
proxy has already removed the dialog.

Case 2:
The session expires and the stateful proxy removed the session.  It receives
NOTIFY from UAS.

For these two cases, should the stateful proxy rejects NOTIFY with 481?  Or
should it proxy NOTIFY onwards?

Thanks.

regards,
KJ Loh

  +--------+                +--------+                 +--------+
  |Referrer|                |Stateful|                 |  UAS   |
  |        |                | Proxy  |                 |        |
  +--------+    1 INVITE    +--------+                 +--------+
      |------------------------->|         2 INVITE         |
      |                          |------------------------->|
      |                          |         3 200 OK         |
      |                          |<-------------------------|
      |         4 200 OK         |                          |
      |<-------------------------|                          |
      |         5 REFER          |                          |
      |------------------------->|         6 REFER          |
      |                          |------------------------->|
      |                          |         7 200 OK         |
      |                          |<-------------------------|
      |         8 200 OK         |                          |
      |<-------------------------|                          |
      |                          |         9 NOTIFY         |
      |                          |<-------------------------|
      |         10 NOTIFY        |                          |
      |<-------------------------|                          |
      |         11 200 OK        |                          |
      |------------------------->|         12 200 OK        |
      |                          |------------------------->|
      |        .......           |         ......           |
      |                          |                          |
      |        13 REFER          |                          |
      |------------------------->|        14 REFER          |
      |                          |------------------------->|
      |                          |        15 200 OK         |
      |                          |<-------------------------|
      |        16 200 OK         |                          |
      |<-------------------------|                          |
      |        17 BYE            |                          |
      |------------------------->|        18 BYE            |
      |                          |------------------------->|
      |                          |        19 200 OK         |
      |                          |<-------------------------|
      |        21 200 OK         |        20 NOTIFY         |
      |<-------------------------|<-------------------------|

  +--------+                +--------+                 +--------+
  |Referrer|                |Stateful|                 |  UAS   |
  |        |                | Proxy  |                 |        |
  +--------+    1 INVITE    +--------+                 +--------+
      |------------------------->|         2 INVITE         |
      |                          |------------------------->|
      |                          |         3 200 OK         |
      |                          |<-------------------------|
      |         4 200 OK         |                          |
      |<-------------------------|                          |
      |         5 REFER          |                          |
      |------------------------->|         6 REFER          |
      |                          |------------------------->|
      |                          |         7 200 OK         |
      |                          |<-------------------------|
      |         8 200 OK         |                          |
      |<-------------------------|                          |
      |                          |         9 NOTIFY         |
      |                          |<-------------------------|
      |         10 NOTIFY        |                          |
      |<-------------------------|                          |
      |         11 200 OK        |                          |
      |------------------------->|         12 200 OK        |
      |                          |------------------------->|
      |        .......           |         ......           |
      |                          |                          |
      |        13 REFER          |                          |
      |------------------------->|        14 REFER          |
      |                          |------------------------->|
      |                          |        15 200 OK         |
      |                          |<-------------------------|
      |        16 200 OK         |                          |
      |<-------------------------|                          |
      |                +-----------------+                  |
      |                |Session Timeout  |                  |
      |                |Session torn down|                  |
      |                +-----------------+                  |
      |                          |        17 NOTIFY         |
      |                          |<-------------------------|
_______________________________________________
Sip mailing list  https://www1.ietf.org/mailman/listinfo/sip
This list is for NEW development of the core SIP Protocol
Use [email-masked] for questions on current sip
Use [email-masked] for new developments on the application of sip

---

From: [email-masked]
Date: Mon, 9 Dec 2002 13:48:22 +0200

You are talking about Dialog Stateful proxy. In this case, the dialog at the proxy is not removed until the NOTIFY of a REFER terminates the dialog (or an unSUBSCRIBE).

Remember, from recent discussions on the mailing list and from RFC3265, a dialog exists until all "associations" with that dialog are terminated.

regards,
Hisham

> -----Original Message-----
> From: ext Loh Kok Jeng [mailto:[email-masked]]
> Sent: Monday, December 09, 2002 11:04 AM
> To: [email-masked]
> Subject: [Sip] Handling of REFER/NOTIFY by Stateful Proxy
> 
> 
> Dear all,
>

---

From: Adam Roach <[email-masked]>
Date: Mon, 9 Dec 2002 13:54:16 -0600

Hisham Khartabil wrote:

> You are talking about Dialog Stateful proxy. In this case, 
> the dialog at the proxy is not removed until the NOTIFY of a 
> REFER terminates the dialog (or an unSUBSCRIBE).

The issue, I beleive, is that the proxy in question doesn't
necessarily know anything about the behavior associated with
SUBSCRIBE and NOTIFY. So, from its perspective, the dialog
*is* terminated with the BYE.

So, that brings us back to Loh Kok Jeng's question:

> What should a stateful proxy do when it receives
> a NOTIFY whose dialog has been terminated?
> ...[S]hould the stateful proxy rejects NOTIFY 
> with 481?  Or should it proxy NOTIFY onwards?

As Hisham points out, your question appears to apply
to a *dialog* stateful proxy, which is a rather different
beast than a stateful proxy.

The simple answer is: it should proxy it on.

However, this behavior should naturally fall out of good
design on the part of the proxy. Ask yourself: in general,
if your proxy receives a request with a "Route" header for
which you have no dialog, what is the correct behavior? 

Well, if you know *how* to proxy it, you *should* proxy it.
In this case, the presence of a "Route" header gives you
sufficient information about where to send it. (This is one
of the important SIP protocol behaviors, for example,
behind the "Service Route Discovery" draft).

/a