Skip to content

Commit 6617468

Browse files
authored
[ACS -SIP Routing] GA [Hub Generated] Review request for SipRouting to add version stable/2021-05-01 (#22747)
* Adds base for updating SipRouting from version preview/2021-05-01-preview to version 2021-05-01 * Updates readme * Updates API version in new specs and examples * update to reflect latest version * change GA version * specify security globally * rename patch operation to update to stay inline with Communitaion convention as requested by azure board
1 parent 37f7902 commit 6617468

File tree

4 files changed

+357
-7
lines changed

4 files changed

+357
-7
lines changed

specification/communication/data-plane/SipRouting/readme.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,25 @@ For other options on installation see [Installing AutoRest](https://aka.ms/autor
2424

2525
These are the global settings for the communicationservices.
2626

27-
```yaml
27+
``` yaml
2828
openapi-type: data-plane
29-
tag: package-2023-01-01-preview
29+
tag: package-2023-03
3030
```
3131
32+
33+
### Tag: package-2023-03
34+
35+
These settings apply only when `--tag=package-2023-03` is specified on the command line.
36+
37+
```yaml $(tag) == 'package-2023-03'
38+
input-file:
39+
- stable/2023-03-01/communicationservicessiprouting.json
40+
```
3241
### Tag: package-2023-01-01-preview
3342

3443
These settings apply only when `--tag=package-2023-01-01-preview` is specified on the command line.
3544

36-
```yaml $(tag) == 'package-2023-01-01-preview'
45+
``` yaml $(tag) == 'package-2023-01-01-preview'
3746
input-file:
3847
- preview/2023-01-01-preview/communicationservicessiprouting.json
3948
title:
@@ -44,19 +53,18 @@ title:
4453

4554
These settings apply only when `--tag=package-2022-10-01-preview` is specified on the command line.
4655

47-
```yaml $(tag) == 'package-2022-10-01-preview'
56+
``` yaml $(tag) == 'package-2022-10-01-preview'
4857
input-file:
4958
- preview/2022-10-01-preview/communicationservicessiprouting.json
5059
title:
5160
Azure Communication Services
5261
```
5362

54-
5563
### Tag: package-2022-09-01-preview
5664

5765
These settings apply only when `--tag=package-2022-09-01-preview` is specified on the command line.
5866

59-
```yaml $(tag) == 'package-2022-09-01-preview'
67+
``` yaml $(tag) == 'package-2022-09-01-preview'
6068
input-file:
6169
- preview/2022-09-01-preview/communicationservicessiprouting.json
6270
title:
@@ -67,7 +75,7 @@ title:
6775

6876
These settings apply only when `--tag=package-2021-05-01-preview` is specified on the command line.
6977

70-
```yaml $(tag) == 'package-2021-05-01-preview'
78+
``` yaml $(tag) == 'package-2021-05-01-preview'
7179
input-file:
7280
- preview/2021-05-01-preview/communicationservicessiprouting.json
7381
title:
Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "SipRouting Service",
5+
"description": "SipRouting Service",
6+
"contact": {
7+
"email": "[email protected]"
8+
},
9+
"version": "2023-03-01"
10+
},
11+
"paths": {
12+
"/sip": {
13+
"get": {
14+
"tags": [
15+
"SipConfiguration"
16+
],
17+
"summary": "Gets SIP configuration for resource.",
18+
"operationId": "SipRouting_Get",
19+
"produces": [
20+
"application/json"
21+
],
22+
"parameters": [
23+
{
24+
"$ref": "#/parameters/ApiVersionParameter"
25+
}
26+
],
27+
"responses": {
28+
"200": {
29+
"description": "Ok.",
30+
"schema": {
31+
"$ref": "#/definitions/SipConfiguration"
32+
}
33+
},
34+
"default": {
35+
"description": "Failure",
36+
"schema": {
37+
"$ref": "../../../Common/stable/2022-07-13/common.json#/definitions/CommunicationErrorResponse"
38+
},
39+
"headers": {
40+
"x-ms-error-code": {
41+
"type": "string",
42+
"description": "Error code"
43+
}
44+
}
45+
}
46+
},
47+
"x-ms-examples": {
48+
"Get SIP configuration for resource": {
49+
"$ref": "./examples/GetSipConfiguration.json"
50+
}
51+
}
52+
},
53+
"patch": {
54+
"tags": [
55+
"SipConfiguration"
56+
],
57+
"summary": "Updates SIP configuration for resource.",
58+
"operationId": "SipRouting_Update",
59+
"consumes": [
60+
"application/merge-patch+json"
61+
],
62+
"produces": [
63+
"application/json"
64+
],
65+
"parameters": [
66+
{
67+
"$ref": "#/parameters/ApiVersionParameter"
68+
},
69+
{
70+
"in": "body",
71+
"name": "body",
72+
"description": "Sip configuration update object.",
73+
"schema": {
74+
"$ref": "#/definitions/SipConfigurationUpdate"
75+
}
76+
}
77+
],
78+
"responses": {
79+
"200": {
80+
"description": "Updated configuration is returned.",
81+
"schema": {
82+
"$ref": "#/definitions/SipConfiguration"
83+
}
84+
},
85+
"default": {
86+
"description": "Failure",
87+
"schema": {
88+
"$ref": "../../../Common/stable/2022-07-13/common.json#/definitions/CommunicationErrorResponse"
89+
},
90+
"headers": {
91+
"x-ms-error-code": {
92+
"type": "string",
93+
"description": "Error code"
94+
}
95+
}
96+
}
97+
},
98+
"x-ms-examples": {
99+
"Update SIP configuration for resource": {
100+
"$ref": "./examples/UpdateSipConfiguration.json"
101+
}
102+
}
103+
}
104+
}
105+
},
106+
"definitions": {
107+
"Trunk": {
108+
"description": "Represents a SIP trunk for routing calls. See RFC 4904.",
109+
"required": [
110+
"sipSignalingPort"
111+
],
112+
"type": "object",
113+
"properties": {
114+
"sipSignalingPort": {
115+
"format": "int32",
116+
"description": "Gets or sets SIP signaling port of the trunk.",
117+
"type": "integer"
118+
}
119+
}
120+
},
121+
"TrunkUpdate": {
122+
"description": "Represents a SIP trunk update.",
123+
"type": "object",
124+
"properties": {
125+
"sipSignalingPort": {
126+
"format": "int32",
127+
"description": "Gets or sets SIP signaling port of the trunk.",
128+
"type": "integer"
129+
}
130+
}
131+
},
132+
"TrunkRoute": {
133+
"description": "Represents a trunk route for routing calls.",
134+
"required": [
135+
"name",
136+
"numberPattern"
137+
],
138+
"type": "object",
139+
"properties": {
140+
"description": {
141+
"description": "Gets or sets description of the route.",
142+
"maxLength": 1024,
143+
"type": "string"
144+
},
145+
"name": {
146+
"description": "Gets or sets name of the route.",
147+
"maxLength": 256,
148+
"type": "string"
149+
},
150+
"numberPattern": {
151+
"description": "Gets or sets regex number pattern for routing calls. .NET regex format is supported.\r\nThe regex should match only digits with an optional '+' prefix without spaces.\r\nI.e. \"^\\+[1-9][0-9]{3,23}$\".",
152+
"maxLength": 1024,
153+
"type": "string"
154+
},
155+
"trunks": {
156+
"description": "Gets or sets list of SIP trunks for routing calls. Trunks are represented as FQDN.",
157+
"maxItems": 250,
158+
"type": "array",
159+
"items": {
160+
"type": "string"
161+
}
162+
}
163+
}
164+
},
165+
"SipConfiguration": {
166+
"description": "Represents a SIP configuration.\r\nWhen a call is being routed the routes are applied in the same order as in the routes list.\r\nA route is matched by its number pattern.\r\nCall is then directed into route's first available trunk, based on the order in the route's trunks list.",
167+
"type": "object",
168+
"properties": {
169+
"trunks": {
170+
"description": "SIP trunks for routing calls.\r\nMap key is trunk's FQDN (1-249 characters).",
171+
"maxProperties": 250,
172+
"type": "object",
173+
"additionalProperties": {
174+
"$ref": "#/definitions/Trunk"
175+
}
176+
},
177+
"routes": {
178+
"description": "Trunk routes for routing calls.",
179+
"maxItems": 250,
180+
"type": "array",
181+
"items": {
182+
"$ref": "#/definitions/TrunkRoute"
183+
}
184+
}
185+
}
186+
},
187+
"SipConfigurationUpdate": {
188+
"description": "Represents a SIP configuration update.",
189+
"type": "object",
190+
"properties": {
191+
"trunks": {
192+
"description": "SIP trunks for routing calls.\r\nMap key is trunk's FQDN (1-249 characters).",
193+
"maxProperties": 250,
194+
"type": "object",
195+
"additionalProperties": {
196+
"$ref": "#/definitions/TrunkUpdate"
197+
}
198+
},
199+
"routes": {
200+
"description": "Trunk routes for routing calls.",
201+
"maxItems": 250,
202+
"type": "array",
203+
"items": {
204+
"$ref": "#/definitions/TrunkRoute"
205+
}
206+
}
207+
}
208+
}
209+
},
210+
"parameters": {
211+
"ApiVersionParameter": {
212+
"in": "query",
213+
"name": "api-version",
214+
"description": "Version of API to invoke",
215+
"required": true,
216+
"type": "string"
217+
},
218+
"Endpoint": {
219+
"in": "path",
220+
"name": "endpoint",
221+
"description": "The communication resource, for example https://resourcename.communication.azure.com",
222+
"required": true,
223+
"type": "string",
224+
"x-ms-skip-url-encoding": true,
225+
"x-ms-parameter-location": "client"
226+
}
227+
},
228+
"securityDefinitions": {
229+
"azure_auth": {
230+
"type": "oauth2",
231+
"flow": "implicit",
232+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
233+
"scopes": {
234+
"user_impersonation": "impersonate your user account"
235+
},
236+
"description": "Azure Active Directory OAuth2 Flow"
237+
},
238+
"apiKey": {
239+
"type": "apiKey",
240+
"name": "Authorization",
241+
"in": "header",
242+
"description": "An authentication string containing a signature generated using HMAC-SHA256 scheme."
243+
}
244+
},
245+
"security": [
246+
{
247+
"azure_auth": [
248+
"user_impersonation"
249+
],
250+
"apiKey": []
251+
}
252+
],
253+
"x-ms-parameterized-host": {
254+
"hostTemplate": "{endpoint}",
255+
"useSchemePrefix": false,
256+
"parameters": [
257+
{
258+
"$ref": "#/parameters/Endpoint"
259+
}
260+
]
261+
}
262+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parameters": {
3+
"api-version": "2023-03-01",
4+
"endpoint": "https://resourcename.communication.azure.com/"
5+
},
6+
"responses": {
7+
"200": {
8+
"headers": {},
9+
"body": {
10+
"trunks": {
11+
"vendor.xyz.biz": {
12+
"sipSignalingPort": 5061
13+
},
14+
"vendor.abc.biz": {
15+
"sipSignalingPort": 5061
16+
}
17+
},
18+
"routes": [
19+
{
20+
"name": "LocalRoute",
21+
"numberPattern": "^\\+1[0-9]{10}$"
22+
},
23+
{
24+
"name": "VendorXYZ",
25+
"description": "External route XYZ",
26+
"numberPattern": "^\\+?\\d+$",
27+
"trunks": [
28+
"vendor.xyz.biz"
29+
]
30+
}
31+
]
32+
}
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)