TapiLineSetupConference Method |
Namespace: Traysoft.AddTapi
public TapiCall SetupConference( TapiCall initialCall, out TapiCall consultationCall, int numParties )
Exception | Condition |
---|---|
TapiException | The conference was not set up because a TAPI error occurred. |
SetupConference initiates a conference for an existing two-party call that the initialCall parameter specifies. A conference call and consultation call are established, and TapiCall objects representing those calls are returned to the application. Use Dial(String) on the consultation call to dial the third party.
SetupConference provides two ways to establish a new conference call, depending on whether a normal two-party call is required to pre-exist or not. When setting up a conference call from an existing two-party call, the initialCall parameter is a call in the Connected state that is initially added to the conference call. On PBXs where conference call setup does not start with an existing call, initialCall must be null. In either case, a consultation call is allocated for connecting to the party that is to be added to the conference. The application can then use Dial(String) to dial the number of the other party.
The conference call typically transitions into the OnHoldPendingConference state, the consultation call into the DialTone state, and the initial call (if there is one) into the Conferenced state.
A conference call can also be set up by a CompleteTransfer(TapiCall, Boolean) that is resolved into a three-way conference. The application may be able to toggle between the consultation call and the conference call using SwapHold(TapiCall).
A consultation call can be canceled by invoking Disconnect on it. When dropping a consultation call, the existing conference call typically transitions back to the connected state. The application should observe the CallState events to determine exactly what happens to the calls. For example, if the conference call reverts back to a regular two-party call, the conference call becomes idle and the original participant call can revert to connected.
// Assuming activeCall represents an active call in Connected state // Conference call will be created from the active call and extension 201 added to the conference // First step: set up a conference, create consultation call and dial ext. 201 TapiCall consultationCall; TapiCall conferenceCall = activeCall.Line.SetupConference(activeCall, out consultationCall, 3); System.Threading.Thread.Sleep(500); if (consultationCall.State != TapiCallState.DialTone) throw new Exception("Call state is not Dialtone"); consultationCall.Dial("201"); // When the state of the consultation call changes to Connected, the user can talk to ext. 201 // before adding ext. 201 to the conference ... // Second step: connect consultation call to the conference consultationCall.AddToConference(conferenceCall);