示例#1
0
        private void HandleCallRequest(Message message)
        {
            var request = new CallRequest(message.Sender, message.GetTextContent(), this);

            _pendingCallRequests.Add(request);
            NewCallRequest?.Invoke(this, request, message);
        }
示例#2
0
        private TelekomJsonWebRequest <NewCallResponse> CreateNewCallWebRequest(NewCallRequest request)
        {
            EnsureRequestValid(request);

            string uri = ServiceBaseUrl + "/call";

            return(CreateAuthenticatedRequest <NewCallResponse>(uri, HttpMethod.POST, request));
        }
示例#3
0
 /// <summary>
 /// Start a new call (async)
 /// </summary>
 /// <param name="request">Call parameters</param>
 /// <param name="callback">Handler to invoke after completion</param>
 public void NewCall(NewCallRequest request, Action <NewCallResponse> callback)
 {
     CreateNewCallWebRequest(request).ExecuteAsync(a => callback(a));
 }
示例#4
0
 /// <summary>
 /// Start a new call
 /// </summary>
 /// <param name="request">Call parameters</param>
 /// <returns>Service call response</returns>
 public NewCallResponse NewCall(NewCallRequest request)
 {
     return(CreateNewCallWebRequest(request).Execute());
 }