private PLTCallId GenerateCallId(int callid, bool isIncoming) { PLTCallId retval = new PLTCallId(); retval.callid = callid; retval.isInternal = false; retval.isIncoming = isIncoming; return(retval); }
private PLTCallId GenerateCallId(bool isIncoming) { PLTCallId retval = new PLTCallId(); retval.callid = ++m_internalcallid; retval.isInternal = true; retval.isIncoming = isIncoming; return(retval); }
/// <summary> /// Informs Spokes that user has answered an incoming (ringing) softphone call, /// for example with a softphone GUI. /// </summary> /// <param name="callid">The unique numeric id that defines which softphone call you want to answer.</param> public void ans(int callid) { bool found = false; PLTCallId theCall = FindCall(callid, ref found); if (found) { m_spokes.AnswerCall(callid); } }
private void RemoveCall(int id) { bool found = false; PLTCallId matched = FindCall(id, ref found); if (found) { m_callids.Remove(matched); m_spokes.EndCall(id); } }
private PLTCallId FindCall(int id, ref bool found) { PLTCallId matched = new PLTCallId(); foreach (PLTCallId cid in m_callids) { if (cid.callid == id) { matched = cid; found = true; } } return(matched); }
/// <summary> /// This method is to notify Plantronics of a phone call in your softphone application, /// adding it to the Plantronics CallManager (call control system) and enabling Plantronics /// to set up the device audio path (in the case of wireless devices), and enable the device /// ringing signal (for incoming calls, for devices with an internal ring alert). /// </summary> /// <param name="incoming">Specifies if the call incoming (true) or outgoing (false)</param> /// <param name="callid">A arbitrary, unique numeric 32-bit integer id that your /// softphone application needs to specify for this call. Future call control events /// from Plantronics during the call life-cycle of this call will include the specified id. /// </param> /// <param name="contactname">A string consisting of the contact name that is calling /// or being called, that will appear on Plantronics display capable devices, /// e.g. Calisto P240.</param> public void on(bool incoming, int callid, string contactname = "") { PLTCallId id = GenerateCallId(callid, incoming); if (incoming) { m_spokes.IncomingCall(callid, contactname); } else { m_spokes.OutgoingCall(callid, contactname); } StoreCallId(id); }
/// <summary> /// This method will inform Plantronics that user has held or resumed a /// call in your application. This override will hold/resume the most /// recent active call. The effect on Plantronics is usually that the /// green active light on device changes to red to indicate the call is /// on hold. /// </summary> /// <param name="hold">true = hold, false = resume</param> public void hold(bool hold) { if (m_callids.Count() > 0) { PLTCallId theCall = m_callids.Last(); if (hold) { m_spokes.HoldCall(theCall.callid); } else { m_spokes.ResumeCall(theCall.callid); } } }
/// <summary> /// This override will auto-generate a callid internally. /// This method is to notify Plantronics of a phone call in your softphone application, /// adding it to the Plantronics CallManager (call control system) and enabling Plantronics /// to set up the device audio path (in the case of wireless devices), and enable the device /// ringing signal (for incoming calls, for devices with an internal ring alert). /// </summary> /// <param name="incoming">Specifies if the call incoming (true) or outgoing (false)</param> /// <param name="contactname">A string consisting of the contact name that is calling /// or being called, that will appear on Plantronics display capable devices, /// e.g. Calisto P240.</param> /// <returns>An auto-generated, arbitrary, unique numeric 32-bit integer id that your /// softphone application can optionally use to compare with future call control events /// from Plantronics during the call life-cycle of this call that will include this id.</returns> public int on(bool incoming, string contactname = "") { PLTCallId id = GenerateCallId(incoming); if (incoming) { m_spokes.IncomingCall(id.callid, ""); } else { m_spokes.OutgoingCall(id.callid, ""); } StoreCallId(id); return(id.callid); }
// /// <summary> /// Informs Spokes that user has answered an incoming (ringing) softphone call, /// for example with a softphone GUI. /// This override will just answer the last incoming call that occured. /// </summary> public void ans() { // find the last incoming call in list PLTCallId theCall = new PLTCallId(); bool found = false; foreach (PLTCallId cid in m_callids) { if (cid.isIncoming) { theCall = cid; found = true; } } if (found) { m_spokes.AnswerCall(theCall.callid); } }
void m_spokes_CallEnded(object sender, CallEndedArgs e) { // find the last incoming call in list PLTCallId theCall = new PLTCallId(); bool found = false; foreach (PLTCallId cid in m_callids) { if (cid.isIncoming) { theCall = cid; found = true; } } if (found) { m_callids.Remove(theCall); } OnPltEvent(new PltEventArgs(PltEventType.CallEnded, e.CallId.ToString(), e.CallSource)); }
private PLTCallId GenerateCallId(int callid, bool isIncoming) { PLTCallId retval = new PLTCallId(); retval.callid = callid; retval.isInternal = false; retval.isIncoming = isIncoming; return retval; }
private PLTCallId GenerateCallId(bool isIncoming) { PLTCallId retval = new PLTCallId(); retval.callid = ++m_internalcallid; retval.isInternal = true; retval.isIncoming = isIncoming; return retval; }
private PLTCallId FindCall(int id, ref bool found) { PLTCallId matched = new PLTCallId(); foreach (PLTCallId cid in m_callids) { if (cid.callid == id) { matched = cid; found = true; } } return matched; }
// /// <summary> /// Informs Spokes that user has answered an incoming (ringing) softphone call, /// for example with a softphone GUI. /// This override will just answer the last incoming call that occured. /// </summary> public void ans() { // find the last incoming call in list PLTCallId theCall = new PLTCallId(); bool found = false; foreach (PLTCallId cid in m_callids) { if (cid.isIncoming) { theCall = cid; found = true; } } if (found) m_spokes.AnswerCall(theCall.callid); }
void m_spokes_CallEnded(object sender, CallEndedArgs e) { // find the last incoming call in list PLTCallId theCall = new PLTCallId(); bool found = false; foreach (PLTCallId cid in m_callids) { if (cid.isIncoming) { theCall = cid; found = true; } } if (found) m_callids.Remove(theCall); OnPltEvent(new PltEventArgs(PltEventType.CallEnded, e.CallId.ToString(), e.CallSource)); }
private void StoreCallId(PLTCallId id) { m_callids.Add(id); }