Commit e2e11be
authored
CallInvite has CustomContext class (#26624)
### Packages impacted by this PR
azure/communication-call-automation
### Issues associated with this PR
#customers' feedback:
SIP UUI format: The format used by ACS (userToUser) is not aligned to
RFC format. Developers being more familiar with the latter, I recommend
we align to RFC format (User-to-User) in SDK as well as EG payload, just
we like we do for custom headers.
In line with No.1, it might be a better experience to manage the strict
header key format at SDK layer, so that every developer doesnt have to
remember to set the correct format in the request.
eg. Instead of callInvite.SipHeaders.Add("userToUser",
"616d617a6f6e5f6368696;encoding=hex");
we do
callInvite.SipHeaders.AddUserToUser("616d617a6f6e5f6368696;encoding=hex");
eg. Instead of callInvite.SipHeaders.Add("X-MS-Custom-",
"434erdr454tf"),
we do callInvite.SipHeaders.AddCustomHeader("", "434erdr454tf");
#Design:
1.1.1 PSTN target
```
CallInvite callInvite = new CallInvite(new PhoneNumberIdentifier(targetParticipant), callerIdNumber);
callInvite.CustomContext.Add(new SIPUUIHeader(“jason”));
callInvite.CustomContext.Add(new SIPCustomHeader("Frank", "Rizzo")); // SDK will add prefix "X-MS-Custom-"
```
Then SDK will send this payload to PMA:
```
customContext: {
"sipHeaders":
{
"User-to-User": "jason",
"X-MS-Custom-Frank": "Rizzo"
}
}
```
1.1.2 VoiP Target
```
CallInvite callInvite = new CallInvite(new CommunicationUserIdentifier(targetParticipant))
callInvite.CustomContext.Add(new VoipHeader("Foo-1", "Bar")); //no prefix
```
Then SDK will send below payload to PMA:
```
customContext: {
"voipHeaders":
{
"Foo-1": "Bar"
}
}
```
### Describe the problem that is addressed by this PR
### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
### Are there test cases added in this PR? _(If not, why?)_
### Provide a list of related PRs _(if any)_
### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_
### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)1 parent 01f528f commit e2e11be
File tree
5 files changed
+142
-40
lines changed- sdk/communication/communication-call-automation
- review
- src
- models
5 files changed
+142
-40
lines changedLines changed: 47 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
| 136 | + | |
139 | 137 | | |
140 | 138 | | |
141 | 139 | | |
142 | 140 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | 141 | | |
147 | 142 | | |
148 | 143 | | |
| |||
314 | 309 | | |
315 | 310 | | |
316 | 311 | | |
| 312 | + | |
317 | 313 | | |
318 | 314 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | 315 | | |
323 | 316 | | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | 317 | | |
328 | 318 | | |
329 | 319 | | |
330 | 320 | | |
331 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
332 | 339 | | |
333 | 340 | | |
334 | 341 | | |
| |||
862 | 869 | | |
863 | 870 | | |
864 | 871 | | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
865 | 890 | | |
866 | 891 | | |
867 | 892 | | |
| |||
916 | 941 | | |
917 | 942 | | |
918 | 943 | | |
| 944 | + | |
919 | 945 | | |
920 | | - | |
921 | | - | |
922 | | - | |
923 | 946 | | |
924 | | - | |
925 | | - | |
926 | | - | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
927 | 956 | | |
928 | 957 | | |
929 | 958 | | |
| |||
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
235 | | - | |
| 234 | + | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
266 | | - | |
| 265 | + | |
| 266 | + | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
359 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
360 | 361 | | |
361 | 362 | | |
362 | 363 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | | - | |
| 186 | + | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
227 | | - | |
| 226 | + | |
| 227 | + | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| |||
Lines changed: 79 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
156 | 233 | | |
157 | 234 | | |
158 | 235 | | |
159 | 236 | | |
160 | 237 | | |
161 | 238 | | |
162 | 239 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 240 | + | |
| 241 | + | |
167 | 242 | | |
168 | 243 | | |
169 | 244 | | |
| |||
Lines changed: 5 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 84 | + | |
| 85 | + | |
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
| |||
122 | 121 | | |
123 | 122 | | |
124 | 123 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 124 | + | |
| 125 | + | |
129 | 126 | | |
130 | 127 | | |
131 | 128 | | |
| |||
0 commit comments