public async Task <IHttpActionResult> Get(string id) { var user = await db.Users.Find(t => t.UserName == User.Identity.Name).FirstOrDefaultAsync(); var obj = new CallEntry(); if (id == "new") { obj.CallType = CallType.Inbound; obj.Started = DateTime.Now; obj.Status = CallStatus.Pending; obj.Reason = CallReason.Question; obj.UserId = user.Id; } else { obj = await db.CallEntries.Find(t => t.Id == id).FirstOrDefaultAsync(); if (obj == null) { return(this.NotFound()); } } return(this.Ok(obj)); }
public async Task <IHttpActionResult> Start(string line) { var user = await db.Users.Find(t => t.UserName == User.Identity.Name).FirstOrDefaultAsync(); var sub = await db.Subscribers.Find(t => t.CallNumber == line).FirstOrDefaultAsync(); if (sub == null) { return(NotFound()); } CallEntry obj = new CallEntry(); obj.Line = line; obj.CallType = CallType.Inbound; obj.Started = DateTime.Now; obj.Status = CallStatus.Pending; obj.Reason = CallReason.Question; obj.Person = new Person(); obj.UserId = user.Id; obj.SubscriberId = sub.Id; obj.Subscriber = sub; return(Ok(obj)); }
public CallContext(ScriptCallContext parent, CallEntry callEntry, bool breakSet) { m_parentContext = parent; m_entryLogger = parent.Logger; m_callEntry = callEntry; m_break = breakSet; }
public async Task <ActionResult> Post([FromBody] CallEntry value) { value.Started = DateTime.Now; await db.CallQueue.InsertOneAsync(value); return(this.Ok(value)); }
public CallContext(CallContext parent) { m_parentContext = parent; m_entryLogger = parent.Logger; m_callEntry = parent.CurrentCallEntry; m_break = false; }
public void Visit(CallEntry entry) { foreach (var argument in entry.Arguments) { argument.Accept(this); } SetNext(entry); }
public async Task <IHttpActionResult> Post([FromBody] CallEntry value) { value.Ended = DateTime.Now; value.Duration = (value.Ended.Value - value.Started).Seconds; await db.CallEntries.InsertOneAsync(value); return(this.Ok(value)); }
public void Visit(CallEntry entry) { Print($"CALL {entry.TargetMethod}"); _indent++; foreach (var argument in entry.Arguments) { argument.Accept(this); } _indent--; }
public async Task <IHttpActionResult> Put(string id, [FromBody] CallEntry value) { var obj = await db.CallEntries.Find(t => t.Id == id).FirstOrDefaultAsync(); if (obj == null) { return(this.NotFound()); } var query = Builders <CallEntry> .Filter.Eq(e => e.Id, id); await db.CallEntries.ReplaceOneAsync(query, value); return(this.Ok(value)); }
public async Task <ActionResult> Get(string id) { var obj = new CallEntry(); if (id != "new") { obj = await db.CallQueue.Find(t => t.Id == id).FirstOrDefaultAsync(); if (obj == null) { return(this.NotFound()); } } return(this.Ok(obj)); }
public void Visit(CallEntry entry) { var firstArg = true; foreach (var argument in entry.Arguments) { _sb.Append(" "); _sb.Append(firstArg ? "┌──▌" : "├──▌"); _sb.Append(" "); _sb.AppendLine($"t{argument.TreeID}"); firstArg = false; } if (entry.Kind != Common.TypeSystem.IL.StackValueKind.Unknown) { _sb.AppendLine($"t{entry.TreeID,-3} = call {entry.TargetMethod}"); } else { _sb.AppendLine($" call {entry.TargetMethod}"); } }
public void Visit(CallEntry entry) { _genericStackEntryVisitor.Visit <CallEntry>(entry); }
public static void ImportCall(Instruction instruction, ImportContext context, IILImporterProxy importer, StackEntry?newObjThis = null) { var methodDefOrRef = instruction.Operand as IMethodDefOrRef; var methodToCall = methodDefOrRef.ResolveMethodDefThrow(); var arguments = new List <StackEntry>(); var firstArgIndex = newObjThis != null ? 1 : 0; for (var i = firstArgIndex; i < methodToCall.Parameters.Count; i++) { var argument = importer.PopExpression(); arguments.Add(argument); } // Add the this pointer if required, e.g. if part of newobj if (newObjThis != null) { arguments.Add(newObjThis); } arguments.Reverse(); // Intrinsic calls if (methodToCall.IsIntrinsic()) { if (!ImportIntrinsicCall(methodToCall, arguments, importer)) { throw new NotSupportedException("Unknown intrinsic"); } return; } string targetMethod; if (methodToCall.IsPinvokeImpl) { targetMethod = methodToCall.ImplMap.Name; } else { targetMethod = context.NameMangler.GetMangledMethodName(methodToCall); } int returnBufferArgIndex = 0; var returnType = methodToCall.ReturnType; if (methodToCall.HasReturnType) { if (returnType.IsStruct()) { returnBufferArgIndex = FixupCallStructReturn(returnType, arguments, importer, methodToCall.HasThis); } } int?returnTypeSize = methodToCall.HasReturnType ? returnType.GetExactSize() : null; var callNode = new CallEntry(targetMethod, arguments, returnType.GetStackValueKind(), returnTypeSize); if (!methodToCall.HasReturnType) { importer.ImportAppendTree(callNode); } else { if (returnType.IsStruct()) { importer.ImportAppendTree(callNode); // Load return buffer to stack var loadTemp = new LocalVariableEntry(returnBufferArgIndex, returnType.GetStackValueKind(), returnType.GetExactSize()); importer.PushExpression(loadTemp); } else { importer.PushExpression(callNode); } } }