TapiCallPrepareAddToConference Method |
Namespace: Traysoft.AddTapi
Exception | Condition |
---|---|
TapiException | The consultation call was not created because a TAPI error occurred. |
The conference call is established either by SetupConference(TapiCall, TapiCall, Int32) or CompleteTransfer(TapiCall, Boolean) resolved as a 3-way conference. PrepareAddToConference places the existing conference call in the OnHoldPendingConference state and creates a consultation call that can be added later to the existing conference call with AddToConference(TapiCall). The consultation call can be canceled using Disconnect. The application may also be able to swap between the consultation call and the held conference call with SwapHold(TapiCall).
Some PBXs allow adding arbitrary calls to the conference, and such a call can have been set up using Dial(String, Boolean) and be on (hard) hold. PrepareAddToConference is not needed in that case.
// Assuming conferenceCall represents an active conference call in Connected state // Consultation call will be created and extension 201 added to the conference // First step: prepare the conference, create consultation call and dial ext. 201 TapiCall consultationCall = conferenceCall.PrepareAddToConference(); 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);