/// <summary> /// Create a recording for the call /// </summary> /// <param name="options"> Create Recording parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Recording </returns> public static RecordingResource Create(CreateRecordingOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildCreateRequest(CreateRecordingOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Calls/" + options.PathCallSid + "/Recordings.json", postParams: options.GetParams() )); }
/// <summary> /// Create a recording for the call /// </summary> /// <param name="pathCallSid"> The SID of the Call to associate this resource with </param> /// <param name="pathAccountSid"> The SID of the Account that will create the resource </param> /// <param name="recordingStatusCallbackEvent"> The recording status changes that should generate a callback </param> /// <param name="recordingStatusCallback"> The callback URL on each selected recording event </param> /// <param name="recordingStatusCallbackMethod"> The HTTP method we should use when calling the /// recording_status_callback URL </param> /// <param name="trim"> Whether to trim the silence in the recording </param> /// <param name="recordingChannels"> The number of channels that the output recording will be configured with </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Recording </returns> public static async System.Threading.Tasks.Task <RecordingResource> CreateAsync(string pathCallSid, string pathAccountSid = null, List <string> recordingStatusCallbackEvent = null, Uri recordingStatusCallback = null, Twilio.Http.HttpMethod recordingStatusCallbackMethod = null, string trim = null, string recordingChannels = null, ITwilioRestClient client = null) { var options = new CreateRecordingOptions(pathCallSid) { PathAccountSid = pathAccountSid, RecordingStatusCallbackEvent = recordingStatusCallbackEvent, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, Trim = trim, RecordingChannels = recordingChannels }; return(await CreateAsync(options, client)); }
/// <summary> /// Create a recording for the call /// </summary> /// <param name="pathCallSid"> The SID of the Call to associate the resource with </param> /// <param name="pathAccountSid"> The SID of the Account that will create the resource </param> /// <param name="recordingStatusCallbackEvent"> The recording status changes that should generate a callback </param> /// <param name="recordingStatusCallback"> The callback URL on each selected recording event </param> /// <param name="recordingStatusCallbackMethod"> The HTTP method we should use to call `recording_status_callback` /// </param> /// <param name="trim"> Whether to trim the silence in the recording </param> /// <param name="recordingChannels"> The number of channels that the output recording will be configured with </param> /// <param name="recordingTrack"> Which track(s) to record </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Recording </returns> public static RecordingResource Create(string pathCallSid, string pathAccountSid = null, List <string> recordingStatusCallbackEvent = null, Uri recordingStatusCallback = null, Twilio.Http.HttpMethod recordingStatusCallbackMethod = null, string trim = null, string recordingChannels = null, string recordingTrack = null, ITwilioRestClient client = null) { var options = new CreateRecordingOptions(pathCallSid) { PathAccountSid = pathAccountSid, RecordingStatusCallbackEvent = recordingStatusCallbackEvent, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, Trim = trim, RecordingChannels = recordingChannels, RecordingTrack = recordingTrack }; return(Create(options, client)); }
/// <summary> /// Create a recording for the call /// </summary> /// <param name="options"> Create Recording parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Recording </returns> public static async System.Threading.Tasks.Task <RecordingResource> CreateAsync(CreateRecordingOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }