Subject: How to distinguish call-leg when the caller and the receiver are in the same gateway

From: "Pierre Poirier" <[email-masked]>
Date: Mon, 6 Dec 1999 14:43:56 -0500

Here is the situation.
Gateway-A is force by an EVENT X to issue an INVITE to proxy:

	INVITE sip:ResourceA@proxy:5060 SIP/2.0
	v: SIP/2.0/TCP www.xxx.yyy.zzz:5062
	f: sip:[email-masked]
	t: sip:ResourceA
	i: [email-masked]
	CSeq: 1 INVITE
	l: 0

The Proxy find a destination for ResourceA and relay this INVITE to this
destination to generate an EVENT Y.

	INVITE sip:ResourceA@Dest:5062 SIP/2.0
	v: SIP/2.0/TCP www.xxx.yyy.aaa:5060
	v: SIP/2.0/TCP www.xxx.yyy.zzz:5062
	f: sip:[email-masked]
	t: sip:ResourceA
	i: [email-masked]
	CSeq: 1 INVITE
	l: 0

If the destination is in the same gateway,
how can he distinguish the call-leg so that received msg. will be assign to
the proper event?

Thank.
Pierre Poirier.

---

From: Jonathan Rosenberg <[email-masked]>
Date: Tue, 07 Dec 1999 15:15:34 -0500

This issue came up at a prior bakeoff, albeit in a slightly different
flavor. Here was the clarification that was created for this:

> Identification of Call Leg
> 
> The spec is not clear on identification of a call leg. Section 1.3 says it's the combination of To, From, and Call-ID.
> However, requests from the callee to the caller have the To and From reversed, so this definition is not quite accurate.
> Additionally, the tag field should be included in the definition of call leg. The spec should rather say that a call leg is defined
> as the combination of local-address, remote-address, and call-id, where these addresses include tags. Also note that only
> the username and host part of the To and From headers are used for this purpose, so that: 
> 
> "User 1" <sip:[email-masked]>
> 
> and 
> 
> "Joe" <sip:[email-masked]>
> 
> would be the same when determining the call leg. Text was added to Section 6.21 to emphasize that the From and To
> headers designate the originator of the request, not that of the call leg. 

So, to answer your question, when the request is sent from a gateway
with From: A ant To: B, the call leg for the originator has:

local-address=A
remote-address=B

when the request arrives back at the gateway, the From field identifies
the remote-address, and the To field identifies the local address. Thus,
the gateway would compute:

local-address=B
remote-address=A

and thus view this as a different call leg.

-Jonathan R.

-- 
Jonathan D. Rosenberg                       200 Executive Drive
Chief Scientist                             Suite 120 
dynamicsoft                                 West Orange, NJ 07052
[email-masked]                     FAX:   (732) 741-4778
http://www.cs.columbia.edu/~jdrosen         PHONE: (732) 741-7244
http://www.dynamicsoft.com