@wazo/sdk 0.37.33 → 0.37.36

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.
Files changed (98) hide show
  1. package/README.md +1 -0
  2. package/dist/wazo-sdk.js +2 -2
  3. package/esm/__tests__/api-client.test.js +17 -0
  4. package/esm/__tests__/web-rtc-client.test.js +18 -1
  5. package/esm/api/auth.js +5 -0
  6. package/esm/api/call-logd.js +6 -0
  7. package/esm/api/chatd.js +6 -0
  8. package/esm/api/confd.js +6 -0
  9. package/esm/api-client.js +17 -0
  10. package/esm/checker/Checker.js +18 -1
  11. package/esm/checker/checks/aor.js +17 -0
  12. package/esm/checker/checks/api.js +17 -0
  13. package/esm/checker/checks/index.js +18 -1
  14. package/esm/checker/checks/webrtc-transport.js +18 -1
  15. package/esm/checker/checks/webrtc.js +18 -1
  16. package/esm/domain/AdHocAPIConference.js +21 -0
  17. package/esm/domain/CallLog.js +6 -0
  18. package/esm/domain/CallSession.js +14 -0
  19. package/esm/domain/Features.js +17 -0
  20. package/esm/domain/Phone/CTIPhone.js +31 -0
  21. package/esm/domain/Phone/WebRTCPhone.js +65 -15
  22. package/esm/domain/Profile.js +6 -0
  23. package/esm/domain/__tests__/CallLog.test.js +10 -0
  24. package/esm/domain/__tests__/CallSession.test.js +14 -0
  25. package/esm/domain/__tests__/IndirectTransfer.test.js +14 -0
  26. package/esm/domain/__tests__/Profile.test.js +6 -0
  27. package/esm/domain/__tests__/Room.test.js +14 -0
  28. package/esm/domain/__tests__/Session.test.js +6 -0
  29. package/esm/index.js +93 -22
  30. package/esm/service/CallApi.js +17 -0
  31. package/esm/service/getApiClient.js +17 -0
  32. package/esm/simple/Auth.js +93 -22
  33. package/esm/simple/Configuration.js +93 -22
  34. package/esm/simple/Directory.js +17 -0
  35. package/esm/simple/Phone.js +93 -22
  36. package/esm/simple/index.js +93 -22
  37. package/esm/simple/room/LocalParticipant.js +93 -22
  38. package/esm/simple/room/Participant.js +93 -22
  39. package/esm/simple/room/RemoteParticipant.js +93 -22
  40. package/esm/simple/room/Room.js +93 -22
  41. package/esm/simple/room/SipRoom.js +93 -22
  42. package/esm/simple/room/Stream.js +93 -22
  43. package/esm/simple/room/__tests__/RemoteParticipant.test.js +93 -22
  44. package/esm/simple/utils.js +93 -22
  45. package/esm/web-rtc-client.js +18 -1
  46. package/lib/__tests__/api-client.test.js +17 -0
  47. package/lib/__tests__/web-rtc-client.test.js +18 -1
  48. package/lib/api/auth.js +5 -0
  49. package/lib/api/call-logd.js +6 -0
  50. package/lib/api/chatd.js +6 -0
  51. package/lib/api/confd.js +6 -0
  52. package/lib/api-client.js +17 -0
  53. package/lib/checker/Checker.js +18 -1
  54. package/lib/checker/checks/aor.js +17 -0
  55. package/lib/checker/checks/api.js +17 -0
  56. package/lib/checker/checks/index.js +18 -1
  57. package/lib/checker/checks/webrtc-transport.js +18 -1
  58. package/lib/checker/checks/webrtc.js +18 -1
  59. package/lib/domain/AdHocAPIConference.js +21 -0
  60. package/lib/domain/CallLog.js +6 -0
  61. package/lib/domain/CallSession.js +14 -0
  62. package/lib/domain/Features.js +17 -0
  63. package/lib/domain/Phone/CTIPhone.js +31 -0
  64. package/lib/domain/Phone/WebRTCPhone.js +65 -15
  65. package/lib/domain/Profile.js +6 -0
  66. package/lib/domain/__tests__/CallLog.test.js +10 -0
  67. package/lib/domain/__tests__/CallSession.test.js +14 -0
  68. package/lib/domain/__tests__/IndirectTransfer.test.js +14 -0
  69. package/lib/domain/__tests__/Profile.test.js +6 -0
  70. package/lib/domain/__tests__/Room.test.js +14 -0
  71. package/lib/domain/__tests__/Session.test.js +6 -0
  72. package/lib/index.js +93 -22
  73. package/lib/service/CallApi.js +17 -0
  74. package/lib/service/getApiClient.js +17 -0
  75. package/lib/simple/Auth.js +93 -22
  76. package/lib/simple/Configuration.js +93 -22
  77. package/lib/simple/Directory.js +17 -0
  78. package/lib/simple/Phone.js +93 -22
  79. package/lib/simple/index.js +93 -22
  80. package/lib/simple/room/LocalParticipant.js +93 -22
  81. package/lib/simple/room/Participant.js +93 -22
  82. package/lib/simple/room/RemoteParticipant.js +93 -22
  83. package/lib/simple/room/Room.js +93 -22
  84. package/lib/simple/room/SipRoom.js +93 -22
  85. package/lib/simple/room/Stream.js +93 -22
  86. package/lib/simple/room/__tests__/RemoteParticipant.test.js +93 -22
  87. package/lib/simple/utils.js +93 -22
  88. package/lib/web-rtc-client.js +18 -1
  89. package/package.json +1 -1
  90. package/src/api/auth.js +5 -0
  91. package/src/domain/AdHocAPIConference.js +4 -0
  92. package/src/domain/CallLog.js +6 -0
  93. package/src/domain/CallSession.js +14 -0
  94. package/src/domain/Phone/WebRTCPhone.js +51 -15
  95. package/src/domain/Profile.js +6 -0
  96. package/src/domain/__tests__/CallLog.test.js +4 -0
  97. package/src/simple/Phone.js +6 -6
  98. package/src/web-rtc-client.js +1 -1
package/lib/api/auth.js CHANGED
@@ -968,6 +968,7 @@ var auth = (client , baseUrl ) => ({
968
968
 
969
969
 
970
970
 
971
+
971
972
  ) {
972
973
  const body = {
973
974
  backend: params.backend || DEFAULT_BACKEND_USER,
@@ -987,6 +988,10 @@ var auth = (client , baseUrl ) => ({
987
988
  headers['Wazo-Session-Type'] = 'mobile';
988
989
  }
989
990
 
991
+ if (params.tenantId) {
992
+ body.tenant_id = params.tenantId;
993
+ }
994
+
990
995
  return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
991
996
  },
992
997
 
@@ -483,11 +483,13 @@ class Recording {
483
483
 
484
484
 
485
485
 
486
+
486
487
 
487
488
 
488
489
 
489
490
 
490
491
 
492
+
491
493
 
492
494
 
493
495
 
@@ -508,10 +510,12 @@ class Recording {
508
510
 
509
511
 
510
512
 
513
+
511
514
 
512
515
 
513
516
 
514
517
 
518
+
515
519
 
516
520
 
517
521
 
@@ -573,10 +577,12 @@ class CallLog {
573
577
  || plain.destination_extension
574
578
  || `meeting-${plain.requested_name || plain.destination_name || ''}`,
575
579
  name: plain.requested_name || plain.destination_name || '',
580
+ uuid: plain.destination_user_uuid,
576
581
  },
577
582
  source: {
578
583
  extension: plain.source_extension,
579
584
  name: plain.source_name,
585
+ uuid: plain.source_user_uuid,
580
586
  },
581
587
  id: plain.id,
582
588
  duration: (plain.duration || 0) * 1000, // duration is in seconds
package/lib/api/chatd.js CHANGED
@@ -887,6 +887,7 @@ const LINE_STATE = {
887
887
 
888
888
 
889
889
 
890
+
890
891
 
891
892
 
892
893
 
@@ -923,6 +924,7 @@ const LINE_STATE = {
923
924
 
924
925
 
925
926
 
927
+
926
928
 
927
929
 
928
930
 
@@ -954,6 +956,7 @@ class Profile {
954
956
 
955
957
 
956
958
 
959
+
957
960
 
958
961
 
959
962
 
@@ -970,6 +973,7 @@ class Profile {
970
973
  lines: plain.lines.map(line => Line.parse(line)),
971
974
  username: plain.username,
972
975
  mobileNumber: plain.mobile_phone_number || '',
976
+ ringSeconds: plain.ring_seconds,
973
977
  forwards: [
974
978
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
975
979
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -1006,6 +1010,7 @@ class Profile {
1006
1010
  switchboards,
1007
1011
  agent,
1008
1012
  status,
1013
+ ringSeconds,
1009
1014
  sipLines,
1010
1015
  callPickupTargetUsers,
1011
1016
  onlineCallRecordEnabled,
@@ -1027,6 +1032,7 @@ class Profile {
1027
1032
  this.status = status;
1028
1033
  this.callPickupTargetUsers = callPickupTargetUsers;
1029
1034
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
1035
+ this.ringSeconds = ringSeconds;
1030
1036
 
1031
1037
  this.sipLines = sipLines || [];
1032
1038
  }
package/lib/api/confd.js CHANGED
@@ -1034,6 +1034,7 @@ const LINE_STATE = {
1034
1034
 
1035
1035
 
1036
1036
 
1037
+
1037
1038
 
1038
1039
 
1039
1040
 
@@ -1070,6 +1071,7 @@ const LINE_STATE = {
1070
1071
 
1071
1072
 
1072
1073
 
1074
+
1073
1075
 
1074
1076
 
1075
1077
 
@@ -1101,6 +1103,7 @@ class Profile {
1101
1103
 
1102
1104
 
1103
1105
 
1106
+
1104
1107
 
1105
1108
 
1106
1109
 
@@ -1117,6 +1120,7 @@ class Profile {
1117
1120
  lines: plain.lines.map(line => Line.parse(line)),
1118
1121
  username: plain.username,
1119
1122
  mobileNumber: plain.mobile_phone_number || '',
1123
+ ringSeconds: plain.ring_seconds,
1120
1124
  forwards: [
1121
1125
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
1122
1126
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -1153,6 +1157,7 @@ class Profile {
1153
1157
  switchboards,
1154
1158
  agent,
1155
1159
  status,
1160
+ ringSeconds,
1156
1161
  sipLines,
1157
1162
  callPickupTargetUsers,
1158
1163
  onlineCallRecordEnabled,
@@ -1174,6 +1179,7 @@ class Profile {
1174
1179
  this.status = status;
1175
1180
  this.callPickupTargetUsers = callPickupTargetUsers;
1176
1181
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
1182
+ this.ringSeconds = ringSeconds;
1177
1183
 
1178
1184
  this.sipLines = sipLines || [];
1179
1185
  }
package/lib/api-client.js CHANGED
@@ -1058,6 +1058,7 @@ const LINE_STATE = {
1058
1058
 
1059
1059
 
1060
1060
 
1061
+
1061
1062
 
1062
1063
 
1063
1064
 
@@ -1094,6 +1095,7 @@ const LINE_STATE = {
1094
1095
 
1095
1096
 
1096
1097
 
1098
+
1097
1099
 
1098
1100
 
1099
1101
 
@@ -1125,6 +1127,7 @@ class Profile {
1125
1127
 
1126
1128
 
1127
1129
 
1130
+
1128
1131
 
1129
1132
 
1130
1133
 
@@ -1141,6 +1144,7 @@ class Profile {
1141
1144
  lines: plain.lines.map(line => Line.parse(line)),
1142
1145
  username: plain.username,
1143
1146
  mobileNumber: plain.mobile_phone_number || '',
1147
+ ringSeconds: plain.ring_seconds,
1144
1148
  forwards: [
1145
1149
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
1146
1150
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -1177,6 +1181,7 @@ class Profile {
1177
1181
  switchboards,
1178
1182
  agent,
1179
1183
  status,
1184
+ ringSeconds,
1180
1185
  sipLines,
1181
1186
  callPickupTargetUsers,
1182
1187
  onlineCallRecordEnabled,
@@ -1198,6 +1203,7 @@ class Profile {
1198
1203
  this.status = status;
1199
1204
  this.callPickupTargetUsers = callPickupTargetUsers;
1200
1205
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
1206
+ this.ringSeconds = ringSeconds;
1201
1207
 
1202
1208
  this.sipLines = sipLines || [];
1203
1209
  }
@@ -2203,6 +2209,7 @@ var authMethods = (client , baseUrl ) => ({
2203
2209
 
2204
2210
 
2205
2211
 
2212
+
2206
2213
  ) {
2207
2214
  const body = {
2208
2215
  backend: params.backend || DEFAULT_BACKEND_USER,
@@ -2222,6 +2229,10 @@ var authMethods = (client , baseUrl ) => ({
2222
2229
  headers['Wazo-Session-Type'] = 'mobile';
2223
2230
  }
2224
2231
 
2232
+ if (params.tenantId) {
2233
+ body.tenant_id = params.tenantId;
2234
+ }
2235
+
2225
2236
  return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
2226
2237
  },
2227
2238
 
@@ -3290,11 +3301,13 @@ class Recording {
3290
3301
 
3291
3302
 
3292
3303
 
3304
+
3293
3305
 
3294
3306
 
3295
3307
 
3296
3308
 
3297
3309
 
3310
+
3298
3311
 
3299
3312
 
3300
3313
 
@@ -3315,10 +3328,12 @@ class Recording {
3315
3328
 
3316
3329
 
3317
3330
 
3331
+
3318
3332
 
3319
3333
 
3320
3334
 
3321
3335
 
3336
+
3322
3337
 
3323
3338
 
3324
3339
 
@@ -3380,10 +3395,12 @@ class CallLog {
3380
3395
  || plain.destination_extension
3381
3396
  || `meeting-${plain.requested_name || plain.destination_name || ''}`,
3382
3397
  name: plain.requested_name || plain.destination_name || '',
3398
+ uuid: plain.destination_user_uuid,
3383
3399
  },
3384
3400
  source: {
3385
3401
  extension: plain.source_extension,
3386
3402
  name: plain.source_name,
3403
+ uuid: plain.source_user_uuid,
3387
3404
  },
3388
3405
  id: plain.id,
3389
3406
  duration: (plain.duration || 0) * 1000, // duration is in seconds
@@ -1080,6 +1080,7 @@ const LINE_STATE = {
1080
1080
 
1081
1081
 
1082
1082
 
1083
+
1083
1084
 
1084
1085
 
1085
1086
 
@@ -1116,6 +1117,7 @@ const LINE_STATE = {
1116
1117
 
1117
1118
 
1118
1119
 
1120
+
1119
1121
 
1120
1122
 
1121
1123
 
@@ -1147,6 +1149,7 @@ class Profile {
1147
1149
 
1148
1150
 
1149
1151
 
1152
+
1150
1153
 
1151
1154
 
1152
1155
 
@@ -1163,6 +1166,7 @@ class Profile {
1163
1166
  lines: plain.lines.map(line => Line.parse(line)),
1164
1167
  username: plain.username,
1165
1168
  mobileNumber: plain.mobile_phone_number || '',
1169
+ ringSeconds: plain.ring_seconds,
1166
1170
  forwards: [
1167
1171
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
1168
1172
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -1199,6 +1203,7 @@ class Profile {
1199
1203
  switchboards,
1200
1204
  agent,
1201
1205
  status,
1206
+ ringSeconds,
1202
1207
  sipLines,
1203
1208
  callPickupTargetUsers,
1204
1209
  onlineCallRecordEnabled,
@@ -1220,6 +1225,7 @@ class Profile {
1220
1225
  this.status = status;
1221
1226
  this.callPickupTargetUsers = callPickupTargetUsers;
1222
1227
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
1228
+ this.ringSeconds = ringSeconds;
1223
1229
 
1224
1230
  this.sipLines = sipLines || [];
1225
1231
  }
@@ -2225,6 +2231,7 @@ var authMethods = (client , baseUrl ) => ({
2225
2231
 
2226
2232
 
2227
2233
 
2234
+
2228
2235
  ) {
2229
2236
  const body = {
2230
2237
  backend: params.backend || DEFAULT_BACKEND_USER,
@@ -2244,6 +2251,10 @@ var authMethods = (client , baseUrl ) => ({
2244
2251
  headers['Wazo-Session-Type'] = 'mobile';
2245
2252
  }
2246
2253
 
2254
+ if (params.tenantId) {
2255
+ body.tenant_id = params.tenantId;
2256
+ }
2257
+
2247
2258
  return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
2248
2259
  },
2249
2260
 
@@ -3338,11 +3349,13 @@ class Recording {
3338
3349
 
3339
3350
 
3340
3351
 
3352
+
3341
3353
 
3342
3354
 
3343
3355
 
3344
3356
 
3345
3357
 
3358
+
3346
3359
 
3347
3360
 
3348
3361
 
@@ -3363,10 +3376,12 @@ class Recording {
3363
3376
 
3364
3377
 
3365
3378
 
3379
+
3366
3380
 
3367
3381
 
3368
3382
 
3369
3383
 
3384
+
3370
3385
 
3371
3386
 
3372
3387
 
@@ -3428,10 +3443,12 @@ class CallLog {
3428
3443
  || plain.destination_extension
3429
3444
  || `meeting-${plain.requested_name || plain.destination_name || ''}`,
3430
3445
  name: plain.requested_name || plain.destination_name || '',
3446
+ uuid: plain.destination_user_uuid,
3431
3447
  },
3432
3448
  source: {
3433
3449
  extension: plain.source_extension,
3434
3450
  name: plain.source_name,
3451
+ uuid: plain.source_user_uuid,
3435
3452
  },
3436
3453
  id: plain.id,
3437
3454
  duration: (plain.duration || 0) * 1000, // duration is in seconds
@@ -5957,7 +5974,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
5957
5974
  const ON_DISCONNECTED = 'onDisconnected';
5958
5975
  class CanceledCallError extends Error {}
5959
5976
 
5960
- const MAX_REGISTER_TRIES = 10;
5977
+ const MAX_REGISTER_TRIES = 5;
5961
5978
 
5962
5979
 
5963
5980
 
@@ -1058,6 +1058,7 @@ const LINE_STATE = {
1058
1058
 
1059
1059
 
1060
1060
 
1061
+
1061
1062
 
1062
1063
 
1063
1064
 
@@ -1094,6 +1095,7 @@ const LINE_STATE = {
1094
1095
 
1095
1096
 
1096
1097
 
1098
+
1097
1099
 
1098
1100
 
1099
1101
 
@@ -1125,6 +1127,7 @@ class Profile {
1125
1127
 
1126
1128
 
1127
1129
 
1130
+
1128
1131
 
1129
1132
 
1130
1133
 
@@ -1141,6 +1144,7 @@ class Profile {
1141
1144
  lines: plain.lines.map(line => Line.parse(line)),
1142
1145
  username: plain.username,
1143
1146
  mobileNumber: plain.mobile_phone_number || '',
1147
+ ringSeconds: plain.ring_seconds,
1144
1148
  forwards: [
1145
1149
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
1146
1150
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -1177,6 +1181,7 @@ class Profile {
1177
1181
  switchboards,
1178
1182
  agent,
1179
1183
  status,
1184
+ ringSeconds,
1180
1185
  sipLines,
1181
1186
  callPickupTargetUsers,
1182
1187
  onlineCallRecordEnabled,
@@ -1198,6 +1203,7 @@ class Profile {
1198
1203
  this.status = status;
1199
1204
  this.callPickupTargetUsers = callPickupTargetUsers;
1200
1205
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
1206
+ this.ringSeconds = ringSeconds;
1201
1207
 
1202
1208
  this.sipLines = sipLines || [];
1203
1209
  }
@@ -2203,6 +2209,7 @@ var authMethods = (client , baseUrl ) => ({
2203
2209
 
2204
2210
 
2205
2211
 
2212
+
2206
2213
  ) {
2207
2214
  const body = {
2208
2215
  backend: params.backend || DEFAULT_BACKEND_USER,
@@ -2222,6 +2229,10 @@ var authMethods = (client , baseUrl ) => ({
2222
2229
  headers['Wazo-Session-Type'] = 'mobile';
2223
2230
  }
2224
2231
 
2232
+ if (params.tenantId) {
2233
+ body.tenant_id = params.tenantId;
2234
+ }
2235
+
2225
2236
  return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
2226
2237
  },
2227
2238
 
@@ -3290,11 +3301,13 @@ class Recording {
3290
3301
 
3291
3302
 
3292
3303
 
3304
+
3293
3305
 
3294
3306
 
3295
3307
 
3296
3308
 
3297
3309
 
3310
+
3298
3311
 
3299
3312
 
3300
3313
 
@@ -3315,10 +3328,12 @@ class Recording {
3315
3328
 
3316
3329
 
3317
3330
 
3331
+
3318
3332
 
3319
3333
 
3320
3334
 
3321
3335
 
3336
+
3322
3337
 
3323
3338
 
3324
3339
 
@@ -3380,10 +3395,12 @@ class CallLog {
3380
3395
  || plain.destination_extension
3381
3396
  || `meeting-${plain.requested_name || plain.destination_name || ''}`,
3382
3397
  name: plain.requested_name || plain.destination_name || '',
3398
+ uuid: plain.destination_user_uuid,
3383
3399
  },
3384
3400
  source: {
3385
3401
  extension: plain.source_extension,
3386
3402
  name: plain.source_name,
3403
+ uuid: plain.source_user_uuid,
3387
3404
  },
3388
3405
  id: plain.id,
3389
3406
  duration: (plain.duration || 0) * 1000, // duration is in seconds
@@ -1058,6 +1058,7 @@ const LINE_STATE = {
1058
1058
 
1059
1059
 
1060
1060
 
1061
+
1061
1062
 
1062
1063
 
1063
1064
 
@@ -1094,6 +1095,7 @@ const LINE_STATE = {
1094
1095
 
1095
1096
 
1096
1097
 
1098
+
1097
1099
 
1098
1100
 
1099
1101
 
@@ -1125,6 +1127,7 @@ class Profile {
1125
1127
 
1126
1128
 
1127
1129
 
1130
+
1128
1131
 
1129
1132
 
1130
1133
 
@@ -1141,6 +1144,7 @@ class Profile {
1141
1144
  lines: plain.lines.map(line => Line.parse(line)),
1142
1145
  username: plain.username,
1143
1146
  mobileNumber: plain.mobile_phone_number || '',
1147
+ ringSeconds: plain.ring_seconds,
1144
1148
  forwards: [
1145
1149
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
1146
1150
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -1177,6 +1181,7 @@ class Profile {
1177
1181
  switchboards,
1178
1182
  agent,
1179
1183
  status,
1184
+ ringSeconds,
1180
1185
  sipLines,
1181
1186
  callPickupTargetUsers,
1182
1187
  onlineCallRecordEnabled,
@@ -1198,6 +1203,7 @@ class Profile {
1198
1203
  this.status = status;
1199
1204
  this.callPickupTargetUsers = callPickupTargetUsers;
1200
1205
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
1206
+ this.ringSeconds = ringSeconds;
1201
1207
 
1202
1208
  this.sipLines = sipLines || [];
1203
1209
  }
@@ -2203,6 +2209,7 @@ var authMethods = (client , baseUrl ) => ({
2203
2209
 
2204
2210
 
2205
2211
 
2212
+
2206
2213
  ) {
2207
2214
  const body = {
2208
2215
  backend: params.backend || DEFAULT_BACKEND_USER,
@@ -2222,6 +2229,10 @@ var authMethods = (client , baseUrl ) => ({
2222
2229
  headers['Wazo-Session-Type'] = 'mobile';
2223
2230
  }
2224
2231
 
2232
+ if (params.tenantId) {
2233
+ body.tenant_id = params.tenantId;
2234
+ }
2235
+
2225
2236
  return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
2226
2237
  },
2227
2238
 
@@ -3290,11 +3301,13 @@ class Recording {
3290
3301
 
3291
3302
 
3292
3303
 
3304
+
3293
3305
 
3294
3306
 
3295
3307
 
3296
3308
 
3297
3309
 
3310
+
3298
3311
 
3299
3312
 
3300
3313
 
@@ -3315,10 +3328,12 @@ class Recording {
3315
3328
 
3316
3329
 
3317
3330
 
3331
+
3318
3332
 
3319
3333
 
3320
3334
 
3321
3335
 
3336
+
3322
3337
 
3323
3338
 
3324
3339
 
@@ -3380,10 +3395,12 @@ class CallLog {
3380
3395
  || plain.destination_extension
3381
3396
  || `meeting-${plain.requested_name || plain.destination_name || ''}`,
3382
3397
  name: plain.requested_name || plain.destination_name || '',
3398
+ uuid: plain.destination_user_uuid,
3383
3399
  },
3384
3400
  source: {
3385
3401
  extension: plain.source_extension,
3386
3402
  name: plain.source_name,
3403
+ uuid: plain.source_user_uuid,
3387
3404
  },
3388
3405
  id: plain.id,
3389
3406
  duration: (plain.duration || 0) * 1000, // duration is in seconds
@@ -1080,6 +1080,7 @@ const LINE_STATE = {
1080
1080
 
1081
1081
 
1082
1082
 
1083
+
1083
1084
 
1084
1085
 
1085
1086
 
@@ -1116,6 +1117,7 @@ const LINE_STATE = {
1116
1117
 
1117
1118
 
1118
1119
 
1120
+
1119
1121
 
1120
1122
 
1121
1123
 
@@ -1147,6 +1149,7 @@ class Profile {
1147
1149
 
1148
1150
 
1149
1151
 
1152
+
1150
1153
 
1151
1154
 
1152
1155
 
@@ -1163,6 +1166,7 @@ class Profile {
1163
1166
  lines: plain.lines.map(line => Line.parse(line)),
1164
1167
  username: plain.username,
1165
1168
  mobileNumber: plain.mobile_phone_number || '',
1169
+ ringSeconds: plain.ring_seconds,
1166
1170
  forwards: [
1167
1171
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
1168
1172
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -1199,6 +1203,7 @@ class Profile {
1199
1203
  switchboards,
1200
1204
  agent,
1201
1205
  status,
1206
+ ringSeconds,
1202
1207
  sipLines,
1203
1208
  callPickupTargetUsers,
1204
1209
  onlineCallRecordEnabled,
@@ -1220,6 +1225,7 @@ class Profile {
1220
1225
  this.status = status;
1221
1226
  this.callPickupTargetUsers = callPickupTargetUsers;
1222
1227
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
1228
+ this.ringSeconds = ringSeconds;
1223
1229
 
1224
1230
  this.sipLines = sipLines || [];
1225
1231
  }
@@ -2225,6 +2231,7 @@ var authMethods = (client , baseUrl ) => ({
2225
2231
 
2226
2232
 
2227
2233
 
2234
+
2228
2235
  ) {
2229
2236
  const body = {
2230
2237
  backend: params.backend || DEFAULT_BACKEND_USER,
@@ -2244,6 +2251,10 @@ var authMethods = (client , baseUrl ) => ({
2244
2251
  headers['Wazo-Session-Type'] = 'mobile';
2245
2252
  }
2246
2253
 
2254
+ if (params.tenantId) {
2255
+ body.tenant_id = params.tenantId;
2256
+ }
2257
+
2247
2258
  return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
2248
2259
  },
2249
2260
 
@@ -3338,11 +3349,13 @@ class Recording {
3338
3349
 
3339
3350
 
3340
3351
 
3352
+
3341
3353
 
3342
3354
 
3343
3355
 
3344
3356
 
3345
3357
 
3358
+
3346
3359
 
3347
3360
 
3348
3361
 
@@ -3363,10 +3376,12 @@ class Recording {
3363
3376
 
3364
3377
 
3365
3378
 
3379
+
3366
3380
 
3367
3381
 
3368
3382
 
3369
3383
 
3384
+
3370
3385
 
3371
3386
 
3372
3387
 
@@ -3428,10 +3443,12 @@ class CallLog {
3428
3443
  || plain.destination_extension
3429
3444
  || `meeting-${plain.requested_name || plain.destination_name || ''}`,
3430
3445
  name: plain.requested_name || plain.destination_name || '',
3446
+ uuid: plain.destination_user_uuid,
3431
3447
  },
3432
3448
  source: {
3433
3449
  extension: plain.source_extension,
3434
3450
  name: plain.source_name,
3451
+ uuid: plain.source_user_uuid,
3435
3452
  },
3436
3453
  id: plain.id,
3437
3454
  duration: (plain.duration || 0) * 1000, // duration is in seconds
@@ -5957,7 +5974,7 @@ const ON_NETWORK_STATS = 'onNetworkStats';
5957
5974
  const ON_DISCONNECTED = 'onDisconnected';
5958
5975
  class CanceledCallError extends Error {}
5959
5976
 
5960
- const MAX_REGISTER_TRIES = 10;
5977
+ const MAX_REGISTER_TRIES = 5;
5961
5978
 
5962
5979
 
5963
5980