Exemplo n.º 1
0
        public HttpResponseMessage Enqueue(TwilioVoiceRequest request, [FromUri] Guid?callerId = null, [FromUri] int contactId = 0)
        {
            try
            {
                request.AddAdditionalFields(callerId, contactId);
                if (request.QueueResult != "bridged" && request.QueueResult != "redirected")
                {
                    MissCall(request);
                }

                return(GetHttpResponse(request.Enqueue(request.QueueResult)));
            }
            catch (Exception e)
            {
                Log.Error(e);
                throw;
            }
        }
Exemplo n.º 2
0
        public HttpResponseMessage Enqueue(TwilioVoiceRequest request, [FromUri] Guid?callerId = null, [FromUri] int contactId = 0)
        {
            try
            {
                using (var scope = DIHelper.Resolve())
                {
                    var daoFactory = scope.Resolve <DaoFactory>();
                    var voipEngine = new VoipEngine(daoFactory);

                    request.AddAdditionalFields(callerId, contactId);
                    if (request.QueueResult != "bridged" && request.QueueResult != "redirected")
                    {
                        MissCall(request, voipEngine);
                    }

                    return(GetHttpResponse(request.Enqueue(request.QueueResult)));
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
                throw;
            }
        }