public void CancelNotRequiredCallLegs(CallCancelCause cancelCause) { try { m_commandCancelled = true; FireProxyLogEvent(new SIPMonitorConsoleEvent(SIPMonitorServerTypesEnum.AppServer, SIPMonitorEventTypesEnum.DialPlan, "Cancelling all call legs for ForkCall app.", m_username)); // Cancel all forwarded call legs. if (m_switchCalls.Count > 0) { ISIPClientUserAgent[] inProgressCalls = (from ua in m_switchCalls where !ua.IsUACAnswered select ua).ToArray(); for (int index = 0; index < inProgressCalls.Length; index++) { ISIPClientUserAgent uac = inProgressCalls[index]; uac.Cancel(); } } // Signal any delayed calls that they are no longer required. foreach (SIPCallDescriptor callDescriptor in m_delayedCalls) { callDescriptor.DelayMRE.Set(); } CallLegCompleted(); } catch (Exception excp) { logger.Error("Exception ForkCall CancelAllCallLegs. " + excp); } }
/// <remarks> /// This method will be called on the thread that owns the dialplan context object so it's critical that Thread abort /// is not called in it or from it. /// </remarks> /// <param name="cancelCause"></param> private void ClientCallTerminated(CallCancelCause cancelCause) { try { // Take this off the sip-transport thread! ThreadPool.QueueUserWorkItem(delegate { m_clientCallCancelled = true; Log("Dialplan call was terminated by client side due to " + cancelCause + "."); if (m_currentCall != null) { m_currentCall.CancelNotRequiredCallLegs(cancelCause); } if (m_waitForCallCompleted != null) { m_waitForCallCompleted.Set(); } else { m_executingScript.StopExecution(); } }); } catch (Exception excp) { logger.Error("Exception ClientCallTerminated. " + excp.Message); } }
public void ClientCallTerminated(CallCancelCause cancelCause) { Log_External(new SIPMonitorConsoleEvent(SIPMonitorServerTypesEnum.AppServer, SIPMonitorEventTypesEnum.DialPlan, "GoogleVoiceCall client call cancelled, " + cancelCause + ".", m_username)); m_clientCallCancelled = true; CancelCall(); }
/// <remarks> /// This method will be called on the thread that owns the dialplan context object so it's critical that Thread abort /// is not called in it or from it. /// </remarks> /// <param name="cancelCause"></param> private void ClientCallTerminated(CallCancelCause cancelCause) { try { m_clientCallCancelled = true; Log("Dialplan call was terminated by client side due to " + cancelCause + "."); if (m_currentCall != null) { m_currentCall.CancelNotRequiredCallLegs(cancelCause); } if (m_waitForCallCompleted != null) { m_waitForCallCompleted.Set(); } else { m_executingScript.StopExecution(); } } catch (Exception excp) { logger.Error("Exception ClientCallTerminated. " + excp.Message); } }