Search code examples
c#lyncucma

Place two outbound calls and bridge them, with UCMA 4


Does anyone know which approach that should be used to place two outbound calls from a UCMA application, and bound these two together?

Case: The UCMA application will call caller A (Alice) and when answered by Alice, the app should transfer the call to caller B (Bob), or establish a new call to Bob, and bridge the calls together between Alice and Bob. I still want the control (SIP) to flow to my UCMA app, but the audio stream directly between Alice and Bob.

Should I: (A) - Establish a call to Alice, and when answered, make a selftransfer of that call with Bob as target (by a B2BUA)?

(B) - Establish the call to Alice, when answered establish a call to Bob, then bridging these two calls in some way?

UPDATE: Please note that its the UCMA app that has to place a call to Alice, and then transfer the call to Bob. If I'm placing a new AudioVideoCall to Alice from my app, and after answer placing a transfer through a 'self-transfer' and a BackToBackCall, then Bob receives the call, but as soon as Bob answers, the call gets terminated!?

If Alice is calling my app, and catch by an 'OnCallReceived' event of my Application Endpoint, and following the same steps (self-transfer the call to Bob, with a B2BCall, and Bob answers the call), then the call is transfered correctly, without getting terminated. Whats the dirrence?

Note! I think I added some confusion to the terms here. I earlier wrote that I wanted to RTP from alice and bob to go through the app, but what I meant was the SIP signaling. The RTP (media stream) has to flow between Alice and Bob ofcause.


Solution

  • I found a solution for this. As you establish a call, the call would have the state of "Established". Thats when you place a outbound call from your UCMA app, to a caller. To make a B2B-Call, you need to have an incoming-idle state (one call is incoming while the other call is idle).

    The way to do this is by establish a call, when its answered, then take that call object, and do a supervised transfer (aka 'Self-transfer') with that call. In that way you will return the same call as an incoming call, and by that it can be used as a call leg in a B2B call, which then can call Bob.

    No need to escalate to a conference, unless you need that feature.