private void setCurrentCall(object sender, ItemTappedEventArgs e) { MyCall selected = e.Item as MyCall; if (!selected.isCurrentCall) { callService.switchCurrentCall(selected); } }
private void updateMycalls(Call call, CallState state) { int relevantIndex = -1; for (int i = 0; i < myCalls.Count; i++) { if (myCalls[i].remoteAddress.Equals(call.RemoteAddressAsString)) { relevantIndex = i; break; } } if (relevantIndex > -1) { if (state == CallState.Released) { myCalls.RemoveAt(relevantIndex); this.isCallStateReallyChanged = true; } else { if (myCalls[relevantIndex].state == state) { isCallStateReallyChanged = true; } else { myCalls[relevantIndex].state = state; isCallStateReallyChanged = true; } } } else { MyCall newCall = new MyCall(call.ToAddress.Username, call.RemoteAddressAsString, state); myCalls.Add(newCall); this.isCallStateReallyChanged = true; } setCurrentCall(); setCurrentCallOnTop(); }
private void DoTwimlRequest(string UrlToUse, string LogAs) { CurrentUrl = UrlToUse; var a = ""; var nvc = MyCall.GenerateCallBackValue(); var v = new LogObj() { LogSymbol = LogSymbol.TwilioToWeb, CallInstance = MyCall, Caption = LogAs + " to " + UrlToUse }; try { v.AddNode("Request", nvc); a = MyCall.BrowserClient.DoRequest(UrlToUse, nvc); v.AddNode("Response", a); } catch (Exception ex) { v.Caption = "<- Exception on Call Start Call Back to " + MyCall.CallBackurl + ex.Message; v.AddException(ex); } try { Twiml = XDocument.Parse(a); v.AddNode("Twiml:", a); } catch (Exception ex) { v.AddNode("TWiml Error", "Error parsing Twiml " + ex.Message + " Defaulting to a blank document").IsInError = true; Twiml = XDocument.Parse(@"<?xml version=""1.0"" encoding=""UTF-8"" ?><Response></Response>"); } SystemController.Instance.Logger.LogObj(v); }
public void switchCurrentCall(MyCall desiredCall) { Call call = LinphoneCore.GetCallByRemoteAddress(desiredCall.remoteAddress); LinphoneCore.ResumeCall(call); }