Esempio n. 1
0
        /// <summary>
        /// The <code>StartOutboundVoiceContact</code> operation initiates a contact flow to place
        /// an outbound call to a customer.
        ///
        ///
        /// <para>
        /// There is a throttling limit placed on usage of the API that includes a <code>RateLimit</code>
        /// of 2 per second, and a <code>BurstLimit</code> of 5 per second.
        /// </para>
        ///
        /// <para>
        /// If you are using an IAM account, it must have permissions to the <code>connect:StartOutboundVoiceContact</code>
        /// action.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the StartOutboundVoiceContact service method.</param>
        ///
        /// <returns>The response from the StartOutboundVoiceContact service method, as returned by Connect.</returns>
        /// <exception cref="Amazon.Connect.Model.DestinationNotAllowedException">
        /// Outbound calls to the destination number are not allowed for your instance. You can
        /// request that the country be included in the allowed countries for your instance by
        /// submitting a <a href="https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase">Service
        /// Limit Increase</a>.
        /// </exception>
        /// <exception cref="Amazon.Connect.Model.InternalServiceException">
        /// Request processing failed due to an error or failure with the service.
        /// </exception>
        /// <exception cref="Amazon.Connect.Model.InvalidParameterException">
        /// One or more of the parameters provided to the operation are not valid.
        /// </exception>
        /// <exception cref="Amazon.Connect.Model.InvalidRequestException">
        /// The request is not valid.
        /// </exception>
        /// <exception cref="Amazon.Connect.Model.LimitExceededException">
        /// The limit exceeded the maximum allowed active calls in a queue.
        /// </exception>
        /// <exception cref="Amazon.Connect.Model.OutboundContactNotPermittedException">
        /// The contact is not permitted because outbound calling is not enabled for the instance.
        /// </exception>
        /// <exception cref="Amazon.Connect.Model.ResourceNotFoundException">
        /// The specified resource was not found.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/StartOutboundVoiceContact">REST API Reference for StartOutboundVoiceContact Operation</seealso>
        public virtual StartOutboundVoiceContactResponse StartOutboundVoiceContact(StartOutboundVoiceContactRequest request)
        {
            var marshaller   = StartOutboundVoiceContactRequestMarshaller.Instance;
            var unmarshaller = StartOutboundVoiceContactResponseUnmarshaller.Instance;

            return(Invoke <StartOutboundVoiceContactRequest, StartOutboundVoiceContactResponse>(request, marshaller, unmarshaller));
        }
Esempio n. 2
0
        public ActionResult InitOutboundCall(string number, string idContactFlow, string sourcePhoneNumber)
        {
            string accessKey           = WebConfigurationManager.AppSettings["AWSAccessKey"];
            string secretKey           = WebConfigurationManager.AppSettings["AWSSecretKey"];
            AmazonConnectClient client = new AmazonConnectClient(accessKey, secretKey, RegionEndpoint.USEast1);
            var request = new StartOutboundVoiceContactRequest
            {
                InstanceId = "10a4c4eb-f57e-4d4c-b602-bf39176ced07", //The identifier for your Amazon Connect instance. To find the ID of your instance,
                                                                     //open the AWS console and select Amazon Connect. Select the alias of the instance in the Instance alias column.
                                                                     //The instance ID is displayed in the Overview section of your instance settings.
                                                                     //For example, the instance ID is the set of characters at the end of the instance ARN, after instance/, such as 10a4c4eb-f57e-4d4c-b602-bf39176ced07.
                SourcePhoneNumber      = sourcePhoneNumber,          //one of нour numbers
                ContactFlowId          = idContactFlow,
                DestinationPhoneNumber = number,
                Attributes             = new Dictionary <string, string>()//variables for text at contactFlow
                {
                    { "agentName", "Alex" },
                    { "contactFlowId", idContactFlow },
                    { "orderNumber", "AB123456" },
                    { "notifyUrl", "http://this.hostname/Home/ProcessLogs" } //Route to ProcessLogs action
                }
            };

            try
            {
                var response = client.StartOutboundVoiceContact(request);
                return(new JsonNetResult(new JsonResponse(true, response.ContactId)));
            }
            catch (Amazon.Connect.AmazonConnectException ex)
            {
                Logger.Error(ex);
                return(new JsonNetResult(new JsonResponse(false, ex)));
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Initiates the asynchronous execution of the StartOutboundVoiceContact operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the StartOutboundVoiceContact operation on AmazonConnectClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        ///
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStartOutboundVoiceContact
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/StartOutboundVoiceContact">REST API Reference for StartOutboundVoiceContact Operation</seealso>
        public virtual IAsyncResult BeginStartOutboundVoiceContact(StartOutboundVoiceContactRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = StartOutboundVoiceContactRequestMarshaller.Instance;
            var unmarshaller = StartOutboundVoiceContactResponseUnmarshaller.Instance;

            return(BeginInvoke <StartOutboundVoiceContactRequest>(request, marshaller, unmarshaller,
                                                                  callback, state));
        }
        internal virtual StartOutboundVoiceContactResponse StartOutboundVoiceContact(StartOutboundVoiceContactRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = StartOutboundVoiceContactRequestMarshaller.Instance;
            options.ResponseUnmarshaller = StartOutboundVoiceContactResponseUnmarshaller.Instance;

            return(Invoke <StartOutboundVoiceContactResponse>(request, options));
        }
Esempio n. 5
0
        static async Task Main(string[] args)
        {
            var client  = new AmazonConnectClient();
            var request = new StartOutboundVoiceContactRequest {
                InstanceId             = "c2e9dc6f-3f69-40e2-b0ec-f78d0c62bee6",
                ContactFlowId          = "ae4e2be3-5541-4c57-9738-217052e61eb3",
                SourcePhoneNumber      = "+12065550100",
                DestinationPhoneNumber = "+12065550101",
                ClientToken            = "put something random here"
            };
            var response = await client.StartOutboundVoiceContactAsync(request);

            Console.WriteLine(response);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the StartOutboundVoiceContact operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the StartOutboundVoiceContact operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/StartOutboundVoiceContact">REST API Reference for StartOutboundVoiceContact Operation</seealso>
        public virtual Task <StartOutboundVoiceContactResponse> StartOutboundVoiceContactAsync(StartOutboundVoiceContactRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = StartOutboundVoiceContactRequestMarshaller.Instance;
            var unmarshaller = StartOutboundVoiceContactResponseUnmarshaller.Instance;

            return(InvokeAsync <StartOutboundVoiceContactRequest, StartOutboundVoiceContactResponse>(request, marshaller,
                                                                                                     unmarshaller, cancellationToken));
        }