CreateSipRuleCommand

  • Replaced by CreateSipRule in the Amazon Chime SDK Voice Namespace

Creates a SIP rule which can be used to run a SIP media application as a target for a specific trigger type.

This API is is no longer supported and will not be updated. We recommend using the latest version, CreateSipRule , in the Amazon Chime SDK.

Using the latest version requires migrating to a dedicated namespace. For more information, refer to Migrating from the Amazon Chime namespace  in the Amazon Chime SDK Developer Guide.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { ChimeClient, CreateSipRuleCommand } from "@aws-sdk/client-chime"; // ES Modules import
// const { ChimeClient, CreateSipRuleCommand } = require("@aws-sdk/client-chime"); // CommonJS import
const client = new ChimeClient(config);
const input = { // CreateSipRuleRequest
  Name: "STRING_VALUE", // required
  TriggerType: "ToPhoneNumber" || "RequestUriHostname", // required
  TriggerValue: "STRING_VALUE", // required
  Disabled: true || false,
  TargetApplications: [ // SipRuleTargetApplicationList // required
    { // SipRuleTargetApplication
      SipMediaApplicationId: "STRING_VALUE",
      Priority: Number("int"),
      AwsRegion: "STRING_VALUE",
    },
  ],
};
const command = new CreateSipRuleCommand(input);
const response = await client.send(command);
// { // CreateSipRuleResponse
//   SipRule: { // SipRule
//     SipRuleId: "STRING_VALUE",
//     Name: "STRING_VALUE",
//     Disabled: true || false,
//     TriggerType: "ToPhoneNumber" || "RequestUriHostname",
//     TriggerValue: "STRING_VALUE",
//     TargetApplications: [ // SipRuleTargetApplicationList
//       { // SipRuleTargetApplication
//         SipMediaApplicationId: "STRING_VALUE",
//         Priority: Number("int"),
//         AwsRegion: "STRING_VALUE",
//       },
//     ],
//     CreatedTimestamp: new Date("TIMESTAMP"),
//     UpdatedTimestamp: new Date("TIMESTAMP"),
//   },
// };

CreateSipRuleCommand Input

See CreateSipRuleCommandInput for more details

Parameter
Type
Description
Name
Required
string | undefined

The name of the SIP rule.

TargetApplications
Required
SipRuleTargetApplication[] | undefined

List of SIP media applications with priority and AWS Region. Only one SIP application per AWS Region can be used.

TriggerType
Required
SipRuleTriggerType | undefined

The type of trigger assigned to the SIP rule in TriggerValue, currently RequestUriHostname or ToPhoneNumber.

TriggerValue
Required
string | undefined

If TriggerType is RequestUriHostname, the value can be the outbound host name of an Amazon Chime Voice Connector. If TriggerType is ToPhoneNumber, the value can be a customer-owned phone number in the E164 format. The SipMediaApplication specified in the SipRule is triggered if the request URI in an incoming SIP request matches the RequestUriHostname, or if the To header in the incoming SIP request matches the ToPhoneNumber value.

Disabled
boolean | undefined

Enables or disables a rule. You must disable rules before you can delete them.

CreateSipRuleCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
SipRule
SipRule | undefined

Returns the SIP rule information, including the rule ID, triggers, and target applications.

Throws

Name
Fault
Details
AccessDeniedException
client

You don't have permissions to perform the requested operation.

BadRequestException
client

The input parameters don't match the service's restrictions.

ConflictException
client

The request could not be processed because of conflict in the current state of the resource.

ForbiddenException
client

The client is permanently forbidden from making the request.

ResourceLimitExceededException
client

The request exceeds the resource limit.

ServiceFailureException
server

The service encountered an unexpected error.

ServiceUnavailableException
server

The service is currently unavailable.

ThrottledClientException
client

The client exceeded its request rate limit.

UnauthorizedClientException
client

The client is not currently authorized to make the request.

ChimeServiceException
Base exception class for all service exceptions from Chime service.