/// <summary>
 /// PUT /v1/calls/{uuid}/stream - stream an audio file to an active Call
 /// </summary>
 /// <param name="id">id of call</param>
 /// <param name="cmd">Command to execute against call</param>
 /// <param name="creds">(Optional) Overridden credentials for only this request</param>
 /// <exception cref="NexmoHttpRequestException">thrown if an error is encountered when talking to the API</exception>
 public CallCommandResponse StartStream(string id, StreamCommand command, Credentials creds = null)
 {
     return(ApiRequest.DoRequestWithJsonContent <CallCommandResponse>(
                PUT,
                ApiRequest.GetBaseUri(ApiRequest.UriType.Api, $"{CALLS_ENDPOINT}/{id}/stream"),
                command,
                ApiRequest.AuthType.Bearer,
                creds ?? Credentials
                ));
 }
Example #2
0
        /// <summary>
        /// PUT /v1/calls/{uuid}/stream - stream an audio file to an active Call
        /// </summary>
        /// <param name="id">id of call</param>
        /// <param name="cmd">Command to execute against call</param>
        /// <param name="creds">(Optional) Overridden credentials for only this request</param>
        public static CallCommandResponse BeginStream(string id, StreamCommand cmd, Credentials creds = null)
        {
            var response = VersionedApiRequest.DoRequest("PUT", ApiRequest.GetBaseUriFor(typeof(Call), $"/v1/calls/{id}/stream"), cmd, creds);

            return(JsonConvert.DeserializeObject <CallCommandResponse>(response.JsonResponse));
        }
Example #3
0
 /// <summary>
 /// PUT /v1/calls/{uuid}/stream - stream an audio file to an active Call
 /// </summary>
 /// <param name="id">id of call</param>
 /// <param name="cmd">Command to execute against call</param>
 /// <param name="creds">(Optional) Overridden credentials for only this request</param>
 public static CallCommandResponse BeginStream(string id, StreamCommand cmd, Credentials creds = null)
 {
     return(ApiRequest.DoRequestWithJsonContent <CallCommandResponse>("PUT", ApiRequest.GetBaseUriFor(typeof(Call), $"/v1/calls/{id}/stream"), cmd, ApiRequest.AuthType.Bearer, creds));
 }