TelAPI.TelAPIRestClient.InterruptLiveCall C# (CSharp) Method

InterruptLiveCall() public method

To change the behavior of live calls, TelAPI provides the ability to interrupt calls in real time and end or redirect them to InboundXML for execution.
public InterruptLiveCall ( string callSid, string url, HttpMethod httpMethod, HangupCallStatus status ) : Call
callSid string An alphanumeric string used for identification of calls
url string The URL in-progress calls can be forwarded to.
httpMethod HttpMethod Specifies the HTTP method used to request forwarding URL. Allowed Value: POST or GET. Default Value: POST
status HangupCallStatus The status used to end the call. canceled only ends queued/ringing calls while completed ends in-progress calls as well as queued/ringing calls. Allowed Value: canceled or completed
return Call
        public Call InterruptLiveCall(string callSid, string url, HttpMethod? httpMethod, HangupCallStatus? status)
        {
            Require.Argument("CallSid", callSid);
            
            var request = new RestRequest(Method.POST);
            request.Resource = RequestUri.InterruptLiveCallUri;
            request.AddUrlSegment(RequestUriParams.CallSid, callSid);
            
            if(url.HasValue()) request.AddParameter("Url", url);
            if(httpMethod.HasValue) request.AddParameter("Method", httpMethod.ToString().ToLower());
            if(status.HasValue) request.AddParameter("Status", status.ToString().ToLower());

            return Execute<Call>(request);
        }

Same methods

TelAPIRestClient::InterruptLiveCall ( string callSid, string url, HttpMethod httpMethod, HangupCallStatus status ) : Task