Subject: [SIP] Calling oneself

From: Henning Schulzrinne <[email-masked]>
Date: Thu, 23 Nov 2000 15:11:32 -0500

I'm not sure, but it seems that there's a simple fix: simply have the UA
create *different* tags depending on whether this is for a From or To.
However, the tag is constant across calls.

The general matching rule is

- match incoming requests so that the To matches the locally generated
tag and
  the From matches the tag generated by the other side

Modifying the running example to use tag=5 for the To tag

> I decide to call myself.  I create a call-leg struct to represent it.
> Let's call it "Line 1".  I send out the initial INVITE:
> 
>   [From Line 1]
>   INVITE sip:me@proxy
>   Via: SIP/2.0/UDP my.ip
>   To: <sip:me@proxy>
>   From: <sip:me@proxy>;tag=7
>   Call-ID: 5
> 
>   This eventually loops back to me.  Now I see coming in:
> 
>   INVITE sip:me@proxy
>   Via: SIP/2.0/UDP some.ip
>   To: <sip:me@proxy>
>   From: <sip:me@proxy>;tag=7
>   Call-ID: 5
> 
>   I check and see there is no To-tag, so this is a new incoming call.  I
> create a call struct to represent it, called "Line 2".  Line 2 now
> begins ringing.  I respond with a 180 and the user switches lines and
> answers the incoming call:
> 
>   [From Line 2]
>   SIP/2.0 200 OK
>   Via: SIP/2.0/UDP some.ip
>   To: <sip:me@proxy>;tag=5

Modification here.

>   From: <sip:me@proxy>;tag=7
>   Call-ID: 5
> 
>   When I receive this response, I find the related pending transaction.
> Arguably, I could first find which call-leg it is destined to (and
> immediately have a problem), but say that I do transaction mapping first
> so we don't break yet.  I match the OK and send an ACK:
> 
>   [From Line 1]
>   ACK sip:me@contactaddr
>   Via: SIP/2.0/UDP my.ip
>   To: <sip:me@proxy>;tag=5
>   From: <sip:me@proxy>;tag=7
>   Call-ID: 5
> 
>   At which point the other pending transaction also correctly matches
> this ACK to it.
> 
>   Now, on Line 2, I decide to hang up.  I've had enough of talking to
> myself.  So, I send a BYE:
> 

As usuall, the callee simply flips To and From.

>   [From Line 2]
>   BYE sip:[email-masked]
>   Via: SIP/2.0/UDP my.ip
>   To: <sip:me@proxy>;tag=7
>   From: <sip:me@proxy>;tag=5
>   Call-ID: 5
> 
>   I now see this incoming BYE:
> 
>   BYE sip:[email-masked]
>   Via: SIP/2.0/UDP some.ip
>   To: <sip:me@proxy>;tag=7
>   From: <sip:me@proxy>;tag=5
>   Call-ID: 5
> 

Using the rule above, it matches the call on line 1, since 7 is the
locally-generated tag (stuck into From).

> 
>   Using unique tags per call avoids any confusion even in this case, and
> also protects the UA against clients which always use the same tag and
> happen to make two calls with the same Call-ID.

Since both Line1 and Line2 have the same call-ID (one incoming and one
outgoing), they would have the same locally generated tag according to
your rule, so I don't see how this helps.

Two calls with the same call-id can't happen, by definition. If they do,
the implementation is broken (and would presumably generate the "wrong"
tag, too, while it is at it).

_______________________________________________
SIP mailing list
[email-masked]
http://lists.bell-labs.com/mailman/listinfo/sip