Subject: [SIP] Local Calling

From: Dvir Oren <[email-masked]>
Date: Mon, 17 Jul 2000 12:00:52 +0300 (IDT)

I've been trying to allow 'local calling' within my user agent, and
ran into some difficulties.  I was wondering if there is any internet
draft or some kind of protcol to do this.

By 'local calls' I mean a call in which the caller and callee share the 
same user agent client/server.  This causes some difficulties, since
the UAC and UAS share the same pool of call states.  When the callee
receives an INVITE, there would already be a call with those
parameters since it was initiated from from the same place.

At this point I see two scenarios:
1.  The UAS added a tag to the 'to' field, however the UAC has sent
another INVITE.  When compared, the INVITEs will not match, and now
the UAS will try to initiate a new call.

2.  The UAS did not add a tag to the 'to' field, but when compared, it 
will already find the call that the caller initiated.

Any ideas?

-- 
Dvir Oren               <[email-masked]>
Lucid VON Ltd.     <http://www.lucidvon.com>
9 Saloniki St.,        Tel-Aviv       Israel
Tel:  +972 3 644 3038  Fax:  +972 3 644 3039

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

---

From: "Fairlie-Cuninghame, Robert" <[email-masked]>
Date: Mon, 17 Jul 2000 23:34:38 -0700

HI Dvir,

You don't need any tricks - its all handled in the way the protocol works.

Firstsly, let me clarify my definition of a User-Agent instance. In my mind
I take the term User-Agent as the call state associated with _one-half_ of a
call (amongst other things - I'm not trying to come up with a formal
definition here guys). So IMO if you are proposing local calling within
_one_ instance of User-Agent then this doesn't make sense in a SIP sense and
so you are on you own. 

If however you are simply trying to local call within the same SIP
User-Agent Application (where the Application is attached to a port (eg
5060) and creates User-Agent instances whenever it receives a new inbound &
outbound call attempt), then the solution is trivial.

Your "local calling" uses the machine's IP loopback driver so an INVITE
sent to a Request-URI with different username at the same machine will
simply appear at the packet queue of the Application. 

This causes a new User-Agent instance to be created, in particular a
"terminating" User-Agent instance. The other User-Agent instance is
obviously an "originating" User-Agent instance. [Once again this also
depends on your implementation approach.]

So now determining which User-Agent instance a Request or Response is
destined for becomes a trivial of comparing the To & From fields. 

BYE xxxxxxx
Via: SIP/2.0/UDP myserver.com
To: [email-masked]
From: a@myserver 
Call-ID: qwerty

is destined for the terminating User-Agent. 

BYE xxxxxxx
Via: SIP/2.0/UDP myserver.com
From: [email-masked]
To: a@myserver 
Call-ID: qwerty

is destined for the originating User-Agent. 

SIP/2.0 200 Ok
Via: SIP/2.0/UDP myserver.com
To: [email-masked]
From: a@myserver 
Call-ID: qwerty

is destined for the originating User-Agent. 

SIP/2.0 200 Ok
Via: SIP/2.0/UDP myserver.com
From: [email-masked]
To: a@myserver 
Call-ID: qwerty

is destined for the terminating User-Agent. 

Note: the terminating User-Agent MUST add a tag to the To of the final
INVITE response but this doesn't affect how the above logic works.

You could use different ports for each user-agent instance as well.

Hope that doesn't confuse you more. :)

Cheers,

Robert.

-- My opinions are my own. Nobody else listens to them anyway. --

> -----Original Message-----
> From: Dvir Oren [mailto:[email-masked]]
> Sent: Monday, July 17, 2000 5:01 PM
> To: SIP
> Subject: [SIP] Local Calling
> 
>