示例#1
0
 protected void OnCallTimeOut(CallTimeOut callTimeOut)
 {
     if (callTimeOut != null)
     {
         CallTimeOutEvent(callTimeOut);
     }
 }
示例#2
0
 public void AddCallTimeOut(CallTimeOut callTimeOut)
 {
     lock (locker)
     {
         callTimeOutList.Add(callTimeOut.CallHandlerId, callTimeOut);
     }
 }
示例#3
0
        /// <summary>
        /// This event fires every time that a call has timeout waiting on the queue
        /// </summary>
        /// <param name="callTimeOut">Holds the call id and the timeout</param>
        private void CallTimeOutHandler_CallTimeOutEvent(CallTimeOut callTimeOut)
        {
            ProtocolMessages.Message msg = null;
            try
            {
                //TODO: no olvidar manerjar la concurrencia sobre el callHandlerCache !!! sobre ese objeto trabajan el thread del timeouthandler, el de los evenntos del ari, y uno mas de los eventos del pbxproxy!
                //TODO: ver como hago que la llamada continue y enviar el msg adecuado al callditributor
                //Esto deberia generar un mensaje EXIT WITH TIMEOUT
                lock (_locker)
                {
                    CallHandler callHandler = callHandler = callHandlerCache.GetByCallHandlerlId(callTimeOut.CallHandlerId);
                    if (callHandler != null)
                    {
                        msg = callHandler.CancelCall();
                        callHandlerCache.RemoveCallHandler(callHandler.Id); //lo hago aca, o dejo que lo haga el stasisend?
                        pbx.Channels.ContinueInDialplan(callHandler.Caller.Id);
                    }
                }
                Log.Logger.Debug("La LLamada: " + callTimeOut.CallHandlerId + " Expiro!, remuevo el callhandler");
            }
            catch (Exception ex)
            {
                Log.Logger.Debug("CallTimeOut: ERROR! " + callTimeOut.CallHandlerId + ", Mensaje: " + ex.Message);
            }

            if (msg != null)
            {
                actorPbxProxy.Send(msg);
            }
            else
            {
                Log.Logger.Debug("CallTimeOut: " + callTimeOut.CallHandlerId + " el callhandler devolvió msg = null");
            }
        }