Пример #1
0
        public HttpResponseMessage Dial()
        {
            try
            {
                LogQueryString("Dial");

                ApiHelper.UploadRecord(GetQueryParam("DialCallSid"), GetQueryParam("CallSid"), GetQueryParam("RecordingUrl"));
                ApiHelper.SaveOrUpdateCallHistory(GetQueryParam("DialCallSid"), GetQueryParam("CallSid"), endDialDate: DateTime.UtcNow, recordUrl: GetQueryParam("RecordingUrl"), recordDuration: GetQueryParam("RecordingDuration"));

                if (!Settings.Pause)
                {
                    SignalRHelper.ChangeAgentStatus((int)AgentStatus.Online);
                }

                SignalRHelper.End();

                Task.Run(() => new ApiHelper(GetQueryParam("Tenant"), GetQueryParam("CallerId")).SavePrice(GetQueryParam("DialCallSid"), GetQueryParam("CallSid")));

                return(GetHttpResponse(TwilioResponseHelper.Dial()));
            }
            catch (Exception e)
            {
                Log.Error(e);
                throw;
            }
        }
Пример #2
0
 private HttpResponseMessage Outbound()
 {
     SignalRHelper.ChangeAgentStatus((int)AgentStatus.Paused);
     ApiHelper.SaveOrUpdateCall(GetQueryParam("CallSid"), GetQueryParam("From"), GetQueryParam("To"), GetQueryParam("CallerId"), status: VoipCallStatus.Outcoming, contactId: GetQueryParam("ContactId"));
     return(GetHttpResponse(TwilioResponseHelper.Outbound()));
 }