@ondewo/sip-client-angular 5.2.0 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2037 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ // @ts-nocheck
4
+ //
5
+ // THIS IS A GENERATED FILE
6
+ // DO NOT MODIFY IT! YOUR CHANGES WILL BE LOST
7
+ import {
8
+ GrpcMessage,
9
+ RecursivePartial,
10
+ ToProtobufJSONOptions,
11
+ uint8ArrayToBase64
12
+ } from '@ngx-grpc/common';
13
+ import { BinaryReader, BinaryWriter, ByteSource } from 'google-protobuf';
14
+ import * as googleProtobuf000 from '@ngx-grpc/well-known-types';
15
+ import * as googleProtobuf001 from '@ngx-grpc/well-known-types';
16
+ /**
17
+ * Message implementation for ondewo.sip.SipEndCallRequest
18
+ */
19
+ export class SipEndCallRequest implements GrpcMessage {
20
+ static id = 'ondewo.sip.SipEndCallRequest';
21
+
22
+ /**
23
+ * Deserialize binary data to message
24
+ * @param instance message instance
25
+ */
26
+ static deserializeBinary(bytes: ByteSource) {
27
+ const instance = new SipEndCallRequest();
28
+ SipEndCallRequest.deserializeBinaryFromReader(
29
+ instance,
30
+ new BinaryReader(bytes)
31
+ );
32
+ return instance;
33
+ }
34
+
35
+ /**
36
+ * Check all the properties and set default protobuf values if necessary
37
+ * @param _instance message instance
38
+ */
39
+ static refineValues(_instance: SipEndCallRequest) {
40
+ _instance.hardHangup = _instance.hardHangup || false;
41
+ }
42
+
43
+ /**
44
+ * Deserializes / reads binary message into message instance using provided binary reader
45
+ * @param _instance message instance
46
+ * @param _reader binary reader instance
47
+ */
48
+ static deserializeBinaryFromReader(
49
+ _instance: SipEndCallRequest,
50
+ _reader: BinaryReader
51
+ ) {
52
+ while (_reader.nextField()) {
53
+ if (_reader.isEndGroup()) break;
54
+
55
+ switch (_reader.getFieldNumber()) {
56
+ case 1:
57
+ _instance.hardHangup = _reader.readBool();
58
+ break;
59
+ default:
60
+ _reader.skipField();
61
+ }
62
+ }
63
+
64
+ SipEndCallRequest.refineValues(_instance);
65
+ }
66
+
67
+ /**
68
+ * Serializes a message to binary format using provided binary reader
69
+ * @param _instance message instance
70
+ * @param _writer binary writer instance
71
+ */
72
+ static serializeBinaryToWriter(
73
+ _instance: SipEndCallRequest,
74
+ _writer: BinaryWriter
75
+ ) {
76
+ if (_instance.hardHangup) {
77
+ _writer.writeBool(1, _instance.hardHangup);
78
+ }
79
+ }
80
+
81
+ private _hardHangup: boolean;
82
+
83
+ /**
84
+ * Message constructor. Initializes the properties and applies default Protobuf values if necessary
85
+ * @param _value initial values object or instance of SipEndCallRequest to deeply clone from
86
+ */
87
+ constructor(_value?: RecursivePartial<SipEndCallRequest.AsObject>) {
88
+ _value = _value || {};
89
+ this.hardHangup = _value.hardHangup;
90
+ SipEndCallRequest.refineValues(this);
91
+ }
92
+ get hardHangup(): boolean {
93
+ return this._hardHangup;
94
+ }
95
+ set hardHangup(value: boolean) {
96
+ this._hardHangup = value;
97
+ }
98
+
99
+ /**
100
+ * Serialize message to binary data
101
+ * @param instance message instance
102
+ */
103
+ serializeBinary() {
104
+ const writer = new BinaryWriter();
105
+ SipEndCallRequest.serializeBinaryToWriter(this, writer);
106
+ return writer.getResultBuffer();
107
+ }
108
+
109
+ /**
110
+ * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
111
+ */
112
+ toObject(): SipEndCallRequest.AsObject {
113
+ return {
114
+ hardHangup: this.hardHangup
115
+ };
116
+ }
117
+
118
+ /**
119
+ * Convenience method to support JSON.stringify(message), replicates the structure of toObject()
120
+ */
121
+ toJSON() {
122
+ return this.toObject();
123
+ }
124
+
125
+ /**
126
+ * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
127
+ * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
128
+ * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
129
+ */
130
+ toProtobufJSON(
131
+ // @ts-ignore
132
+ options?: ToProtobufJSONOptions
133
+ ): SipEndCallRequest.AsProtobufJSON {
134
+ return {
135
+ hardHangup: this.hardHangup
136
+ };
137
+ }
138
+ }
139
+ export module SipEndCallRequest {
140
+ /**
141
+ * Standard JavaScript object representation for SipEndCallRequest
142
+ */
143
+ export interface AsObject {
144
+ hardHangup: boolean;
145
+ }
146
+
147
+ /**
148
+ * Protobuf JSON representation for SipEndCallRequest
149
+ */
150
+ export interface AsProtobufJSON {
151
+ hardHangup: boolean;
152
+ }
153
+ }
154
+
155
+ /**
156
+ * Message implementation for ondewo.sip.SipStartCallRequest
157
+ */
158
+ export class SipStartCallRequest implements GrpcMessage {
159
+ static id = 'ondewo.sip.SipStartCallRequest';
160
+
161
+ /**
162
+ * Deserialize binary data to message
163
+ * @param instance message instance
164
+ */
165
+ static deserializeBinary(bytes: ByteSource) {
166
+ const instance = new SipStartCallRequest();
167
+ SipStartCallRequest.deserializeBinaryFromReader(
168
+ instance,
169
+ new BinaryReader(bytes)
170
+ );
171
+ return instance;
172
+ }
173
+
174
+ /**
175
+ * Check all the properties and set default protobuf values if necessary
176
+ * @param _instance message instance
177
+ */
178
+ static refineValues(_instance: SipStartCallRequest) {
179
+ _instance.calleeId = _instance.calleeId || '';
180
+ _instance.headers = _instance.headers || {};
181
+ }
182
+
183
+ /**
184
+ * Deserializes / reads binary message into message instance using provided binary reader
185
+ * @param _instance message instance
186
+ * @param _reader binary reader instance
187
+ */
188
+ static deserializeBinaryFromReader(
189
+ _instance: SipStartCallRequest,
190
+ _reader: BinaryReader
191
+ ) {
192
+ while (_reader.nextField()) {
193
+ if (_reader.isEndGroup()) break;
194
+
195
+ switch (_reader.getFieldNumber()) {
196
+ case 1:
197
+ _instance.calleeId = _reader.readString();
198
+ break;
199
+ case 2:
200
+ const msg_2 = {} as any;
201
+ _reader.readMessage(
202
+ msg_2,
203
+ SipStartCallRequest.HeadersEntry.deserializeBinaryFromReader
204
+ );
205
+ _instance.headers = _instance.headers || {};
206
+ _instance.headers[msg_2.key] = msg_2.value;
207
+ break;
208
+ default:
209
+ _reader.skipField();
210
+ }
211
+ }
212
+
213
+ SipStartCallRequest.refineValues(_instance);
214
+ }
215
+
216
+ /**
217
+ * Serializes a message to binary format using provided binary reader
218
+ * @param _instance message instance
219
+ * @param _writer binary writer instance
220
+ */
221
+ static serializeBinaryToWriter(
222
+ _instance: SipStartCallRequest,
223
+ _writer: BinaryWriter
224
+ ) {
225
+ if (_instance.calleeId) {
226
+ _writer.writeString(1, _instance.calleeId);
227
+ }
228
+ if (!!_instance.headers) {
229
+ const keys_2 = Object.keys(_instance.headers as any);
230
+
231
+ if (keys_2.length) {
232
+ const repeated_2 = keys_2
233
+ .map(key => ({ key: key, value: (_instance.headers as any)[key] }))
234
+ .reduce((r, v) => [...r, v], [] as any[]);
235
+
236
+ _writer.writeRepeatedMessage(
237
+ 2,
238
+ repeated_2,
239
+ SipStartCallRequest.HeadersEntry.serializeBinaryToWriter
240
+ );
241
+ }
242
+ }
243
+ }
244
+
245
+ private _calleeId: string;
246
+ private _headers: { [prop: string]: string };
247
+
248
+ /**
249
+ * Message constructor. Initializes the properties and applies default Protobuf values if necessary
250
+ * @param _value initial values object or instance of SipStartCallRequest to deeply clone from
251
+ */
252
+ constructor(_value?: RecursivePartial<SipStartCallRequest.AsObject>) {
253
+ _value = _value || {};
254
+ this.calleeId = _value.calleeId;
255
+ (this.headers = _value!.headers
256
+ ? Object.keys(_value!.headers).reduce(
257
+ (r, k) => ({ ...r, [k]: _value!.headers![k] }),
258
+ {}
259
+ )
260
+ : {}),
261
+ SipStartCallRequest.refineValues(this);
262
+ }
263
+ get calleeId(): string {
264
+ return this._calleeId;
265
+ }
266
+ set calleeId(value: string) {
267
+ this._calleeId = value;
268
+ }
269
+ get headers(): { [prop: string]: string } {
270
+ return this._headers;
271
+ }
272
+ set headers(value: { [prop: string]: string }) {
273
+ this._headers = value;
274
+ }
275
+
276
+ /**
277
+ * Serialize message to binary data
278
+ * @param instance message instance
279
+ */
280
+ serializeBinary() {
281
+ const writer = new BinaryWriter();
282
+ SipStartCallRequest.serializeBinaryToWriter(this, writer);
283
+ return writer.getResultBuffer();
284
+ }
285
+
286
+ /**
287
+ * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
288
+ */
289
+ toObject(): SipStartCallRequest.AsObject {
290
+ return {
291
+ calleeId: this.calleeId,
292
+ headers: this.headers
293
+ ? Object.keys(this.headers).reduce(
294
+ (r, k) => ({ ...r, [k]: this.headers![k] }),
295
+ {}
296
+ )
297
+ : {}
298
+ };
299
+ }
300
+
301
+ /**
302
+ * Convenience method to support JSON.stringify(message), replicates the structure of toObject()
303
+ */
304
+ toJSON() {
305
+ return this.toObject();
306
+ }
307
+
308
+ /**
309
+ * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
310
+ * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
311
+ * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
312
+ */
313
+ toProtobufJSON(
314
+ // @ts-ignore
315
+ options?: ToProtobufJSONOptions
316
+ ): SipStartCallRequest.AsProtobufJSON {
317
+ return {
318
+ calleeId: this.calleeId,
319
+ headers: this.headers
320
+ ? Object.keys(this.headers).reduce(
321
+ (r, k) => ({ ...r, [k]: this.headers![k] }),
322
+ {}
323
+ )
324
+ : {}
325
+ };
326
+ }
327
+ }
328
+ export module SipStartCallRequest {
329
+ /**
330
+ * Standard JavaScript object representation for SipStartCallRequest
331
+ */
332
+ export interface AsObject {
333
+ calleeId: string;
334
+ headers: { [prop: string]: string };
335
+ }
336
+
337
+ /**
338
+ * Protobuf JSON representation for SipStartCallRequest
339
+ */
340
+ export interface AsProtobufJSON {
341
+ calleeId: string;
342
+ headers: { [prop: string]: string };
343
+ }
344
+
345
+ /**
346
+ * Message implementation for ondewo.sip.SipStartCallRequest.HeadersEntry
347
+ */
348
+ export class HeadersEntry implements GrpcMessage {
349
+ static id = 'ondewo.sip.SipStartCallRequest.HeadersEntry';
350
+
351
+ /**
352
+ * Deserialize binary data to message
353
+ * @param instance message instance
354
+ */
355
+ static deserializeBinary(bytes: ByteSource) {
356
+ const instance = new HeadersEntry();
357
+ HeadersEntry.deserializeBinaryFromReader(
358
+ instance,
359
+ new BinaryReader(bytes)
360
+ );
361
+ return instance;
362
+ }
363
+
364
+ /**
365
+ * Check all the properties and set default protobuf values if necessary
366
+ * @param _instance message instance
367
+ */
368
+ static refineValues(_instance: HeadersEntry) {
369
+ _instance.key = _instance.key || '';
370
+ _instance.value = _instance.value || '';
371
+ }
372
+
373
+ /**
374
+ * Deserializes / reads binary message into message instance using provided binary reader
375
+ * @param _instance message instance
376
+ * @param _reader binary reader instance
377
+ */
378
+ static deserializeBinaryFromReader(
379
+ _instance: HeadersEntry,
380
+ _reader: BinaryReader
381
+ ) {
382
+ while (_reader.nextField()) {
383
+ if (_reader.isEndGroup()) break;
384
+
385
+ switch (_reader.getFieldNumber()) {
386
+ case 1:
387
+ _instance.key = _reader.readString();
388
+ break;
389
+ case 2:
390
+ _instance.value = _reader.readString();
391
+ break;
392
+ default:
393
+ _reader.skipField();
394
+ }
395
+ }
396
+
397
+ HeadersEntry.refineValues(_instance);
398
+ }
399
+
400
+ /**
401
+ * Serializes a message to binary format using provided binary reader
402
+ * @param _instance message instance
403
+ * @param _writer binary writer instance
404
+ */
405
+ static serializeBinaryToWriter(
406
+ _instance: HeadersEntry,
407
+ _writer: BinaryWriter
408
+ ) {
409
+ if (_instance.key) {
410
+ _writer.writeString(1, _instance.key);
411
+ }
412
+ if (_instance.value) {
413
+ _writer.writeString(2, _instance.value);
414
+ }
415
+ }
416
+
417
+ private _key: string;
418
+ private _value: string;
419
+
420
+ /**
421
+ * Message constructor. Initializes the properties and applies default Protobuf values if necessary
422
+ * @param _value initial values object or instance of HeadersEntry to deeply clone from
423
+ */
424
+ constructor(_value?: RecursivePartial<HeadersEntry.AsObject>) {
425
+ _value = _value || {};
426
+ this.key = _value.key;
427
+ this.value = _value.value;
428
+ HeadersEntry.refineValues(this);
429
+ }
430
+ get key(): string {
431
+ return this._key;
432
+ }
433
+ set key(value: string) {
434
+ this._key = value;
435
+ }
436
+ get value(): string {
437
+ return this._value;
438
+ }
439
+ set value(value: string) {
440
+ this._value = value;
441
+ }
442
+
443
+ /**
444
+ * Serialize message to binary data
445
+ * @param instance message instance
446
+ */
447
+ serializeBinary() {
448
+ const writer = new BinaryWriter();
449
+ HeadersEntry.serializeBinaryToWriter(this, writer);
450
+ return writer.getResultBuffer();
451
+ }
452
+
453
+ /**
454
+ * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
455
+ */
456
+ toObject(): HeadersEntry.AsObject {
457
+ return {
458
+ key: this.key,
459
+ value: this.value
460
+ };
461
+ }
462
+
463
+ /**
464
+ * Convenience method to support JSON.stringify(message), replicates the structure of toObject()
465
+ */
466
+ toJSON() {
467
+ return this.toObject();
468
+ }
469
+
470
+ /**
471
+ * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
472
+ * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
473
+ * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
474
+ */
475
+ toProtobufJSON(
476
+ // @ts-ignore
477
+ options?: ToProtobufJSONOptions
478
+ ): HeadersEntry.AsProtobufJSON {
479
+ return {
480
+ key: this.key,
481
+ value: this.value
482
+ };
483
+ }
484
+ }
485
+ export module HeadersEntry {
486
+ /**
487
+ * Standard JavaScript object representation for HeadersEntry
488
+ */
489
+ export interface AsObject {
490
+ key: string;
491
+ value: string;
492
+ }
493
+
494
+ /**
495
+ * Protobuf JSON representation for HeadersEntry
496
+ */
497
+ export interface AsProtobufJSON {
498
+ key: string;
499
+ value: string;
500
+ }
501
+ }
502
+ }
503
+
504
+ /**
505
+ * Message implementation for ondewo.sip.SipRegisterAccountRequest
506
+ */
507
+ export class SipRegisterAccountRequest implements GrpcMessage {
508
+ static id = 'ondewo.sip.SipRegisterAccountRequest';
509
+
510
+ /**
511
+ * Deserialize binary data to message
512
+ * @param instance message instance
513
+ */
514
+ static deserializeBinary(bytes: ByteSource) {
515
+ const instance = new SipRegisterAccountRequest();
516
+ SipRegisterAccountRequest.deserializeBinaryFromReader(
517
+ instance,
518
+ new BinaryReader(bytes)
519
+ );
520
+ return instance;
521
+ }
522
+
523
+ /**
524
+ * Check all the properties and set default protobuf values if necessary
525
+ * @param _instance message instance
526
+ */
527
+ static refineValues(_instance: SipRegisterAccountRequest) {
528
+ _instance.accountName = _instance.accountName || '';
529
+ _instance.password = _instance.password || '';
530
+ _instance.authUsername = _instance.authUsername || '';
531
+ _instance.outboundProxy = _instance.outboundProxy || '';
532
+ }
533
+
534
+ /**
535
+ * Deserializes / reads binary message into message instance using provided binary reader
536
+ * @param _instance message instance
537
+ * @param _reader binary reader instance
538
+ */
539
+ static deserializeBinaryFromReader(
540
+ _instance: SipRegisterAccountRequest,
541
+ _reader: BinaryReader
542
+ ) {
543
+ while (_reader.nextField()) {
544
+ if (_reader.isEndGroup()) break;
545
+
546
+ switch (_reader.getFieldNumber()) {
547
+ case 1:
548
+ _instance.accountName = _reader.readString();
549
+ break;
550
+ case 2:
551
+ _instance.password = _reader.readString();
552
+ break;
553
+ case 3:
554
+ _instance.authUsername = _reader.readString();
555
+ break;
556
+ case 4:
557
+ _instance.outboundProxy = _reader.readString();
558
+ break;
559
+ default:
560
+ _reader.skipField();
561
+ }
562
+ }
563
+
564
+ SipRegisterAccountRequest.refineValues(_instance);
565
+ }
566
+
567
+ /**
568
+ * Serializes a message to binary format using provided binary reader
569
+ * @param _instance message instance
570
+ * @param _writer binary writer instance
571
+ */
572
+ static serializeBinaryToWriter(
573
+ _instance: SipRegisterAccountRequest,
574
+ _writer: BinaryWriter
575
+ ) {
576
+ if (_instance.accountName) {
577
+ _writer.writeString(1, _instance.accountName);
578
+ }
579
+ if (_instance.password) {
580
+ _writer.writeString(2, _instance.password);
581
+ }
582
+ if (_instance.authUsername) {
583
+ _writer.writeString(3, _instance.authUsername);
584
+ }
585
+ if (_instance.outboundProxy) {
586
+ _writer.writeString(4, _instance.outboundProxy);
587
+ }
588
+ }
589
+
590
+ private _accountName: string;
591
+ private _password: string;
592
+ private _authUsername: string;
593
+ private _outboundProxy: string;
594
+
595
+ /**
596
+ * Message constructor. Initializes the properties and applies default Protobuf values if necessary
597
+ * @param _value initial values object or instance of SipRegisterAccountRequest to deeply clone from
598
+ */
599
+ constructor(_value?: RecursivePartial<SipRegisterAccountRequest.AsObject>) {
600
+ _value = _value || {};
601
+ this.accountName = _value.accountName;
602
+ this.password = _value.password;
603
+ this.authUsername = _value.authUsername;
604
+ this.outboundProxy = _value.outboundProxy;
605
+ SipRegisterAccountRequest.refineValues(this);
606
+ }
607
+ get accountName(): string {
608
+ return this._accountName;
609
+ }
610
+ set accountName(value: string) {
611
+ this._accountName = value;
612
+ }
613
+ get password(): string {
614
+ return this._password;
615
+ }
616
+ set password(value: string) {
617
+ this._password = value;
618
+ }
619
+ get authUsername(): string {
620
+ return this._authUsername;
621
+ }
622
+ set authUsername(value: string) {
623
+ this._authUsername = value;
624
+ }
625
+ get outboundProxy(): string {
626
+ return this._outboundProxy;
627
+ }
628
+ set outboundProxy(value: string) {
629
+ this._outboundProxy = value;
630
+ }
631
+
632
+ /**
633
+ * Serialize message to binary data
634
+ * @param instance message instance
635
+ */
636
+ serializeBinary() {
637
+ const writer = new BinaryWriter();
638
+ SipRegisterAccountRequest.serializeBinaryToWriter(this, writer);
639
+ return writer.getResultBuffer();
640
+ }
641
+
642
+ /**
643
+ * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
644
+ */
645
+ toObject(): SipRegisterAccountRequest.AsObject {
646
+ return {
647
+ accountName: this.accountName,
648
+ password: this.password,
649
+ authUsername: this.authUsername,
650
+ outboundProxy: this.outboundProxy
651
+ };
652
+ }
653
+
654
+ /**
655
+ * Convenience method to support JSON.stringify(message), replicates the structure of toObject()
656
+ */
657
+ toJSON() {
658
+ return this.toObject();
659
+ }
660
+
661
+ /**
662
+ * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
663
+ * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
664
+ * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
665
+ */
666
+ toProtobufJSON(
667
+ // @ts-ignore
668
+ options?: ToProtobufJSONOptions
669
+ ): SipRegisterAccountRequest.AsProtobufJSON {
670
+ return {
671
+ accountName: this.accountName,
672
+ password: this.password,
673
+ authUsername: this.authUsername,
674
+ outboundProxy: this.outboundProxy
675
+ };
676
+ }
677
+ }
678
+ export module SipRegisterAccountRequest {
679
+ /**
680
+ * Standard JavaScript object representation for SipRegisterAccountRequest
681
+ */
682
+ export interface AsObject {
683
+ accountName: string;
684
+ password: string;
685
+ authUsername: string;
686
+ outboundProxy: string;
687
+ }
688
+
689
+ /**
690
+ * Protobuf JSON representation for SipRegisterAccountRequest
691
+ */
692
+ export interface AsProtobufJSON {
693
+ accountName: string;
694
+ password: string;
695
+ authUsername: string;
696
+ outboundProxy: string;
697
+ }
698
+ }
699
+
700
+ /**
701
+ * Message implementation for ondewo.sip.SipStartSessionRequest
702
+ */
703
+ export class SipStartSessionRequest implements GrpcMessage {
704
+ static id = 'ondewo.sip.SipStartSessionRequest';
705
+
706
+ /**
707
+ * Deserialize binary data to message
708
+ * @param instance message instance
709
+ */
710
+ static deserializeBinary(bytes: ByteSource) {
711
+ const instance = new SipStartSessionRequest();
712
+ SipStartSessionRequest.deserializeBinaryFromReader(
713
+ instance,
714
+ new BinaryReader(bytes)
715
+ );
716
+ return instance;
717
+ }
718
+
719
+ /**
720
+ * Check all the properties and set default protobuf values if necessary
721
+ * @param _instance message instance
722
+ */
723
+ static refineValues(_instance: SipStartSessionRequest) {
724
+ _instance.accountName = _instance.accountName || '';
725
+ _instance.autoAnswerInterval = _instance.autoAnswerInterval || 0;
726
+ }
727
+
728
+ /**
729
+ * Deserializes / reads binary message into message instance using provided binary reader
730
+ * @param _instance message instance
731
+ * @param _reader binary reader instance
732
+ */
733
+ static deserializeBinaryFromReader(
734
+ _instance: SipStartSessionRequest,
735
+ _reader: BinaryReader
736
+ ) {
737
+ while (_reader.nextField()) {
738
+ if (_reader.isEndGroup()) break;
739
+
740
+ switch (_reader.getFieldNumber()) {
741
+ case 1:
742
+ _instance.accountName = _reader.readString();
743
+ break;
744
+ case 2:
745
+ _instance.autoAnswerInterval = _reader.readInt32();
746
+ break;
747
+ default:
748
+ _reader.skipField();
749
+ }
750
+ }
751
+
752
+ SipStartSessionRequest.refineValues(_instance);
753
+ }
754
+
755
+ /**
756
+ * Serializes a message to binary format using provided binary reader
757
+ * @param _instance message instance
758
+ * @param _writer binary writer instance
759
+ */
760
+ static serializeBinaryToWriter(
761
+ _instance: SipStartSessionRequest,
762
+ _writer: BinaryWriter
763
+ ) {
764
+ if (_instance.accountName) {
765
+ _writer.writeString(1, _instance.accountName);
766
+ }
767
+ if (_instance.autoAnswerInterval) {
768
+ _writer.writeInt32(2, _instance.autoAnswerInterval);
769
+ }
770
+ }
771
+
772
+ private _accountName: string;
773
+ private _autoAnswerInterval: number;
774
+
775
+ /**
776
+ * Message constructor. Initializes the properties and applies default Protobuf values if necessary
777
+ * @param _value initial values object or instance of SipStartSessionRequest to deeply clone from
778
+ */
779
+ constructor(_value?: RecursivePartial<SipStartSessionRequest.AsObject>) {
780
+ _value = _value || {};
781
+ this.accountName = _value.accountName;
782
+ this.autoAnswerInterval = _value.autoAnswerInterval;
783
+ SipStartSessionRequest.refineValues(this);
784
+ }
785
+ get accountName(): string {
786
+ return this._accountName;
787
+ }
788
+ set accountName(value: string) {
789
+ this._accountName = value;
790
+ }
791
+ get autoAnswerInterval(): number {
792
+ return this._autoAnswerInterval;
793
+ }
794
+ set autoAnswerInterval(value: number) {
795
+ this._autoAnswerInterval = value;
796
+ }
797
+
798
+ /**
799
+ * Serialize message to binary data
800
+ * @param instance message instance
801
+ */
802
+ serializeBinary() {
803
+ const writer = new BinaryWriter();
804
+ SipStartSessionRequest.serializeBinaryToWriter(this, writer);
805
+ return writer.getResultBuffer();
806
+ }
807
+
808
+ /**
809
+ * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
810
+ */
811
+ toObject(): SipStartSessionRequest.AsObject {
812
+ return {
813
+ accountName: this.accountName,
814
+ autoAnswerInterval: this.autoAnswerInterval
815
+ };
816
+ }
817
+
818
+ /**
819
+ * Convenience method to support JSON.stringify(message), replicates the structure of toObject()
820
+ */
821
+ toJSON() {
822
+ return this.toObject();
823
+ }
824
+
825
+ /**
826
+ * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
827
+ * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
828
+ * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
829
+ */
830
+ toProtobufJSON(
831
+ // @ts-ignore
832
+ options?: ToProtobufJSONOptions
833
+ ): SipStartSessionRequest.AsProtobufJSON {
834
+ return {
835
+ accountName: this.accountName,
836
+ autoAnswerInterval: this.autoAnswerInterval
837
+ };
838
+ }
839
+ }
840
+ export module SipStartSessionRequest {
841
+ /**
842
+ * Standard JavaScript object representation for SipStartSessionRequest
843
+ */
844
+ export interface AsObject {
845
+ accountName: string;
846
+ autoAnswerInterval: number;
847
+ }
848
+
849
+ /**
850
+ * Protobuf JSON representation for SipStartSessionRequest
851
+ */
852
+ export interface AsProtobufJSON {
853
+ accountName: string;
854
+ autoAnswerInterval: number;
855
+ }
856
+ }
857
+
858
+ /**
859
+ * Message implementation for ondewo.sip.SipTransferCallRequest
860
+ */
861
+ export class SipTransferCallRequest implements GrpcMessage {
862
+ static id = 'ondewo.sip.SipTransferCallRequest';
863
+
864
+ /**
865
+ * Deserialize binary data to message
866
+ * @param instance message instance
867
+ */
868
+ static deserializeBinary(bytes: ByteSource) {
869
+ const instance = new SipTransferCallRequest();
870
+ SipTransferCallRequest.deserializeBinaryFromReader(
871
+ instance,
872
+ new BinaryReader(bytes)
873
+ );
874
+ return instance;
875
+ }
876
+
877
+ /**
878
+ * Check all the properties and set default protobuf values if necessary
879
+ * @param _instance message instance
880
+ */
881
+ static refineValues(_instance: SipTransferCallRequest) {
882
+ _instance.transferId = _instance.transferId || '';
883
+ _instance.headers = _instance.headers || {};
884
+ }
885
+
886
+ /**
887
+ * Deserializes / reads binary message into message instance using provided binary reader
888
+ * @param _instance message instance
889
+ * @param _reader binary reader instance
890
+ */
891
+ static deserializeBinaryFromReader(
892
+ _instance: SipTransferCallRequest,
893
+ _reader: BinaryReader
894
+ ) {
895
+ while (_reader.nextField()) {
896
+ if (_reader.isEndGroup()) break;
897
+
898
+ switch (_reader.getFieldNumber()) {
899
+ case 1:
900
+ _instance.transferId = _reader.readString();
901
+ break;
902
+ case 2:
903
+ const msg_2 = {} as any;
904
+ _reader.readMessage(
905
+ msg_2,
906
+ SipTransferCallRequest.HeadersEntry.deserializeBinaryFromReader
907
+ );
908
+ _instance.headers = _instance.headers || {};
909
+ _instance.headers[msg_2.key] = msg_2.value;
910
+ break;
911
+ default:
912
+ _reader.skipField();
913
+ }
914
+ }
915
+
916
+ SipTransferCallRequest.refineValues(_instance);
917
+ }
918
+
919
+ /**
920
+ * Serializes a message to binary format using provided binary reader
921
+ * @param _instance message instance
922
+ * @param _writer binary writer instance
923
+ */
924
+ static serializeBinaryToWriter(
925
+ _instance: SipTransferCallRequest,
926
+ _writer: BinaryWriter
927
+ ) {
928
+ if (_instance.transferId) {
929
+ _writer.writeString(1, _instance.transferId);
930
+ }
931
+ if (!!_instance.headers) {
932
+ const keys_2 = Object.keys(_instance.headers as any);
933
+
934
+ if (keys_2.length) {
935
+ const repeated_2 = keys_2
936
+ .map(key => ({ key: key, value: (_instance.headers as any)[key] }))
937
+ .reduce((r, v) => [...r, v], [] as any[]);
938
+
939
+ _writer.writeRepeatedMessage(
940
+ 2,
941
+ repeated_2,
942
+ SipTransferCallRequest.HeadersEntry.serializeBinaryToWriter
943
+ );
944
+ }
945
+ }
946
+ }
947
+
948
+ private _transferId: string;
949
+ private _headers: { [prop: string]: string };
950
+
951
+ /**
952
+ * Message constructor. Initializes the properties and applies default Protobuf values if necessary
953
+ * @param _value initial values object or instance of SipTransferCallRequest to deeply clone from
954
+ */
955
+ constructor(_value?: RecursivePartial<SipTransferCallRequest.AsObject>) {
956
+ _value = _value || {};
957
+ this.transferId = _value.transferId;
958
+ (this.headers = _value!.headers
959
+ ? Object.keys(_value!.headers).reduce(
960
+ (r, k) => ({ ...r, [k]: _value!.headers![k] }),
961
+ {}
962
+ )
963
+ : {}),
964
+ SipTransferCallRequest.refineValues(this);
965
+ }
966
+ get transferId(): string {
967
+ return this._transferId;
968
+ }
969
+ set transferId(value: string) {
970
+ this._transferId = value;
971
+ }
972
+ get headers(): { [prop: string]: string } {
973
+ return this._headers;
974
+ }
975
+ set headers(value: { [prop: string]: string }) {
976
+ this._headers = value;
977
+ }
978
+
979
+ /**
980
+ * Serialize message to binary data
981
+ * @param instance message instance
982
+ */
983
+ serializeBinary() {
984
+ const writer = new BinaryWriter();
985
+ SipTransferCallRequest.serializeBinaryToWriter(this, writer);
986
+ return writer.getResultBuffer();
987
+ }
988
+
989
+ /**
990
+ * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
991
+ */
992
+ toObject(): SipTransferCallRequest.AsObject {
993
+ return {
994
+ transferId: this.transferId,
995
+ headers: this.headers
996
+ ? Object.keys(this.headers).reduce(
997
+ (r, k) => ({ ...r, [k]: this.headers![k] }),
998
+ {}
999
+ )
1000
+ : {}
1001
+ };
1002
+ }
1003
+
1004
+ /**
1005
+ * Convenience method to support JSON.stringify(message), replicates the structure of toObject()
1006
+ */
1007
+ toJSON() {
1008
+ return this.toObject();
1009
+ }
1010
+
1011
+ /**
1012
+ * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
1013
+ * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
1014
+ * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
1015
+ */
1016
+ toProtobufJSON(
1017
+ // @ts-ignore
1018
+ options?: ToProtobufJSONOptions
1019
+ ): SipTransferCallRequest.AsProtobufJSON {
1020
+ return {
1021
+ transferId: this.transferId,
1022
+ headers: this.headers
1023
+ ? Object.keys(this.headers).reduce(
1024
+ (r, k) => ({ ...r, [k]: this.headers![k] }),
1025
+ {}
1026
+ )
1027
+ : {}
1028
+ };
1029
+ }
1030
+ }
1031
+ export module SipTransferCallRequest {
1032
+ /**
1033
+ * Standard JavaScript object representation for SipTransferCallRequest
1034
+ */
1035
+ export interface AsObject {
1036
+ transferId: string;
1037
+ headers: { [prop: string]: string };
1038
+ }
1039
+
1040
+ /**
1041
+ * Protobuf JSON representation for SipTransferCallRequest
1042
+ */
1043
+ export interface AsProtobufJSON {
1044
+ transferId: string;
1045
+ headers: { [prop: string]: string };
1046
+ }
1047
+
1048
+ /**
1049
+ * Message implementation for ondewo.sip.SipTransferCallRequest.HeadersEntry
1050
+ */
1051
+ export class HeadersEntry implements GrpcMessage {
1052
+ static id = 'ondewo.sip.SipTransferCallRequest.HeadersEntry';
1053
+
1054
+ /**
1055
+ * Deserialize binary data to message
1056
+ * @param instance message instance
1057
+ */
1058
+ static deserializeBinary(bytes: ByteSource) {
1059
+ const instance = new HeadersEntry();
1060
+ HeadersEntry.deserializeBinaryFromReader(
1061
+ instance,
1062
+ new BinaryReader(bytes)
1063
+ );
1064
+ return instance;
1065
+ }
1066
+
1067
+ /**
1068
+ * Check all the properties and set default protobuf values if necessary
1069
+ * @param _instance message instance
1070
+ */
1071
+ static refineValues(_instance: HeadersEntry) {
1072
+ _instance.key = _instance.key || '';
1073
+ _instance.value = _instance.value || '';
1074
+ }
1075
+
1076
+ /**
1077
+ * Deserializes / reads binary message into message instance using provided binary reader
1078
+ * @param _instance message instance
1079
+ * @param _reader binary reader instance
1080
+ */
1081
+ static deserializeBinaryFromReader(
1082
+ _instance: HeadersEntry,
1083
+ _reader: BinaryReader
1084
+ ) {
1085
+ while (_reader.nextField()) {
1086
+ if (_reader.isEndGroup()) break;
1087
+
1088
+ switch (_reader.getFieldNumber()) {
1089
+ case 1:
1090
+ _instance.key = _reader.readString();
1091
+ break;
1092
+ case 2:
1093
+ _instance.value = _reader.readString();
1094
+ break;
1095
+ default:
1096
+ _reader.skipField();
1097
+ }
1098
+ }
1099
+
1100
+ HeadersEntry.refineValues(_instance);
1101
+ }
1102
+
1103
+ /**
1104
+ * Serializes a message to binary format using provided binary reader
1105
+ * @param _instance message instance
1106
+ * @param _writer binary writer instance
1107
+ */
1108
+ static serializeBinaryToWriter(
1109
+ _instance: HeadersEntry,
1110
+ _writer: BinaryWriter
1111
+ ) {
1112
+ if (_instance.key) {
1113
+ _writer.writeString(1, _instance.key);
1114
+ }
1115
+ if (_instance.value) {
1116
+ _writer.writeString(2, _instance.value);
1117
+ }
1118
+ }
1119
+
1120
+ private _key: string;
1121
+ private _value: string;
1122
+
1123
+ /**
1124
+ * Message constructor. Initializes the properties and applies default Protobuf values if necessary
1125
+ * @param _value initial values object or instance of HeadersEntry to deeply clone from
1126
+ */
1127
+ constructor(_value?: RecursivePartial<HeadersEntry.AsObject>) {
1128
+ _value = _value || {};
1129
+ this.key = _value.key;
1130
+ this.value = _value.value;
1131
+ HeadersEntry.refineValues(this);
1132
+ }
1133
+ get key(): string {
1134
+ return this._key;
1135
+ }
1136
+ set key(value: string) {
1137
+ this._key = value;
1138
+ }
1139
+ get value(): string {
1140
+ return this._value;
1141
+ }
1142
+ set value(value: string) {
1143
+ this._value = value;
1144
+ }
1145
+
1146
+ /**
1147
+ * Serialize message to binary data
1148
+ * @param instance message instance
1149
+ */
1150
+ serializeBinary() {
1151
+ const writer = new BinaryWriter();
1152
+ HeadersEntry.serializeBinaryToWriter(this, writer);
1153
+ return writer.getResultBuffer();
1154
+ }
1155
+
1156
+ /**
1157
+ * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
1158
+ */
1159
+ toObject(): HeadersEntry.AsObject {
1160
+ return {
1161
+ key: this.key,
1162
+ value: this.value
1163
+ };
1164
+ }
1165
+
1166
+ /**
1167
+ * Convenience method to support JSON.stringify(message), replicates the structure of toObject()
1168
+ */
1169
+ toJSON() {
1170
+ return this.toObject();
1171
+ }
1172
+
1173
+ /**
1174
+ * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
1175
+ * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
1176
+ * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
1177
+ */
1178
+ toProtobufJSON(
1179
+ // @ts-ignore
1180
+ options?: ToProtobufJSONOptions
1181
+ ): HeadersEntry.AsProtobufJSON {
1182
+ return {
1183
+ key: this.key,
1184
+ value: this.value
1185
+ };
1186
+ }
1187
+ }
1188
+ export module HeadersEntry {
1189
+ /**
1190
+ * Standard JavaScript object representation for HeadersEntry
1191
+ */
1192
+ export interface AsObject {
1193
+ key: string;
1194
+ value: string;
1195
+ }
1196
+
1197
+ /**
1198
+ * Protobuf JSON representation for HeadersEntry
1199
+ */
1200
+ export interface AsProtobufJSON {
1201
+ key: string;
1202
+ value: string;
1203
+ }
1204
+ }
1205
+ }
1206
+
1207
+ /**
1208
+ * Message implementation for ondewo.sip.SipStatus
1209
+ */
1210
+ export class SipStatus implements GrpcMessage {
1211
+ static id = 'ondewo.sip.SipStatus';
1212
+
1213
+ /**
1214
+ * Deserialize binary data to message
1215
+ * @param instance message instance
1216
+ */
1217
+ static deserializeBinary(bytes: ByteSource) {
1218
+ const instance = new SipStatus();
1219
+ SipStatus.deserializeBinaryFromReader(instance, new BinaryReader(bytes));
1220
+ return instance;
1221
+ }
1222
+
1223
+ /**
1224
+ * Check all the properties and set default protobuf values if necessary
1225
+ * @param _instance message instance
1226
+ */
1227
+ static refineValues(_instance: SipStatus) {
1228
+ _instance.accountName = _instance.accountName || '';
1229
+ _instance.timestamp = _instance.timestamp || undefined;
1230
+ _instance.statusType = _instance.statusType || 0;
1231
+ _instance.calleeId = _instance.calleeId || '';
1232
+ _instance.transferCallId = _instance.transferCallId || '';
1233
+ _instance.headers = _instance.headers || {};
1234
+ _instance.description = _instance.description || '';
1235
+ _instance.exceptionName = _instance.exceptionName || '';
1236
+ _instance.exceptionTraceback = _instance.exceptionTraceback || '';
1237
+ _instance.nluSessionName = _instance.nluSessionName || '';
1238
+ }
1239
+
1240
+ /**
1241
+ * Deserializes / reads binary message into message instance using provided binary reader
1242
+ * @param _instance message instance
1243
+ * @param _reader binary reader instance
1244
+ */
1245
+ static deserializeBinaryFromReader(
1246
+ _instance: SipStatus,
1247
+ _reader: BinaryReader
1248
+ ) {
1249
+ while (_reader.nextField()) {
1250
+ if (_reader.isEndGroup()) break;
1251
+
1252
+ switch (_reader.getFieldNumber()) {
1253
+ case 1:
1254
+ _instance.accountName = _reader.readString();
1255
+ break;
1256
+ case 2:
1257
+ _instance.timestamp = new googleProtobuf001.Timestamp();
1258
+ _reader.readMessage(
1259
+ _instance.timestamp,
1260
+ googleProtobuf001.Timestamp.deserializeBinaryFromReader
1261
+ );
1262
+ break;
1263
+ case 3:
1264
+ _instance.statusType = _reader.readEnum();
1265
+ break;
1266
+ case 4:
1267
+ _instance.calleeId = _reader.readString();
1268
+ break;
1269
+ case 5:
1270
+ _instance.transferCallId = _reader.readString();
1271
+ break;
1272
+ case 6:
1273
+ const msg_6 = {} as any;
1274
+ _reader.readMessage(
1275
+ msg_6,
1276
+ SipStatus.HeadersEntry.deserializeBinaryFromReader
1277
+ );
1278
+ _instance.headers = _instance.headers || {};
1279
+ _instance.headers[msg_6.key] = msg_6.value;
1280
+ break;
1281
+ case 7:
1282
+ _instance.description = _reader.readString();
1283
+ break;
1284
+ case 8:
1285
+ _instance.exceptionName = _reader.readString();
1286
+ break;
1287
+ case 9:
1288
+ _instance.exceptionTraceback = _reader.readString();
1289
+ break;
1290
+ case 10:
1291
+ _instance.nluSessionName = _reader.readString();
1292
+ break;
1293
+ default:
1294
+ _reader.skipField();
1295
+ }
1296
+ }
1297
+
1298
+ SipStatus.refineValues(_instance);
1299
+ }
1300
+
1301
+ /**
1302
+ * Serializes a message to binary format using provided binary reader
1303
+ * @param _instance message instance
1304
+ * @param _writer binary writer instance
1305
+ */
1306
+ static serializeBinaryToWriter(_instance: SipStatus, _writer: BinaryWriter) {
1307
+ if (_instance.accountName) {
1308
+ _writer.writeString(1, _instance.accountName);
1309
+ }
1310
+ if (_instance.timestamp) {
1311
+ _writer.writeMessage(
1312
+ 2,
1313
+ _instance.timestamp as any,
1314
+ googleProtobuf001.Timestamp.serializeBinaryToWriter
1315
+ );
1316
+ }
1317
+ if (_instance.statusType) {
1318
+ _writer.writeEnum(3, _instance.statusType);
1319
+ }
1320
+ if (_instance.calleeId) {
1321
+ _writer.writeString(4, _instance.calleeId);
1322
+ }
1323
+ if (_instance.transferCallId) {
1324
+ _writer.writeString(5, _instance.transferCallId);
1325
+ }
1326
+ if (!!_instance.headers) {
1327
+ const keys_6 = Object.keys(_instance.headers as any);
1328
+
1329
+ if (keys_6.length) {
1330
+ const repeated_6 = keys_6
1331
+ .map(key => ({ key: key, value: (_instance.headers as any)[key] }))
1332
+ .reduce((r, v) => [...r, v], [] as any[]);
1333
+
1334
+ _writer.writeRepeatedMessage(
1335
+ 6,
1336
+ repeated_6,
1337
+ SipStatus.HeadersEntry.serializeBinaryToWriter
1338
+ );
1339
+ }
1340
+ }
1341
+ if (_instance.description) {
1342
+ _writer.writeString(7, _instance.description);
1343
+ }
1344
+ if (_instance.exceptionName) {
1345
+ _writer.writeString(8, _instance.exceptionName);
1346
+ }
1347
+ if (_instance.exceptionTraceback) {
1348
+ _writer.writeString(9, _instance.exceptionTraceback);
1349
+ }
1350
+ if (_instance.nluSessionName) {
1351
+ _writer.writeString(10, _instance.nluSessionName);
1352
+ }
1353
+ }
1354
+
1355
+ private _accountName: string;
1356
+ private _timestamp?: googleProtobuf001.Timestamp;
1357
+ private _statusType: SipStatus.StatusType;
1358
+ private _calleeId: string;
1359
+ private _transferCallId: string;
1360
+ private _headers: { [prop: string]: string };
1361
+ private _description: string;
1362
+ private _exceptionName: string;
1363
+ private _exceptionTraceback: string;
1364
+ private _nluSessionName: string;
1365
+
1366
+ /**
1367
+ * Message constructor. Initializes the properties and applies default Protobuf values if necessary
1368
+ * @param _value initial values object or instance of SipStatus to deeply clone from
1369
+ */
1370
+ constructor(_value?: RecursivePartial<SipStatus.AsObject>) {
1371
+ _value = _value || {};
1372
+ this.accountName = _value.accountName;
1373
+ this.timestamp = _value.timestamp
1374
+ ? new googleProtobuf001.Timestamp(_value.timestamp)
1375
+ : undefined;
1376
+ this.statusType = _value.statusType;
1377
+ this.calleeId = _value.calleeId;
1378
+ this.transferCallId = _value.transferCallId;
1379
+ (this.headers = _value!.headers
1380
+ ? Object.keys(_value!.headers).reduce(
1381
+ (r, k) => ({ ...r, [k]: _value!.headers![k] }),
1382
+ {}
1383
+ )
1384
+ : {}),
1385
+ (this.description = _value.description);
1386
+ this.exceptionName = _value.exceptionName;
1387
+ this.exceptionTraceback = _value.exceptionTraceback;
1388
+ this.nluSessionName = _value.nluSessionName;
1389
+ SipStatus.refineValues(this);
1390
+ }
1391
+ get accountName(): string {
1392
+ return this._accountName;
1393
+ }
1394
+ set accountName(value: string) {
1395
+ this._accountName = value;
1396
+ }
1397
+ get timestamp(): googleProtobuf001.Timestamp | undefined {
1398
+ return this._timestamp;
1399
+ }
1400
+ set timestamp(value: googleProtobuf001.Timestamp | undefined) {
1401
+ this._timestamp = value;
1402
+ }
1403
+ get statusType(): SipStatus.StatusType {
1404
+ return this._statusType;
1405
+ }
1406
+ set statusType(value: SipStatus.StatusType) {
1407
+ this._statusType = value;
1408
+ }
1409
+ get calleeId(): string {
1410
+ return this._calleeId;
1411
+ }
1412
+ set calleeId(value: string) {
1413
+ this._calleeId = value;
1414
+ }
1415
+ get transferCallId(): string {
1416
+ return this._transferCallId;
1417
+ }
1418
+ set transferCallId(value: string) {
1419
+ this._transferCallId = value;
1420
+ }
1421
+ get headers(): { [prop: string]: string } {
1422
+ return this._headers;
1423
+ }
1424
+ set headers(value: { [prop: string]: string }) {
1425
+ this._headers = value;
1426
+ }
1427
+ get description(): string {
1428
+ return this._description;
1429
+ }
1430
+ set description(value: string) {
1431
+ this._description = value;
1432
+ }
1433
+ get exceptionName(): string {
1434
+ return this._exceptionName;
1435
+ }
1436
+ set exceptionName(value: string) {
1437
+ this._exceptionName = value;
1438
+ }
1439
+ get exceptionTraceback(): string {
1440
+ return this._exceptionTraceback;
1441
+ }
1442
+ set exceptionTraceback(value: string) {
1443
+ this._exceptionTraceback = value;
1444
+ }
1445
+ get nluSessionName(): string {
1446
+ return this._nluSessionName;
1447
+ }
1448
+ set nluSessionName(value: string) {
1449
+ this._nluSessionName = value;
1450
+ }
1451
+
1452
+ /**
1453
+ * Serialize message to binary data
1454
+ * @param instance message instance
1455
+ */
1456
+ serializeBinary() {
1457
+ const writer = new BinaryWriter();
1458
+ SipStatus.serializeBinaryToWriter(this, writer);
1459
+ return writer.getResultBuffer();
1460
+ }
1461
+
1462
+ /**
1463
+ * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
1464
+ */
1465
+ toObject(): SipStatus.AsObject {
1466
+ return {
1467
+ accountName: this.accountName,
1468
+ timestamp: this.timestamp ? this.timestamp.toObject() : undefined,
1469
+ statusType: this.statusType,
1470
+ calleeId: this.calleeId,
1471
+ transferCallId: this.transferCallId,
1472
+ headers: this.headers
1473
+ ? Object.keys(this.headers).reduce(
1474
+ (r, k) => ({ ...r, [k]: this.headers![k] }),
1475
+ {}
1476
+ )
1477
+ : {},
1478
+ description: this.description,
1479
+ exceptionName: this.exceptionName,
1480
+ exceptionTraceback: this.exceptionTraceback,
1481
+ nluSessionName: this.nluSessionName
1482
+ };
1483
+ }
1484
+
1485
+ /**
1486
+ * Convenience method to support JSON.stringify(message), replicates the structure of toObject()
1487
+ */
1488
+ toJSON() {
1489
+ return this.toObject();
1490
+ }
1491
+
1492
+ /**
1493
+ * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
1494
+ * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
1495
+ * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
1496
+ */
1497
+ toProtobufJSON(
1498
+ // @ts-ignore
1499
+ options?: ToProtobufJSONOptions
1500
+ ): SipStatus.AsProtobufJSON {
1501
+ return {
1502
+ accountName: this.accountName,
1503
+ timestamp: this.timestamp ? this.timestamp.toProtobufJSON(options) : null,
1504
+ statusType:
1505
+ SipStatus.StatusType[
1506
+ this.statusType === null || this.statusType === undefined
1507
+ ? 0
1508
+ : this.statusType
1509
+ ],
1510
+ calleeId: this.calleeId,
1511
+ transferCallId: this.transferCallId,
1512
+ headers: this.headers
1513
+ ? Object.keys(this.headers).reduce(
1514
+ (r, k) => ({ ...r, [k]: this.headers![k] }),
1515
+ {}
1516
+ )
1517
+ : {},
1518
+ description: this.description,
1519
+ exceptionName: this.exceptionName,
1520
+ exceptionTraceback: this.exceptionTraceback,
1521
+ nluSessionName: this.nluSessionName
1522
+ };
1523
+ }
1524
+ }
1525
+ export module SipStatus {
1526
+ /**
1527
+ * Standard JavaScript object representation for SipStatus
1528
+ */
1529
+ export interface AsObject {
1530
+ accountName: string;
1531
+ timestamp?: googleProtobuf001.Timestamp.AsObject;
1532
+ statusType: SipStatus.StatusType;
1533
+ calleeId: string;
1534
+ transferCallId: string;
1535
+ headers: { [prop: string]: string };
1536
+ description: string;
1537
+ exceptionName: string;
1538
+ exceptionTraceback: string;
1539
+ nluSessionName: string;
1540
+ }
1541
+
1542
+ /**
1543
+ * Protobuf JSON representation for SipStatus
1544
+ */
1545
+ export interface AsProtobufJSON {
1546
+ accountName: string;
1547
+ timestamp: googleProtobuf001.Timestamp.AsProtobufJSON | null;
1548
+ statusType: string;
1549
+ calleeId: string;
1550
+ transferCallId: string;
1551
+ headers: { [prop: string]: string };
1552
+ description: string;
1553
+ exceptionName: string;
1554
+ exceptionTraceback: string;
1555
+ nluSessionName: string;
1556
+ }
1557
+ export enum StatusType {
1558
+ NO_SESSION = 0,
1559
+ REGISTERED = 1,
1560
+ READY = 2,
1561
+ INCOMING_CALL_INITIATED = 3,
1562
+ OUTGOING_CALL_INITIATED = 4,
1563
+ OUTGOING_CALL_CONNECTED = 5,
1564
+ INCOMING_CALL_CONNECTED = 6,
1565
+ TRANSFER_CALL_INITIATED = 7,
1566
+ SOFT_HANGUP_INITIATED = 8,
1567
+ HARD_HANGUP_INITIATED = 9,
1568
+ INCOMING_CALL_FAILED = 10,
1569
+ OUTGOING_CALL_FAILED = 11,
1570
+ INCOMING_CALL_FINISHED = 12,
1571
+ OUTGOING_CALL_FINISHED = 13,
1572
+ SESSION_REGISTRATION_FAILED = 14,
1573
+ SESSION_STARTED = 15,
1574
+ SESSION_ENDED = 16,
1575
+ TRANSFER_CALL_FAILED = 17,
1576
+ MICROPHONE_MUTED = 18,
1577
+ MICROPHONE_UNMUTED = 19,
1578
+ MICROPHONE_WAV_FILES_PLAYED = 20,
1579
+ NO_ONGOING_CALL = 21
1580
+ }
1581
+ /**
1582
+ * Message implementation for ondewo.sip.SipStatus.HeadersEntry
1583
+ */
1584
+ export class HeadersEntry implements GrpcMessage {
1585
+ static id = 'ondewo.sip.SipStatus.HeadersEntry';
1586
+
1587
+ /**
1588
+ * Deserialize binary data to message
1589
+ * @param instance message instance
1590
+ */
1591
+ static deserializeBinary(bytes: ByteSource) {
1592
+ const instance = new HeadersEntry();
1593
+ HeadersEntry.deserializeBinaryFromReader(
1594
+ instance,
1595
+ new BinaryReader(bytes)
1596
+ );
1597
+ return instance;
1598
+ }
1599
+
1600
+ /**
1601
+ * Check all the properties and set default protobuf values if necessary
1602
+ * @param _instance message instance
1603
+ */
1604
+ static refineValues(_instance: HeadersEntry) {
1605
+ _instance.key = _instance.key || '';
1606
+ _instance.value = _instance.value || '';
1607
+ }
1608
+
1609
+ /**
1610
+ * Deserializes / reads binary message into message instance using provided binary reader
1611
+ * @param _instance message instance
1612
+ * @param _reader binary reader instance
1613
+ */
1614
+ static deserializeBinaryFromReader(
1615
+ _instance: HeadersEntry,
1616
+ _reader: BinaryReader
1617
+ ) {
1618
+ while (_reader.nextField()) {
1619
+ if (_reader.isEndGroup()) break;
1620
+
1621
+ switch (_reader.getFieldNumber()) {
1622
+ case 1:
1623
+ _instance.key = _reader.readString();
1624
+ break;
1625
+ case 2:
1626
+ _instance.value = _reader.readString();
1627
+ break;
1628
+ default:
1629
+ _reader.skipField();
1630
+ }
1631
+ }
1632
+
1633
+ HeadersEntry.refineValues(_instance);
1634
+ }
1635
+
1636
+ /**
1637
+ * Serializes a message to binary format using provided binary reader
1638
+ * @param _instance message instance
1639
+ * @param _writer binary writer instance
1640
+ */
1641
+ static serializeBinaryToWriter(
1642
+ _instance: HeadersEntry,
1643
+ _writer: BinaryWriter
1644
+ ) {
1645
+ if (_instance.key) {
1646
+ _writer.writeString(1, _instance.key);
1647
+ }
1648
+ if (_instance.value) {
1649
+ _writer.writeString(2, _instance.value);
1650
+ }
1651
+ }
1652
+
1653
+ private _key: string;
1654
+ private _value: string;
1655
+
1656
+ /**
1657
+ * Message constructor. Initializes the properties and applies default Protobuf values if necessary
1658
+ * @param _value initial values object or instance of HeadersEntry to deeply clone from
1659
+ */
1660
+ constructor(_value?: RecursivePartial<HeadersEntry.AsObject>) {
1661
+ _value = _value || {};
1662
+ this.key = _value.key;
1663
+ this.value = _value.value;
1664
+ HeadersEntry.refineValues(this);
1665
+ }
1666
+ get key(): string {
1667
+ return this._key;
1668
+ }
1669
+ set key(value: string) {
1670
+ this._key = value;
1671
+ }
1672
+ get value(): string {
1673
+ return this._value;
1674
+ }
1675
+ set value(value: string) {
1676
+ this._value = value;
1677
+ }
1678
+
1679
+ /**
1680
+ * Serialize message to binary data
1681
+ * @param instance message instance
1682
+ */
1683
+ serializeBinary() {
1684
+ const writer = new BinaryWriter();
1685
+ HeadersEntry.serializeBinaryToWriter(this, writer);
1686
+ return writer.getResultBuffer();
1687
+ }
1688
+
1689
+ /**
1690
+ * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
1691
+ */
1692
+ toObject(): HeadersEntry.AsObject {
1693
+ return {
1694
+ key: this.key,
1695
+ value: this.value
1696
+ };
1697
+ }
1698
+
1699
+ /**
1700
+ * Convenience method to support JSON.stringify(message), replicates the structure of toObject()
1701
+ */
1702
+ toJSON() {
1703
+ return this.toObject();
1704
+ }
1705
+
1706
+ /**
1707
+ * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
1708
+ * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
1709
+ * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
1710
+ */
1711
+ toProtobufJSON(
1712
+ // @ts-ignore
1713
+ options?: ToProtobufJSONOptions
1714
+ ): HeadersEntry.AsProtobufJSON {
1715
+ return {
1716
+ key: this.key,
1717
+ value: this.value
1718
+ };
1719
+ }
1720
+ }
1721
+ export module HeadersEntry {
1722
+ /**
1723
+ * Standard JavaScript object representation for HeadersEntry
1724
+ */
1725
+ export interface AsObject {
1726
+ key: string;
1727
+ value: string;
1728
+ }
1729
+
1730
+ /**
1731
+ * Protobuf JSON representation for HeadersEntry
1732
+ */
1733
+ export interface AsProtobufJSON {
1734
+ key: string;
1735
+ value: string;
1736
+ }
1737
+ }
1738
+ }
1739
+
1740
+ /**
1741
+ * Message implementation for ondewo.sip.SipStatusHistoryResponse
1742
+ */
1743
+ export class SipStatusHistoryResponse implements GrpcMessage {
1744
+ static id = 'ondewo.sip.SipStatusHistoryResponse';
1745
+
1746
+ /**
1747
+ * Deserialize binary data to message
1748
+ * @param instance message instance
1749
+ */
1750
+ static deserializeBinary(bytes: ByteSource) {
1751
+ const instance = new SipStatusHistoryResponse();
1752
+ SipStatusHistoryResponse.deserializeBinaryFromReader(
1753
+ instance,
1754
+ new BinaryReader(bytes)
1755
+ );
1756
+ return instance;
1757
+ }
1758
+
1759
+ /**
1760
+ * Check all the properties and set default protobuf values if necessary
1761
+ * @param _instance message instance
1762
+ */
1763
+ static refineValues(_instance: SipStatusHistoryResponse) {
1764
+ _instance.statusHistory = _instance.statusHistory || [];
1765
+ }
1766
+
1767
+ /**
1768
+ * Deserializes / reads binary message into message instance using provided binary reader
1769
+ * @param _instance message instance
1770
+ * @param _reader binary reader instance
1771
+ */
1772
+ static deserializeBinaryFromReader(
1773
+ _instance: SipStatusHistoryResponse,
1774
+ _reader: BinaryReader
1775
+ ) {
1776
+ while (_reader.nextField()) {
1777
+ if (_reader.isEndGroup()) break;
1778
+
1779
+ switch (_reader.getFieldNumber()) {
1780
+ case 1:
1781
+ const messageInitializer1 = new SipStatus();
1782
+ _reader.readMessage(
1783
+ messageInitializer1,
1784
+ SipStatus.deserializeBinaryFromReader
1785
+ );
1786
+ (_instance.statusHistory = _instance.statusHistory || []).push(
1787
+ messageInitializer1
1788
+ );
1789
+ break;
1790
+ default:
1791
+ _reader.skipField();
1792
+ }
1793
+ }
1794
+
1795
+ SipStatusHistoryResponse.refineValues(_instance);
1796
+ }
1797
+
1798
+ /**
1799
+ * Serializes a message to binary format using provided binary reader
1800
+ * @param _instance message instance
1801
+ * @param _writer binary writer instance
1802
+ */
1803
+ static serializeBinaryToWriter(
1804
+ _instance: SipStatusHistoryResponse,
1805
+ _writer: BinaryWriter
1806
+ ) {
1807
+ if (_instance.statusHistory && _instance.statusHistory.length) {
1808
+ _writer.writeRepeatedMessage(
1809
+ 1,
1810
+ _instance.statusHistory as any,
1811
+ SipStatus.serializeBinaryToWriter
1812
+ );
1813
+ }
1814
+ }
1815
+
1816
+ private _statusHistory?: SipStatus[];
1817
+
1818
+ /**
1819
+ * Message constructor. Initializes the properties and applies default Protobuf values if necessary
1820
+ * @param _value initial values object or instance of SipStatusHistoryResponse to deeply clone from
1821
+ */
1822
+ constructor(_value?: RecursivePartial<SipStatusHistoryResponse.AsObject>) {
1823
+ _value = _value || {};
1824
+ this.statusHistory = (_value.statusHistory || []).map(
1825
+ m => new SipStatus(m)
1826
+ );
1827
+ SipStatusHistoryResponse.refineValues(this);
1828
+ }
1829
+ get statusHistory(): SipStatus[] | undefined {
1830
+ return this._statusHistory;
1831
+ }
1832
+ set statusHistory(value: SipStatus[] | undefined) {
1833
+ this._statusHistory = value;
1834
+ }
1835
+
1836
+ /**
1837
+ * Serialize message to binary data
1838
+ * @param instance message instance
1839
+ */
1840
+ serializeBinary() {
1841
+ const writer = new BinaryWriter();
1842
+ SipStatusHistoryResponse.serializeBinaryToWriter(this, writer);
1843
+ return writer.getResultBuffer();
1844
+ }
1845
+
1846
+ /**
1847
+ * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
1848
+ */
1849
+ toObject(): SipStatusHistoryResponse.AsObject {
1850
+ return {
1851
+ statusHistory: (this.statusHistory || []).map(m => m.toObject())
1852
+ };
1853
+ }
1854
+
1855
+ /**
1856
+ * Convenience method to support JSON.stringify(message), replicates the structure of toObject()
1857
+ */
1858
+ toJSON() {
1859
+ return this.toObject();
1860
+ }
1861
+
1862
+ /**
1863
+ * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
1864
+ * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
1865
+ * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
1866
+ */
1867
+ toProtobufJSON(
1868
+ // @ts-ignore
1869
+ options?: ToProtobufJSONOptions
1870
+ ): SipStatusHistoryResponse.AsProtobufJSON {
1871
+ return {
1872
+ statusHistory: (this.statusHistory || []).map(m =>
1873
+ m.toProtobufJSON(options)
1874
+ )
1875
+ };
1876
+ }
1877
+ }
1878
+ export module SipStatusHistoryResponse {
1879
+ /**
1880
+ * Standard JavaScript object representation for SipStatusHistoryResponse
1881
+ */
1882
+ export interface AsObject {
1883
+ statusHistory?: SipStatus.AsObject[];
1884
+ }
1885
+
1886
+ /**
1887
+ * Protobuf JSON representation for SipStatusHistoryResponse
1888
+ */
1889
+ export interface AsProtobufJSON {
1890
+ statusHistory: SipStatus.AsProtobufJSON[] | null;
1891
+ }
1892
+ }
1893
+
1894
+ /**
1895
+ * Message implementation for ondewo.sip.SipPlayWavFilesRequest
1896
+ */
1897
+ export class SipPlayWavFilesRequest implements GrpcMessage {
1898
+ static id = 'ondewo.sip.SipPlayWavFilesRequest';
1899
+
1900
+ /**
1901
+ * Deserialize binary data to message
1902
+ * @param instance message instance
1903
+ */
1904
+ static deserializeBinary(bytes: ByteSource) {
1905
+ const instance = new SipPlayWavFilesRequest();
1906
+ SipPlayWavFilesRequest.deserializeBinaryFromReader(
1907
+ instance,
1908
+ new BinaryReader(bytes)
1909
+ );
1910
+ return instance;
1911
+ }
1912
+
1913
+ /**
1914
+ * Check all the properties and set default protobuf values if necessary
1915
+ * @param _instance message instance
1916
+ */
1917
+ static refineValues(_instance: SipPlayWavFilesRequest) {
1918
+ _instance.wavFiles = _instance.wavFiles || [];
1919
+ }
1920
+
1921
+ /**
1922
+ * Deserializes / reads binary message into message instance using provided binary reader
1923
+ * @param _instance message instance
1924
+ * @param _reader binary reader instance
1925
+ */
1926
+ static deserializeBinaryFromReader(
1927
+ _instance: SipPlayWavFilesRequest,
1928
+ _reader: BinaryReader
1929
+ ) {
1930
+ while (_reader.nextField()) {
1931
+ if (_reader.isEndGroup()) break;
1932
+
1933
+ switch (_reader.getFieldNumber()) {
1934
+ case 1:
1935
+ (_instance.wavFiles = _instance.wavFiles || []).push(
1936
+ _reader.readBytes()
1937
+ );
1938
+ break;
1939
+ default:
1940
+ _reader.skipField();
1941
+ }
1942
+ }
1943
+
1944
+ SipPlayWavFilesRequest.refineValues(_instance);
1945
+ }
1946
+
1947
+ /**
1948
+ * Serializes a message to binary format using provided binary reader
1949
+ * @param _instance message instance
1950
+ * @param _writer binary writer instance
1951
+ */
1952
+ static serializeBinaryToWriter(
1953
+ _instance: SipPlayWavFilesRequest,
1954
+ _writer: BinaryWriter
1955
+ ) {
1956
+ if (_instance.wavFiles && _instance.wavFiles.length) {
1957
+ _writer.writeRepeatedBytes(1, _instance.wavFiles);
1958
+ }
1959
+ }
1960
+
1961
+ private _wavFiles: Uint8Array[];
1962
+
1963
+ /**
1964
+ * Message constructor. Initializes the properties and applies default Protobuf values if necessary
1965
+ * @param _value initial values object or instance of SipPlayWavFilesRequest to deeply clone from
1966
+ */
1967
+ constructor(_value?: RecursivePartial<SipPlayWavFilesRequest.AsObject>) {
1968
+ _value = _value || {};
1969
+ this.wavFiles = (_value.wavFiles || []).map(b =>
1970
+ b ? b.subarray(0) : new Uint8Array()
1971
+ );
1972
+ SipPlayWavFilesRequest.refineValues(this);
1973
+ }
1974
+ get wavFiles(): Uint8Array[] {
1975
+ return this._wavFiles;
1976
+ }
1977
+ set wavFiles(value: Uint8Array[]) {
1978
+ this._wavFiles = value;
1979
+ }
1980
+
1981
+ /**
1982
+ * Serialize message to binary data
1983
+ * @param instance message instance
1984
+ */
1985
+ serializeBinary() {
1986
+ const writer = new BinaryWriter();
1987
+ SipPlayWavFilesRequest.serializeBinaryToWriter(this, writer);
1988
+ return writer.getResultBuffer();
1989
+ }
1990
+
1991
+ /**
1992
+ * Cast message to standard JavaScript object (all non-primitive values are deeply cloned)
1993
+ */
1994
+ toObject(): SipPlayWavFilesRequest.AsObject {
1995
+ return {
1996
+ wavFiles: (this.wavFiles || []).map(b =>
1997
+ b ? b.subarray(0) : new Uint8Array()
1998
+ )
1999
+ };
2000
+ }
2001
+
2002
+ /**
2003
+ * Convenience method to support JSON.stringify(message), replicates the structure of toObject()
2004
+ */
2005
+ toJSON() {
2006
+ return this.toObject();
2007
+ }
2008
+
2009
+ /**
2010
+ * Cast message to JSON using protobuf JSON notation: https://developers.google.com/protocol-buffers/docs/proto3#json
2011
+ * Attention: output differs from toObject() e.g. enums are represented as names and not as numbers, Timestamp is an ISO Date string format etc.
2012
+ * If the message itself or some of descendant messages is google.protobuf.Any, you MUST provide a message pool as options. If not, the messagePool is not required
2013
+ */
2014
+ toProtobufJSON(
2015
+ // @ts-ignore
2016
+ options?: ToProtobufJSONOptions
2017
+ ): SipPlayWavFilesRequest.AsProtobufJSON {
2018
+ return {
2019
+ wavFiles: (this.wavFiles || []).map(b => (b ? uint8ArrayToBase64(b) : ''))
2020
+ };
2021
+ }
2022
+ }
2023
+ export module SipPlayWavFilesRequest {
2024
+ /**
2025
+ * Standard JavaScript object representation for SipPlayWavFilesRequest
2026
+ */
2027
+ export interface AsObject {
2028
+ wavFiles: Uint8Array[];
2029
+ }
2030
+
2031
+ /**
2032
+ * Protobuf JSON representation for SipPlayWavFilesRequest
2033
+ */
2034
+ export interface AsProtobufJSON {
2035
+ wavFiles: string[];
2036
+ }
2037
+ }