@webex/calling 3.10.0-next.24 → 3.10.0-next.25
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.
- package/dist/CallingClient/calling/call.js +1 -1
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +453 -351
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +7 -0
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/common/Utils.js +2 -0
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +2 -2
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/module/CallingClient/calling/call.js +1 -1
- package/dist/module/CallingClient/calling/callManager.js +7 -0
- package/dist/module/common/Utils.js +2 -0
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequ
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
9
9
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
|
10
10
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
11
|
+
var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
|
|
11
12
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
12
13
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
13
14
|
var InternalMediaCoreModule = _interopRequireWildcard(require("@webex/internal-media-core"));
|
|
@@ -1117,10 +1118,111 @@ describe('State Machine handler tests', function () {
|
|
|
1117
1118
|
}
|
|
1118
1119
|
}, _callee19);
|
|
1119
1120
|
})));
|
|
1120
|
-
it('
|
|
1121
|
-
var
|
|
1121
|
+
it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
1122
|
+
var callManager, statusPayload, call, dummyEvent, dummyOkEvent, emitSpy, startCallerIdSpy, mobiusProgressEvent;
|
|
1122
1123
|
return _regenerator.default.wrap(function (_context20) {
|
|
1123
1124
|
while (1) switch (_context20.prev = _context20.next) {
|
|
1125
|
+
case 0:
|
|
1126
|
+
callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
|
|
1127
|
+
statusPayload = {
|
|
1128
|
+
statusCode: 200,
|
|
1129
|
+
body: mockStatusBody
|
|
1130
|
+
};
|
|
1131
|
+
call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
|
|
1132
|
+
webex.request.mockReturnValue(statusPayload);
|
|
1133
|
+
|
|
1134
|
+
// Move to S_SEND_CALL_SETUP
|
|
1135
|
+
dummyEvent = {
|
|
1136
|
+
type: 'E_SEND_CALL_SETUP',
|
|
1137
|
+
data: {
|
|
1138
|
+
seq: 1,
|
|
1139
|
+
message: {},
|
|
1140
|
+
type: 'OFFER'
|
|
1141
|
+
}
|
|
1142
|
+
};
|
|
1143
|
+
call.sendCallStateMachineEvt(dummyEvent);
|
|
1144
|
+
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
1145
|
+
|
|
1146
|
+
// Complete media negotiation to allow connect -> established
|
|
1147
|
+
// Ask media SDK to initiate offer
|
|
1148
|
+
dummyEvent.type = 'E_SEND_ROAP_OFFER';
|
|
1149
|
+
dummyEvent.data = {
|
|
1150
|
+
seq: 1,
|
|
1151
|
+
messageType: 'OFFER',
|
|
1152
|
+
sdp: 'sdp'
|
|
1153
|
+
};
|
|
1154
|
+
call.sendMediaStateMachineEvt(dummyEvent);
|
|
1155
|
+
expect(call['mediaStateMachine'].state.value).toBe('S_SEND_ROAP_OFFER');
|
|
1156
|
+
dummyEvent.type = 'E_RECV_ROAP_ANSWER';
|
|
1157
|
+
dummyEvent.data = {
|
|
1158
|
+
seq: 1,
|
|
1159
|
+
messageType: 'ANSWER',
|
|
1160
|
+
sdp: 'sdp'
|
|
1161
|
+
};
|
|
1162
|
+
call.sendMediaStateMachineEvt(dummyEvent);
|
|
1163
|
+
expect(call['mediaStateMachine'].state.value).toBe('S_RECV_ROAP_ANSWER');
|
|
1164
|
+
// Send OK
|
|
1165
|
+
dummyOkEvent = {
|
|
1166
|
+
type: 'E_ROAP_OK',
|
|
1167
|
+
data: {
|
|
1168
|
+
received: false,
|
|
1169
|
+
message: {
|
|
1170
|
+
seq: 1,
|
|
1171
|
+
messageType: 'OK'
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
};
|
|
1175
|
+
call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1176
|
+
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_OK');
|
|
1177
|
+
expect(call['mediaNegotiationCompleted']).toBe(true);
|
|
1178
|
+
|
|
1179
|
+
// Move call to established
|
|
1180
|
+
dummyEvent.type = 'E_RECV_CALL_CONNECT';
|
|
1181
|
+
dummyEvent.data = undefined;
|
|
1182
|
+
call.sendCallStateMachineEvt(dummyEvent);
|
|
1183
|
+
expect(call['callStateMachine'].state.value).toBe('S_CALL_ESTABLISHED');
|
|
1184
|
+
emitSpy = jest.spyOn(call, 'emit');
|
|
1185
|
+
startCallerIdSpy = jest.spyOn(call, 'startCallerIdResolution'); // Now send progress with callerId while established via CallManager (Mobius event)
|
|
1186
|
+
mobiusProgressEvent = {
|
|
1187
|
+
id: 'evt1',
|
|
1188
|
+
timestamp: (0, _now.default)(),
|
|
1189
|
+
trackingId: 'track-1',
|
|
1190
|
+
data: {
|
|
1191
|
+
eventType: _types5.MobiusEventType.CALL_PROGRESS,
|
|
1192
|
+
callerId: {
|
|
1193
|
+
from: '"Bob Marley" <sip:5010@207.182.171.130;user=phone>;tag=888068389-1654853820619-'
|
|
1194
|
+
},
|
|
1195
|
+
callProgressData: {
|
|
1196
|
+
inbandMedia: true,
|
|
1197
|
+
alerting: false
|
|
1198
|
+
},
|
|
1199
|
+
callId: call.getCallId(),
|
|
1200
|
+
callUrl: 'https://mobius.example/call',
|
|
1201
|
+
deviceId: deviceId,
|
|
1202
|
+
correlationId: call.getCorrelationId()
|
|
1203
|
+
}
|
|
1204
|
+
};
|
|
1205
|
+
callManager['dequeueWsEvents'](mobiusProgressEvent);
|
|
1206
|
+
|
|
1207
|
+
// CallerId resolution should be triggered exactly once (handled by CallManager)
|
|
1208
|
+
expect(startCallerIdSpy).toBeCalledOnceWith(mobiusProgressEvent.data.callerId);
|
|
1209
|
+
// Since it returns early in established state, PROGRESS event should not be emitted here
|
|
1210
|
+
expect(emitSpy.mock.calls.find(function (args) {
|
|
1211
|
+
return args && args[0] === _types2.CALL_EVENT_KEYS.PROGRESS;
|
|
1212
|
+
})).toBeUndefined();
|
|
1213
|
+
expect(call['callStateMachine'].state.value).not.toBe('S_RECV_CALL_PROGRESS');
|
|
1214
|
+
// Early media flag should not be set due to early return
|
|
1215
|
+
expect(call.earlyMedia).not.toBe(true);
|
|
1216
|
+
case 1:
|
|
1217
|
+
case "end":
|
|
1218
|
+
return _context20.stop();
|
|
1219
|
+
}
|
|
1220
|
+
}, _callee20);
|
|
1221
|
+
})));
|
|
1222
|
+
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
1223
|
+
var warnSpy, errorSpy, stateMachineSpy, statusPayload, roapMessage;
|
|
1224
|
+
return _regenerator.default.wrap(function (_context21) {
|
|
1225
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1124
1226
|
case 0:
|
|
1125
1227
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1126
1228
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
@@ -1147,7 +1249,7 @@ describe('State Machine handler tests', function () {
|
|
|
1147
1249
|
webex.request.mockRejectedValueOnce({
|
|
1148
1250
|
statusCode: 403
|
|
1149
1251
|
}).mockResolvedValue(statusPayload);
|
|
1150
|
-
|
|
1252
|
+
_context21.next = 1;
|
|
1151
1253
|
return call['handleOutgoingCallConnect']({
|
|
1152
1254
|
type: 'E_SEND_CALL_CONNECT'
|
|
1153
1255
|
});
|
|
@@ -1158,14 +1260,14 @@ describe('State Machine handler tests', function () {
|
|
|
1158
1260
|
expect(errorSpy).toBeCalledTimes(1);
|
|
1159
1261
|
case 2:
|
|
1160
1262
|
case "end":
|
|
1161
|
-
return
|
|
1263
|
+
return _context21.stop();
|
|
1162
1264
|
}
|
|
1163
|
-
},
|
|
1265
|
+
}, _callee21);
|
|
1164
1266
|
})));
|
|
1165
|
-
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1267
|
+
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
1166
1268
|
var statusPayload, dummyEvent, postMediaSpy, logSpy, dummyOkEvent;
|
|
1167
|
-
return _regenerator.default.wrap(function (
|
|
1168
|
-
while (1) switch (
|
|
1269
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
1270
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1169
1271
|
case 0:
|
|
1170
1272
|
statusPayload = {
|
|
1171
1273
|
statusCode: 200,
|
|
@@ -1241,14 +1343,14 @@ describe('State Machine handler tests', function () {
|
|
|
1241
1343
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1242
1344
|
case 1:
|
|
1243
1345
|
case "end":
|
|
1244
|
-
return
|
|
1346
|
+
return _context22.stop();
|
|
1245
1347
|
}
|
|
1246
|
-
},
|
|
1348
|
+
}, _callee22);
|
|
1247
1349
|
})));
|
|
1248
|
-
it('outgoing call where we receive connect directly after setup. Media established before connect. test call and media state changes', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1350
|
+
it('outgoing call where we receive connect directly after setup. Media established before connect. test call and media state changes', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
1249
1351
|
var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
|
|
1250
|
-
return _regenerator.default.wrap(function (
|
|
1251
|
-
while (1) switch (
|
|
1352
|
+
return _regenerator.default.wrap(function (_context23) {
|
|
1353
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1252
1354
|
case 0:
|
|
1253
1355
|
statusPayload = {
|
|
1254
1356
|
statusCode: 200,
|
|
@@ -1316,14 +1418,14 @@ describe('State Machine handler tests', function () {
|
|
|
1316
1418
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
1317
1419
|
case 1:
|
|
1318
1420
|
case "end":
|
|
1319
|
-
return
|
|
1421
|
+
return _context23.stop();
|
|
1320
1422
|
}
|
|
1321
|
-
},
|
|
1423
|
+
}, _callee23);
|
|
1322
1424
|
})));
|
|
1323
|
-
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1425
|
+
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
1324
1426
|
var statusPayload, dummyEvent;
|
|
1325
|
-
return _regenerator.default.wrap(function (
|
|
1326
|
-
while (1) switch (
|
|
1427
|
+
return _regenerator.default.wrap(function (_context24) {
|
|
1428
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1327
1429
|
case 0:
|
|
1328
1430
|
statusPayload = {
|
|
1329
1431
|
statusCode: 200,
|
|
@@ -1362,14 +1464,14 @@ describe('State Machine handler tests', function () {
|
|
|
1362
1464
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
1363
1465
|
case 1:
|
|
1364
1466
|
case "end":
|
|
1365
|
-
return
|
|
1467
|
+
return _context24.stop();
|
|
1366
1468
|
}
|
|
1367
|
-
},
|
|
1469
|
+
}, _callee24);
|
|
1368
1470
|
})));
|
|
1369
|
-
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1471
|
+
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
1370
1472
|
var statusPayload, dummyEvent, errorSpy;
|
|
1371
|
-
return _regenerator.default.wrap(function (
|
|
1372
|
-
while (1) switch (
|
|
1473
|
+
return _regenerator.default.wrap(function (_context25) {
|
|
1474
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1373
1475
|
case 0:
|
|
1374
1476
|
statusPayload = {
|
|
1375
1477
|
statusCode: 403,
|
|
@@ -1386,7 +1488,7 @@ describe('State Machine handler tests', function () {
|
|
|
1386
1488
|
webex.request.mockRejectedValueOnce(statusPayload);
|
|
1387
1489
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
1388
1490
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1389
|
-
|
|
1491
|
+
_context25.next = 1;
|
|
1390
1492
|
return (0, _testUtil.flushPromises)(3);
|
|
1391
1493
|
case 1:
|
|
1392
1494
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
@@ -1397,14 +1499,14 @@ describe('State Machine handler tests', function () {
|
|
|
1397
1499
|
});
|
|
1398
1500
|
case 2:
|
|
1399
1501
|
case "end":
|
|
1400
|
-
return
|
|
1502
|
+
return _context25.stop();
|
|
1401
1503
|
}
|
|
1402
|
-
},
|
|
1504
|
+
}, _callee25);
|
|
1403
1505
|
})));
|
|
1404
|
-
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1506
|
+
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
1405
1507
|
var statusPayload, dummyEvent, warnSpy;
|
|
1406
|
-
return _regenerator.default.wrap(function (
|
|
1407
|
-
while (1) switch (
|
|
1508
|
+
return _regenerator.default.wrap(function (_context26) {
|
|
1509
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1408
1510
|
case 0:
|
|
1409
1511
|
statusPayload = {
|
|
1410
1512
|
statusCode: 403,
|
|
@@ -1423,10 +1525,10 @@ describe('State Machine handler tests', function () {
|
|
|
1423
1525
|
webex.request.mockRejectedValue(statusPayload);
|
|
1424
1526
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1425
1527
|
jest.spyOn(Utils, 'uploadLogs').mockResolvedValue(undefined);
|
|
1426
|
-
|
|
1528
|
+
_context26.next = 1;
|
|
1427
1529
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1428
1530
|
case 1:
|
|
1429
|
-
|
|
1531
|
+
_context26.next = 2;
|
|
1430
1532
|
return (0, _testUtil.flushPromises)(2);
|
|
1431
1533
|
case 2:
|
|
1432
1534
|
expect(call.isConnected()).toBe(false);
|
|
@@ -1442,14 +1544,14 @@ describe('State Machine handler tests', function () {
|
|
|
1442
1544
|
});
|
|
1443
1545
|
case 3:
|
|
1444
1546
|
case "end":
|
|
1445
|
-
return
|
|
1547
|
+
return _context26.stop();
|
|
1446
1548
|
}
|
|
1447
|
-
},
|
|
1549
|
+
}, _callee26);
|
|
1448
1550
|
})));
|
|
1449
|
-
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1551
|
+
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
1450
1552
|
var statusPayload, dummyEvent;
|
|
1451
|
-
return _regenerator.default.wrap(function (
|
|
1452
|
-
while (1) switch (
|
|
1553
|
+
return _regenerator.default.wrap(function (_context27) {
|
|
1554
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1453
1555
|
case 0:
|
|
1454
1556
|
statusPayload = {
|
|
1455
1557
|
statusCode: 403,
|
|
@@ -1472,14 +1574,14 @@ describe('State Machine handler tests', function () {
|
|
|
1472
1574
|
expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
|
|
1473
1575
|
case 1:
|
|
1474
1576
|
case "end":
|
|
1475
|
-
return
|
|
1577
|
+
return _context27.stop();
|
|
1476
1578
|
}
|
|
1477
|
-
},
|
|
1579
|
+
}, _callee27);
|
|
1478
1580
|
})));
|
|
1479
|
-
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1581
|
+
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
1480
1582
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1481
|
-
return _regenerator.default.wrap(function (
|
|
1482
|
-
while (1) switch (
|
|
1583
|
+
return _regenerator.default.wrap(function (_context28) {
|
|
1584
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1483
1585
|
case 0:
|
|
1484
1586
|
statusPayload = {
|
|
1485
1587
|
statusCode: 503,
|
|
@@ -1501,7 +1603,7 @@ describe('State Machine handler tests', function () {
|
|
|
1501
1603
|
}
|
|
1502
1604
|
};
|
|
1503
1605
|
call['connected'] = true;
|
|
1504
|
-
|
|
1606
|
+
_context28.next = 1;
|
|
1505
1607
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1506
1608
|
case 1:
|
|
1507
1609
|
jest.advanceTimersByTime(1005);
|
|
@@ -1513,14 +1615,14 @@ describe('State Machine handler tests', function () {
|
|
|
1513
1615
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1514
1616
|
case 2:
|
|
1515
1617
|
case "end":
|
|
1516
|
-
return
|
|
1618
|
+
return _context28.stop();
|
|
1517
1619
|
}
|
|
1518
|
-
},
|
|
1620
|
+
}, _callee28);
|
|
1519
1621
|
})));
|
|
1520
|
-
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1622
|
+
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
1521
1623
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1522
|
-
return _regenerator.default.wrap(function (
|
|
1523
|
-
while (1) switch (
|
|
1624
|
+
return _regenerator.default.wrap(function (_context29) {
|
|
1625
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1524
1626
|
case 0:
|
|
1525
1627
|
statusPayload = {
|
|
1526
1628
|
statusCode: 503,
|
|
@@ -1542,7 +1644,7 @@ describe('State Machine handler tests', function () {
|
|
|
1542
1644
|
}
|
|
1543
1645
|
};
|
|
1544
1646
|
call['connected'] = false;
|
|
1545
|
-
|
|
1647
|
+
_context29.next = 1;
|
|
1546
1648
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
1547
1649
|
case 1:
|
|
1548
1650
|
jest.advanceTimersByTime(1005);
|
|
@@ -1553,14 +1655,14 @@ describe('State Machine handler tests', function () {
|
|
|
1553
1655
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1554
1656
|
case 2:
|
|
1555
1657
|
case "end":
|
|
1556
|
-
return
|
|
1658
|
+
return _context29.stop();
|
|
1557
1659
|
}
|
|
1558
|
-
},
|
|
1660
|
+
}, _callee29);
|
|
1559
1661
|
})));
|
|
1560
|
-
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1662
|
+
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1561
1663
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1562
|
-
return _regenerator.default.wrap(function (
|
|
1563
|
-
while (1) switch (
|
|
1664
|
+
return _regenerator.default.wrap(function (_context30) {
|
|
1665
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1564
1666
|
case 0:
|
|
1565
1667
|
statusPayload = {
|
|
1566
1668
|
statusCode: 503,
|
|
@@ -1582,7 +1684,7 @@ describe('State Machine handler tests', function () {
|
|
|
1582
1684
|
};
|
|
1583
1685
|
call['connected'] = true;
|
|
1584
1686
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
|
|
1585
|
-
|
|
1687
|
+
_context30.next = 1;
|
|
1586
1688
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1587
1689
|
case 1:
|
|
1588
1690
|
jest.advanceTimersByTime(1005);
|
|
@@ -1594,14 +1696,14 @@ describe('State Machine handler tests', function () {
|
|
|
1594
1696
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1595
1697
|
case 2:
|
|
1596
1698
|
case "end":
|
|
1597
|
-
return
|
|
1699
|
+
return _context30.stop();
|
|
1598
1700
|
}
|
|
1599
|
-
},
|
|
1701
|
+
}, _callee30);
|
|
1600
1702
|
})));
|
|
1601
|
-
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1703
|
+
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
|
|
1602
1704
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1603
|
-
return _regenerator.default.wrap(function (
|
|
1604
|
-
while (1) switch (
|
|
1705
|
+
return _regenerator.default.wrap(function (_context31) {
|
|
1706
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1605
1707
|
case 0:
|
|
1606
1708
|
statusPayload = {
|
|
1607
1709
|
statusCode: 503,
|
|
@@ -1622,7 +1724,7 @@ describe('State Machine handler tests', function () {
|
|
|
1622
1724
|
}
|
|
1623
1725
|
};
|
|
1624
1726
|
call['connected'] = false;
|
|
1625
|
-
|
|
1727
|
+
_context31.next = 1;
|
|
1626
1728
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1627
1729
|
case 1:
|
|
1628
1730
|
jest.advanceTimersByTime(1005);
|
|
@@ -1634,14 +1736,14 @@ describe('State Machine handler tests', function () {
|
|
|
1634
1736
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1635
1737
|
case 2:
|
|
1636
1738
|
case "end":
|
|
1637
|
-
return
|
|
1739
|
+
return _context31.stop();
|
|
1638
1740
|
}
|
|
1639
|
-
},
|
|
1741
|
+
}, _callee31);
|
|
1640
1742
|
})));
|
|
1641
|
-
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1743
|
+
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
1642
1744
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1643
|
-
return _regenerator.default.wrap(function (
|
|
1644
|
-
while (1) switch (
|
|
1745
|
+
return _regenerator.default.wrap(function (_context32) {
|
|
1746
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1645
1747
|
case 0:
|
|
1646
1748
|
statusPayload = {
|
|
1647
1749
|
statusCode: 200,
|
|
@@ -1666,14 +1768,14 @@ describe('State Machine handler tests', function () {
|
|
|
1666
1768
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1667
1769
|
case 1:
|
|
1668
1770
|
case "end":
|
|
1669
|
-
return
|
|
1771
|
+
return _context32.stop();
|
|
1670
1772
|
}
|
|
1671
|
-
},
|
|
1773
|
+
}, _callee32);
|
|
1672
1774
|
})));
|
|
1673
|
-
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1775
|
+
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
|
|
1674
1776
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1675
|
-
return _regenerator.default.wrap(function (
|
|
1676
|
-
while (1) switch (
|
|
1777
|
+
return _regenerator.default.wrap(function (_context33) {
|
|
1778
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1677
1779
|
case 0:
|
|
1678
1780
|
statusPayload = {
|
|
1679
1781
|
statusCode: 503,
|
|
@@ -1695,7 +1797,7 @@ describe('State Machine handler tests', function () {
|
|
|
1695
1797
|
};
|
|
1696
1798
|
call['connected'] = true;
|
|
1697
1799
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
1698
|
-
|
|
1800
|
+
_context33.next = 1;
|
|
1699
1801
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1700
1802
|
case 1:
|
|
1701
1803
|
jest.advanceTimersByTime(1005);
|
|
@@ -1707,14 +1809,14 @@ describe('State Machine handler tests', function () {
|
|
|
1707
1809
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1708
1810
|
case 2:
|
|
1709
1811
|
case "end":
|
|
1710
|
-
return
|
|
1812
|
+
return _context33.stop();
|
|
1711
1813
|
}
|
|
1712
|
-
},
|
|
1814
|
+
}, _callee33);
|
|
1713
1815
|
})));
|
|
1714
|
-
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1816
|
+
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
|
|
1715
1817
|
var statusPayload, stateMachineSpy, funcSpy, errorEvent;
|
|
1716
|
-
return _regenerator.default.wrap(function (
|
|
1717
|
-
while (1) switch (
|
|
1818
|
+
return _regenerator.default.wrap(function (_context34) {
|
|
1819
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1718
1820
|
case 0:
|
|
1719
1821
|
statusPayload = {
|
|
1720
1822
|
statusCode: 403,
|
|
@@ -1737,14 +1839,14 @@ describe('State Machine handler tests', function () {
|
|
|
1737
1839
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1738
1840
|
case 1:
|
|
1739
1841
|
case "end":
|
|
1740
|
-
return
|
|
1842
|
+
return _context34.stop();
|
|
1741
1843
|
}
|
|
1742
|
-
},
|
|
1844
|
+
}, _callee34);
|
|
1743
1845
|
})));
|
|
1744
|
-
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1846
|
+
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
|
|
1745
1847
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1746
|
-
return _regenerator.default.wrap(function (
|
|
1747
|
-
while (1) switch (
|
|
1848
|
+
return _regenerator.default.wrap(function (_context35) {
|
|
1849
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
1748
1850
|
case 0:
|
|
1749
1851
|
statusPayload = {
|
|
1750
1852
|
statusCode: 200,
|
|
@@ -1762,7 +1864,7 @@ describe('State Machine handler tests', function () {
|
|
|
1762
1864
|
}
|
|
1763
1865
|
};
|
|
1764
1866
|
call['connected'] = false;
|
|
1765
|
-
|
|
1867
|
+
_context35.next = 1;
|
|
1766
1868
|
return call['handleRoapError']({}, errorEvent);
|
|
1767
1869
|
case 1:
|
|
1768
1870
|
expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
|
|
@@ -1778,14 +1880,14 @@ describe('State Machine handler tests', function () {
|
|
|
1778
1880
|
});
|
|
1779
1881
|
case 2:
|
|
1780
1882
|
case "end":
|
|
1781
|
-
return
|
|
1883
|
+
return _context35.stop();
|
|
1782
1884
|
}
|
|
1783
|
-
},
|
|
1885
|
+
}, _callee35);
|
|
1784
1886
|
})));
|
|
1785
|
-
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1887
|
+
it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
|
|
1786
1888
|
var statusPayload, warnSpy, postMediaSpy, setupEvent, connectEvent, offerEvent, answerEvent;
|
|
1787
|
-
return _regenerator.default.wrap(function (
|
|
1788
|
-
while (1) switch (
|
|
1889
|
+
return _regenerator.default.wrap(function (_context36) {
|
|
1890
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
1789
1891
|
case 0:
|
|
1790
1892
|
statusPayload = {
|
|
1791
1893
|
statusCode: 403,
|
|
@@ -1823,10 +1925,10 @@ describe('State Machine handler tests', function () {
|
|
|
1823
1925
|
messageType: 'ANSWER'
|
|
1824
1926
|
}
|
|
1825
1927
|
};
|
|
1826
|
-
|
|
1928
|
+
_context36.next = 1;
|
|
1827
1929
|
return call.sendMediaStateMachineEvt(answerEvent);
|
|
1828
1930
|
case 1:
|
|
1829
|
-
|
|
1931
|
+
_context36.next = 2;
|
|
1830
1932
|
return (0, _testUtil.flushPromises)(2);
|
|
1831
1933
|
case 2:
|
|
1832
1934
|
expect(postMediaSpy).toBeCalledOnceWith(answerEvent.data);
|
|
@@ -1844,14 +1946,14 @@ describe('State Machine handler tests', function () {
|
|
|
1844
1946
|
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
1845
1947
|
case 3:
|
|
1846
1948
|
case "end":
|
|
1847
|
-
return
|
|
1949
|
+
return _context36.stop();
|
|
1848
1950
|
}
|
|
1849
|
-
},
|
|
1951
|
+
}, _callee36);
|
|
1850
1952
|
})));
|
|
1851
|
-
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1953
|
+
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
|
|
1852
1954
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1853
|
-
return _regenerator.default.wrap(function (
|
|
1854
|
-
while (1) switch (
|
|
1955
|
+
return _regenerator.default.wrap(function (_context37) {
|
|
1956
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
1855
1957
|
case 0:
|
|
1856
1958
|
statusPayload = {
|
|
1857
1959
|
statusCode: 200,
|
|
@@ -1884,7 +1986,7 @@ describe('State Machine handler tests', function () {
|
|
|
1884
1986
|
seq: 1,
|
|
1885
1987
|
messageType: 'ANSWER'
|
|
1886
1988
|
};
|
|
1887
|
-
|
|
1989
|
+
_context37.next = 1;
|
|
1888
1990
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1889
1991
|
case 1:
|
|
1890
1992
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -1906,7 +2008,7 @@ describe('State Machine handler tests', function () {
|
|
|
1906
2008
|
seq: 2,
|
|
1907
2009
|
messageType: 'OFFER_REQUEST'
|
|
1908
2010
|
};
|
|
1909
|
-
|
|
2011
|
+
_context37.next = 2;
|
|
1910
2012
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1911
2013
|
case 2:
|
|
1912
2014
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -1956,7 +2058,7 @@ describe('State Machine handler tests', function () {
|
|
|
1956
2058
|
};
|
|
1957
2059
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1958
2060
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1959
|
-
|
|
2061
|
+
_context37.next = 3;
|
|
1960
2062
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1961
2063
|
case 3:
|
|
1962
2064
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1965,7 +2067,7 @@ describe('State Machine handler tests', function () {
|
|
|
1965
2067
|
seq: 3,
|
|
1966
2068
|
messageType: 'ANSWER'
|
|
1967
2069
|
};
|
|
1968
|
-
|
|
2070
|
+
_context37.next = 4;
|
|
1969
2071
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1970
2072
|
case 4:
|
|
1971
2073
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1984,7 +2086,7 @@ describe('State Machine handler tests', function () {
|
|
|
1984
2086
|
messageType: 'OK'
|
|
1985
2087
|
}
|
|
1986
2088
|
};
|
|
1987
|
-
|
|
2089
|
+
_context37.next = 5;
|
|
1988
2090
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1989
2091
|
case 5:
|
|
1990
2092
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
@@ -1999,14 +2101,14 @@ describe('State Machine handler tests', function () {
|
|
|
1999
2101
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2000
2102
|
case 6:
|
|
2001
2103
|
case "end":
|
|
2002
|
-
return
|
|
2104
|
+
return _context37.stop();
|
|
2003
2105
|
}
|
|
2004
|
-
},
|
|
2106
|
+
}, _callee37);
|
|
2005
2107
|
})));
|
|
2006
|
-
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2108
|
+
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
|
|
2007
2109
|
var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
2008
|
-
return _regenerator.default.wrap(function (
|
|
2009
|
-
while (1) switch (
|
|
2110
|
+
return _regenerator.default.wrap(function (_context38) {
|
|
2111
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
2010
2112
|
case 0:
|
|
2011
2113
|
mockStatusBody = {
|
|
2012
2114
|
device: {
|
|
@@ -2046,7 +2148,7 @@ describe('State Machine handler tests', function () {
|
|
|
2046
2148
|
seq: 1,
|
|
2047
2149
|
messageType: 'ANSWER'
|
|
2048
2150
|
};
|
|
2049
|
-
|
|
2151
|
+
_context38.next = 1;
|
|
2050
2152
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2051
2153
|
case 1:
|
|
2052
2154
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -2068,7 +2170,7 @@ describe('State Machine handler tests', function () {
|
|
|
2068
2170
|
seq: 2,
|
|
2069
2171
|
messageType: 'OFFER_REQUEST'
|
|
2070
2172
|
};
|
|
2071
|
-
|
|
2173
|
+
_context38.next = 2;
|
|
2072
2174
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2073
2175
|
case 2:
|
|
2074
2176
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -2118,7 +2220,7 @@ describe('State Machine handler tests', function () {
|
|
|
2118
2220
|
};
|
|
2119
2221
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
2120
2222
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
2121
|
-
|
|
2223
|
+
_context38.next = 3;
|
|
2122
2224
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2123
2225
|
case 3:
|
|
2124
2226
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2127,7 +2229,7 @@ describe('State Machine handler tests', function () {
|
|
|
2127
2229
|
seq: 3,
|
|
2128
2230
|
messageType: 'ANSWER'
|
|
2129
2231
|
};
|
|
2130
|
-
|
|
2232
|
+
_context38.next = 4;
|
|
2131
2233
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
2132
2234
|
case 4:
|
|
2133
2235
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -2144,7 +2246,7 @@ describe('State Machine handler tests', function () {
|
|
|
2144
2246
|
}
|
|
2145
2247
|
};
|
|
2146
2248
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
2147
|
-
|
|
2249
|
+
_context38.next = 5;
|
|
2148
2250
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
2149
2251
|
case 5:
|
|
2150
2252
|
expect(call['receivedRoapOKSeq']).toBe(3);
|
|
@@ -2160,14 +2262,14 @@ describe('State Machine handler tests', function () {
|
|
|
2160
2262
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
2161
2263
|
case 6:
|
|
2162
2264
|
case "end":
|
|
2163
|
-
return
|
|
2265
|
+
return _context38.stop();
|
|
2164
2266
|
}
|
|
2165
|
-
},
|
|
2267
|
+
}, _callee38);
|
|
2166
2268
|
})));
|
|
2167
|
-
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2269
|
+
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
|
|
2168
2270
|
var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
|
|
2169
|
-
return _regenerator.default.wrap(function (
|
|
2170
|
-
while (1) switch (
|
|
2271
|
+
return _regenerator.default.wrap(function (_context39) {
|
|
2272
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
2171
2273
|
case 0:
|
|
2172
2274
|
statusPayload = {
|
|
2173
2275
|
statusCode: 200,
|
|
@@ -2234,14 +2336,14 @@ describe('State Machine handler tests', function () {
|
|
|
2234
2336
|
});
|
|
2235
2337
|
case 1:
|
|
2236
2338
|
case "end":
|
|
2237
|
-
return
|
|
2339
|
+
return _context39.stop();
|
|
2238
2340
|
}
|
|
2239
|
-
},
|
|
2341
|
+
}, _callee39);
|
|
2240
2342
|
})));
|
|
2241
|
-
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2343
|
+
it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
|
|
2242
2344
|
var emitSpy, deleteSpy;
|
|
2243
|
-
return _regenerator.default.wrap(function (
|
|
2244
|
-
while (1) switch (
|
|
2345
|
+
return _regenerator.default.wrap(function (_context40) {
|
|
2346
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
2245
2347
|
case 0:
|
|
2246
2348
|
emitSpy = jest.spyOn(call, 'emit');
|
|
2247
2349
|
deleteSpy = jest.spyOn(call, 'delete').mockResolvedValue({
|
|
@@ -2250,7 +2352,7 @@ describe('State Machine handler tests', function () {
|
|
|
2250
2352
|
call.sendCallStateMachineEvt({
|
|
2251
2353
|
type: 'E_RECV_CALL_DISCONNECT'
|
|
2252
2354
|
});
|
|
2253
|
-
|
|
2355
|
+
_context40.next = 1;
|
|
2254
2356
|
return (0, _testUtil.flushPromises)(1);
|
|
2255
2357
|
case 1:
|
|
2256
2358
|
expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
|
|
@@ -2258,9 +2360,9 @@ describe('State Machine handler tests', function () {
|
|
|
2258
2360
|
expect(emitSpy.mock.invocationCallOrder[0]).toBeLessThan(deleteSpy.mock.invocationCallOrder[0]);
|
|
2259
2361
|
case 2:
|
|
2260
2362
|
case "end":
|
|
2261
|
-
return
|
|
2363
|
+
return _context40.stop();
|
|
2262
2364
|
}
|
|
2263
|
-
},
|
|
2365
|
+
}, _callee40);
|
|
2264
2366
|
})));
|
|
2265
2367
|
describe('Call event timers tests', function () {
|
|
2266
2368
|
var callManager;
|
|
@@ -2271,10 +2373,10 @@ describe('State Machine handler tests', function () {
|
|
|
2271
2373
|
afterEach(function () {
|
|
2272
2374
|
jest.clearAllTimers();
|
|
2273
2375
|
});
|
|
2274
|
-
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2376
|
+
it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
|
|
2275
2377
|
var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
|
|
2276
|
-
return _regenerator.default.wrap(function (
|
|
2277
|
-
while (1) switch (
|
|
2378
|
+
return _regenerator.default.wrap(function (_context41) {
|
|
2379
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
2278
2380
|
case 0:
|
|
2279
2381
|
statusPayload = {
|
|
2280
2382
|
statusCode: 200,
|
|
@@ -2291,7 +2393,7 @@ describe('State Machine handler tests', function () {
|
|
|
2291
2393
|
webex.request.mockReturnValue(statusPayload);
|
|
2292
2394
|
|
|
2293
2395
|
// handleOutgoingCallSetup is asynchronous
|
|
2294
|
-
|
|
2396
|
+
_context41.next = 1;
|
|
2295
2397
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2296
2398
|
case 1:
|
|
2297
2399
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2334,14 +2436,14 @@ describe('State Machine handler tests', function () {
|
|
|
2334
2436
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2335
2437
|
case 2:
|
|
2336
2438
|
case "end":
|
|
2337
|
-
return
|
|
2439
|
+
return _context41.stop();
|
|
2338
2440
|
}
|
|
2339
|
-
},
|
|
2441
|
+
}, _callee41);
|
|
2340
2442
|
})));
|
|
2341
|
-
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2443
|
+
it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
|
|
2342
2444
|
var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
|
|
2343
|
-
return _regenerator.default.wrap(function (
|
|
2344
|
-
while (1) switch (
|
|
2445
|
+
return _regenerator.default.wrap(function (_context42) {
|
|
2446
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
2345
2447
|
case 0:
|
|
2346
2448
|
statusPayload = {
|
|
2347
2449
|
statusCode: 200,
|
|
@@ -2360,7 +2462,7 @@ describe('State Machine handler tests', function () {
|
|
|
2360
2462
|
expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
|
|
2361
2463
|
|
|
2362
2464
|
// handleOutgoingCallSetup is asynchronous
|
|
2363
|
-
|
|
2465
|
+
_context42.next = 1;
|
|
2364
2466
|
return call.sendCallStateMachineEvt(dummyEvent);
|
|
2365
2467
|
case 1:
|
|
2366
2468
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
|
|
@@ -2372,9 +2474,9 @@ describe('State Machine handler tests', function () {
|
|
|
2372
2474
|
expect(callManager.callCollection).toStrictEqual({});
|
|
2373
2475
|
case 2:
|
|
2374
2476
|
case "end":
|
|
2375
|
-
return
|
|
2477
|
+
return _context42.stop();
|
|
2376
2478
|
}
|
|
2377
|
-
},
|
|
2479
|
+
}, _callee42);
|
|
2378
2480
|
})));
|
|
2379
2481
|
});
|
|
2380
2482
|
});
|
|
@@ -2434,10 +2536,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2434
2536
|
beforeEach(function () {
|
|
2435
2537
|
call.removeAllListeners();
|
|
2436
2538
|
});
|
|
2437
|
-
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2539
|
+
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
|
|
2438
2540
|
var responsePayload, warnSpy, roapEvent;
|
|
2439
|
-
return _regenerator.default.wrap(function (
|
|
2440
|
-
while (1) switch (
|
|
2541
|
+
return _regenerator.default.wrap(function (_context44) {
|
|
2542
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2441
2543
|
case 0:
|
|
2442
2544
|
expect.assertions(7);
|
|
2443
2545
|
responsePayload = {
|
|
@@ -2450,25 +2552,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2450
2552
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2451
2553
|
call['held'] = false;
|
|
2452
2554
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2453
|
-
var
|
|
2454
|
-
return _regenerator.default.wrap(function (
|
|
2455
|
-
while (1) switch (
|
|
2555
|
+
var _ref44 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43(correlationId) {
|
|
2556
|
+
return _regenerator.default.wrap(function (_context43) {
|
|
2557
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2456
2558
|
case 0:
|
|
2457
2559
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2458
2560
|
case 1:
|
|
2459
2561
|
case "end":
|
|
2460
|
-
return
|
|
2562
|
+
return _context43.stop();
|
|
2461
2563
|
}
|
|
2462
|
-
},
|
|
2564
|
+
}, _callee43);
|
|
2463
2565
|
}));
|
|
2464
2566
|
return function (_x) {
|
|
2465
|
-
return
|
|
2567
|
+
return _ref44.apply(this, arguments);
|
|
2466
2568
|
};
|
|
2467
2569
|
}());
|
|
2468
|
-
|
|
2570
|
+
_context44.next = 1;
|
|
2469
2571
|
return call.doHoldResume();
|
|
2470
2572
|
case 1:
|
|
2471
|
-
|
|
2573
|
+
_context44.next = 2;
|
|
2472
2574
|
return (0, _testUtil.flushPromises)(2);
|
|
2473
2575
|
case 2:
|
|
2474
2576
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2484,11 +2586,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2484
2586
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2485
2587
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2486
2588
|
roapEvent.data.type = 'ANSWER';
|
|
2487
|
-
|
|
2589
|
+
_context44.next = 3;
|
|
2488
2590
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2489
2591
|
case 3:
|
|
2490
2592
|
roapEvent.data.type = 'OK';
|
|
2491
|
-
|
|
2593
|
+
_context44.next = 4;
|
|
2492
2594
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2493
2595
|
case 4:
|
|
2494
2596
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2503,14 +2605,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2503
2605
|
});
|
|
2504
2606
|
case 5:
|
|
2505
2607
|
case "end":
|
|
2506
|
-
return
|
|
2608
|
+
return _context44.stop();
|
|
2507
2609
|
}
|
|
2508
|
-
},
|
|
2610
|
+
}, _callee44);
|
|
2509
2611
|
})));
|
|
2510
|
-
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2612
|
+
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
|
|
2511
2613
|
var responsePayload, warnSpy, roapEvent;
|
|
2512
|
-
return _regenerator.default.wrap(function (
|
|
2513
|
-
while (1) switch (
|
|
2614
|
+
return _regenerator.default.wrap(function (_context46) {
|
|
2615
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2514
2616
|
case 0:
|
|
2515
2617
|
expect.assertions(8);
|
|
2516
2618
|
responsePayload = {
|
|
@@ -2523,26 +2625,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2523
2625
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2524
2626
|
call['held'] = false;
|
|
2525
2627
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
2526
|
-
var
|
|
2527
|
-
return _regenerator.default.wrap(function (
|
|
2528
|
-
while (1) switch (
|
|
2628
|
+
var _ref46 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45(correlationId) {
|
|
2629
|
+
return _regenerator.default.wrap(function (_context45) {
|
|
2630
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2529
2631
|
case 0:
|
|
2530
2632
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2531
2633
|
case 1:
|
|
2532
2634
|
case "end":
|
|
2533
|
-
return
|
|
2635
|
+
return _context45.stop();
|
|
2534
2636
|
}
|
|
2535
|
-
},
|
|
2637
|
+
}, _callee45);
|
|
2536
2638
|
}));
|
|
2537
2639
|
return function (_x2) {
|
|
2538
|
-
return
|
|
2640
|
+
return _ref46.apply(this, arguments);
|
|
2539
2641
|
};
|
|
2540
2642
|
}());
|
|
2541
2643
|
call.doHoldResume();
|
|
2542
|
-
|
|
2644
|
+
_context46.next = 1;
|
|
2543
2645
|
return _promise.default.resolve();
|
|
2544
2646
|
case 1:
|
|
2545
|
-
|
|
2647
|
+
_context46.next = 2;
|
|
2546
2648
|
return _promise.default.resolve();
|
|
2547
2649
|
case 2:
|
|
2548
2650
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2558,11 +2660,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2558
2660
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2559
2661
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2560
2662
|
roapEvent.data.type = 'ANSWER';
|
|
2561
|
-
|
|
2663
|
+
_context46.next = 3;
|
|
2562
2664
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2563
2665
|
case 3:
|
|
2564
2666
|
roapEvent.data.type = 'OK';
|
|
2565
|
-
|
|
2667
|
+
_context46.next = 4;
|
|
2566
2668
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2567
2669
|
case 4:
|
|
2568
2670
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2577,14 +2679,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2577
2679
|
});
|
|
2578
2680
|
case 5:
|
|
2579
2681
|
case "end":
|
|
2580
|
-
return
|
|
2682
|
+
return _context46.stop();
|
|
2581
2683
|
}
|
|
2582
|
-
},
|
|
2684
|
+
}, _callee46);
|
|
2583
2685
|
})));
|
|
2584
|
-
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2686
|
+
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48() {
|
|
2585
2687
|
var responsePayload;
|
|
2586
|
-
return _regenerator.default.wrap(function (
|
|
2587
|
-
while (1) switch (
|
|
2688
|
+
return _regenerator.default.wrap(function (_context48) {
|
|
2689
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2588
2690
|
case 0:
|
|
2589
2691
|
expect.assertions(4);
|
|
2590
2692
|
responsePayload = {
|
|
@@ -2594,26 +2696,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2594
2696
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2595
2697
|
call['held'] = false;
|
|
2596
2698
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2597
|
-
var
|
|
2598
|
-
return _regenerator.default.wrap(function (
|
|
2599
|
-
while (1) switch (
|
|
2699
|
+
var _ref48 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47(errObj) {
|
|
2700
|
+
return _regenerator.default.wrap(function (_context47) {
|
|
2701
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2600
2702
|
case 0:
|
|
2601
2703
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2602
2704
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2603
2705
|
case 1:
|
|
2604
2706
|
case "end":
|
|
2605
|
-
return
|
|
2707
|
+
return _context47.stop();
|
|
2606
2708
|
}
|
|
2607
|
-
},
|
|
2709
|
+
}, _callee47);
|
|
2608
2710
|
}));
|
|
2609
2711
|
return function (_x3) {
|
|
2610
|
-
return
|
|
2712
|
+
return _ref48.apply(this, arguments);
|
|
2611
2713
|
};
|
|
2612
2714
|
}());
|
|
2613
|
-
|
|
2715
|
+
_context48.next = 1;
|
|
2614
2716
|
return call.doHoldResume();
|
|
2615
2717
|
case 1:
|
|
2616
|
-
|
|
2718
|
+
_context48.next = 2;
|
|
2617
2719
|
return (0, _testUtil.flushPromises)(2);
|
|
2618
2720
|
case 2:
|
|
2619
2721
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2623,14 +2725,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2623
2725
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2624
2726
|
case 3:
|
|
2625
2727
|
case "end":
|
|
2626
|
-
return
|
|
2728
|
+
return _context48.stop();
|
|
2627
2729
|
}
|
|
2628
|
-
},
|
|
2730
|
+
}, _callee48);
|
|
2629
2731
|
})));
|
|
2630
|
-
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2732
|
+
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50() {
|
|
2631
2733
|
var responsePayload, rejectPayload, roapEvent;
|
|
2632
|
-
return _regenerator.default.wrap(function (
|
|
2633
|
-
while (1) switch (
|
|
2734
|
+
return _regenerator.default.wrap(function (_context50) {
|
|
2735
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2634
2736
|
case 0:
|
|
2635
2737
|
expect.assertions(5);
|
|
2636
2738
|
responsePayload = {
|
|
@@ -2644,24 +2746,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2644
2746
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2645
2747
|
call['held'] = false;
|
|
2646
2748
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2647
|
-
var
|
|
2648
|
-
return _regenerator.default.wrap(function (
|
|
2649
|
-
while (1) switch (
|
|
2749
|
+
var _ref50 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49(errObj) {
|
|
2750
|
+
return _regenerator.default.wrap(function (_context49) {
|
|
2751
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2650
2752
|
case 0:
|
|
2651
2753
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2652
2754
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2653
2755
|
case 1:
|
|
2654
2756
|
case "end":
|
|
2655
|
-
return
|
|
2757
|
+
return _context49.stop();
|
|
2656
2758
|
}
|
|
2657
|
-
},
|
|
2759
|
+
}, _callee49);
|
|
2658
2760
|
}));
|
|
2659
2761
|
return function (_x4) {
|
|
2660
|
-
return
|
|
2762
|
+
return _ref50.apply(this, arguments);
|
|
2661
2763
|
};
|
|
2662
2764
|
}());
|
|
2663
2765
|
call.doHoldResume();
|
|
2664
|
-
|
|
2766
|
+
_context50.next = 1;
|
|
2665
2767
|
return (0, _testUtil.flushPromises)(2);
|
|
2666
2768
|
case 1:
|
|
2667
2769
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2671,7 +2773,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2671
2773
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2672
2774
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2673
2775
|
roapEvent.data.type = 'ANSWER';
|
|
2674
|
-
|
|
2776
|
+
_context50.next = 2;
|
|
2675
2777
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2676
2778
|
case 2:
|
|
2677
2779
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2679,14 +2781,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2679
2781
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2680
2782
|
case 3:
|
|
2681
2783
|
case "end":
|
|
2682
|
-
return
|
|
2784
|
+
return _context50.stop();
|
|
2683
2785
|
}
|
|
2684
|
-
},
|
|
2786
|
+
}, _callee50);
|
|
2685
2787
|
})));
|
|
2686
|
-
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2788
|
+
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51() {
|
|
2687
2789
|
var responsePayload, warnSpy, roapEvent;
|
|
2688
|
-
return _regenerator.default.wrap(function (
|
|
2689
|
-
while (1) switch (
|
|
2790
|
+
return _regenerator.default.wrap(function (_context51) {
|
|
2791
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
2690
2792
|
case 0:
|
|
2691
2793
|
responsePayload = {
|
|
2692
2794
|
statusCode: 200,
|
|
@@ -2697,10 +2799,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2697
2799
|
jest.spyOn(global, 'clearTimeout');
|
|
2698
2800
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2699
2801
|
call['held'] = false;
|
|
2700
|
-
|
|
2802
|
+
_context51.next = 1;
|
|
2701
2803
|
return call.doHoldResume();
|
|
2702
2804
|
case 1:
|
|
2703
|
-
|
|
2805
|
+
_context51.next = 2;
|
|
2704
2806
|
return (0, _testUtil.flushPromises)(2);
|
|
2705
2807
|
case 2:
|
|
2706
2808
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2715,19 +2817,19 @@ describe('Supplementary Services tests', function () {
|
|
|
2715
2817
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2716
2818
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2717
2819
|
roapEvent.data.type = 'ANSWER';
|
|
2718
|
-
|
|
2820
|
+
_context51.next = 3;
|
|
2719
2821
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2720
2822
|
case 3:
|
|
2721
2823
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2722
2824
|
statusCode: 403
|
|
2723
2825
|
});
|
|
2724
2826
|
roapEvent.data.type = 'OK';
|
|
2725
|
-
|
|
2827
|
+
_context51.next = 4;
|
|
2726
2828
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2727
2829
|
case 4:
|
|
2728
2830
|
/* this is for coverage */
|
|
2729
2831
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
2730
|
-
|
|
2832
|
+
_context51.next = 5;
|
|
2731
2833
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2732
2834
|
case 5:
|
|
2733
2835
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -2739,14 +2841,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2739
2841
|
});
|
|
2740
2842
|
case 6:
|
|
2741
2843
|
case "end":
|
|
2742
|
-
return
|
|
2844
|
+
return _context51.stop();
|
|
2743
2845
|
}
|
|
2744
|
-
},
|
|
2846
|
+
}, _callee51);
|
|
2745
2847
|
})));
|
|
2746
|
-
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2848
|
+
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52() {
|
|
2747
2849
|
var responsePayload, warnSpy, roapEvent;
|
|
2748
|
-
return _regenerator.default.wrap(function (
|
|
2749
|
-
while (1) switch (
|
|
2850
|
+
return _regenerator.default.wrap(function (_context52) {
|
|
2851
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
2750
2852
|
case 0:
|
|
2751
2853
|
responsePayload = {
|
|
2752
2854
|
statusCode: 200,
|
|
@@ -2757,10 +2859,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2757
2859
|
jest.spyOn(global, 'clearTimeout');
|
|
2758
2860
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2759
2861
|
call['held'] = true;
|
|
2760
|
-
|
|
2862
|
+
_context52.next = 1;
|
|
2761
2863
|
return call.doHoldResume();
|
|
2762
2864
|
case 1:
|
|
2763
|
-
|
|
2865
|
+
_context52.next = 2;
|
|
2764
2866
|
return (0, _testUtil.flushPromises)(2);
|
|
2765
2867
|
case 2:
|
|
2766
2868
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2775,14 +2877,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2775
2877
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2776
2878
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2777
2879
|
roapEvent.data.type = 'ANSWER';
|
|
2778
|
-
|
|
2880
|
+
_context52.next = 3;
|
|
2779
2881
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2780
2882
|
case 3:
|
|
2781
2883
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
2782
2884
|
statusCode: 403
|
|
2783
2885
|
});
|
|
2784
2886
|
roapEvent.data.type = 'OK';
|
|
2785
|
-
|
|
2887
|
+
_context52.next = 4;
|
|
2786
2888
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2787
2889
|
case 4:
|
|
2788
2890
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2794,14 +2896,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2794
2896
|
});
|
|
2795
2897
|
case 5:
|
|
2796
2898
|
case "end":
|
|
2797
|
-
return
|
|
2899
|
+
return _context52.stop();
|
|
2798
2900
|
}
|
|
2799
|
-
},
|
|
2901
|
+
}, _callee52);
|
|
2800
2902
|
})));
|
|
2801
|
-
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2903
|
+
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54() {
|
|
2802
2904
|
var responsePayload, roapEvent;
|
|
2803
|
-
return _regenerator.default.wrap(function (
|
|
2804
|
-
while (1) switch (
|
|
2905
|
+
return _regenerator.default.wrap(function (_context54) {
|
|
2906
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
2805
2907
|
case 0:
|
|
2806
2908
|
expect.assertions(5);
|
|
2807
2909
|
responsePayload = {
|
|
@@ -2811,25 +2913,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2811
2913
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2812
2914
|
call['held'] = false;
|
|
2813
2915
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
2814
|
-
var
|
|
2815
|
-
return _regenerator.default.wrap(function (
|
|
2816
|
-
while (1) switch (
|
|
2916
|
+
var _ref54 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53(errObj) {
|
|
2917
|
+
return _regenerator.default.wrap(function (_context53) {
|
|
2918
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
2817
2919
|
case 0:
|
|
2818
2920
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2819
2921
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
2820
2922
|
case 1:
|
|
2821
2923
|
case "end":
|
|
2822
|
-
return
|
|
2924
|
+
return _context53.stop();
|
|
2823
2925
|
}
|
|
2824
|
-
},
|
|
2926
|
+
}, _callee53);
|
|
2825
2927
|
}));
|
|
2826
2928
|
return function (_x5) {
|
|
2827
|
-
return
|
|
2929
|
+
return _ref54.apply(this, arguments);
|
|
2828
2930
|
};
|
|
2829
2931
|
}());
|
|
2830
2932
|
jest.runAllTimers();
|
|
2831
2933
|
call.doHoldResume();
|
|
2832
|
-
|
|
2934
|
+
_context54.next = 1;
|
|
2833
2935
|
return (0, _testUtil.flushPromises)(2);
|
|
2834
2936
|
case 1:
|
|
2835
2937
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -2842,11 +2944,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2842
2944
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2843
2945
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2844
2946
|
roapEvent.data.type = 'ANSWER';
|
|
2845
|
-
|
|
2947
|
+
_context54.next = 2;
|
|
2846
2948
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2847
2949
|
case 2:
|
|
2848
2950
|
roapEvent.data.type = 'OK';
|
|
2849
|
-
|
|
2951
|
+
_context54.next = 3;
|
|
2850
2952
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2851
2953
|
case 3:
|
|
2852
2954
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2858,14 +2960,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2858
2960
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2859
2961
|
case 4:
|
|
2860
2962
|
case "end":
|
|
2861
|
-
return
|
|
2963
|
+
return _context54.stop();
|
|
2862
2964
|
}
|
|
2863
|
-
},
|
|
2965
|
+
}, _callee54);
|
|
2864
2966
|
})));
|
|
2865
|
-
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2967
|
+
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56() {
|
|
2866
2968
|
var responsePayload, warnSpy, roapEvent;
|
|
2867
|
-
return _regenerator.default.wrap(function (
|
|
2868
|
-
while (1) switch (
|
|
2969
|
+
return _regenerator.default.wrap(function (_context56) {
|
|
2970
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
2869
2971
|
case 0:
|
|
2870
2972
|
expect.assertions(7);
|
|
2871
2973
|
responsePayload = {
|
|
@@ -2878,25 +2980,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2878
2980
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2879
2981
|
call['held'] = true;
|
|
2880
2982
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2881
|
-
var
|
|
2882
|
-
return _regenerator.default.wrap(function (
|
|
2883
|
-
while (1) switch (
|
|
2983
|
+
var _ref56 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55(correlationId) {
|
|
2984
|
+
return _regenerator.default.wrap(function (_context55) {
|
|
2985
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
2884
2986
|
case 0:
|
|
2885
2987
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2886
2988
|
case 1:
|
|
2887
2989
|
case "end":
|
|
2888
|
-
return
|
|
2990
|
+
return _context55.stop();
|
|
2889
2991
|
}
|
|
2890
|
-
},
|
|
2992
|
+
}, _callee55);
|
|
2891
2993
|
}));
|
|
2892
2994
|
return function (_x6) {
|
|
2893
|
-
return
|
|
2995
|
+
return _ref56.apply(this, arguments);
|
|
2894
2996
|
};
|
|
2895
2997
|
}());
|
|
2896
|
-
|
|
2998
|
+
_context56.next = 1;
|
|
2897
2999
|
return call.doHoldResume();
|
|
2898
3000
|
case 1:
|
|
2899
|
-
|
|
3001
|
+
_context56.next = 2;
|
|
2900
3002
|
return (0, _testUtil.flushPromises)(2);
|
|
2901
3003
|
case 2:
|
|
2902
3004
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2912,11 +3014,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2912
3014
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2913
3015
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2914
3016
|
roapEvent.data.type = 'ANSWER';
|
|
2915
|
-
|
|
3017
|
+
_context56.next = 3;
|
|
2916
3018
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2917
3019
|
case 3:
|
|
2918
3020
|
roapEvent.data.type = 'OK';
|
|
2919
|
-
|
|
3021
|
+
_context56.next = 4;
|
|
2920
3022
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2921
3023
|
case 4:
|
|
2922
3024
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2931,14 +3033,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2931
3033
|
});
|
|
2932
3034
|
case 5:
|
|
2933
3035
|
case "end":
|
|
2934
|
-
return
|
|
3036
|
+
return _context56.stop();
|
|
2935
3037
|
}
|
|
2936
|
-
},
|
|
3038
|
+
}, _callee56);
|
|
2937
3039
|
})));
|
|
2938
|
-
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3040
|
+
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58() {
|
|
2939
3041
|
var responsePayload, warnSpy, roapEvent;
|
|
2940
|
-
return _regenerator.default.wrap(function (
|
|
2941
|
-
while (1) switch (
|
|
3042
|
+
return _regenerator.default.wrap(function (_context58) {
|
|
3043
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
2942
3044
|
case 0:
|
|
2943
3045
|
expect.assertions(7);
|
|
2944
3046
|
responsePayload = {
|
|
@@ -2951,26 +3053,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2951
3053
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2952
3054
|
call['held'] = true;
|
|
2953
3055
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2954
|
-
var
|
|
2955
|
-
return _regenerator.default.wrap(function (
|
|
2956
|
-
while (1) switch (
|
|
3056
|
+
var _ref58 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57(correlationId) {
|
|
3057
|
+
return _regenerator.default.wrap(function (_context57) {
|
|
3058
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
2957
3059
|
case 0:
|
|
2958
3060
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2959
3061
|
case 1:
|
|
2960
3062
|
case "end":
|
|
2961
|
-
return
|
|
3063
|
+
return _context57.stop();
|
|
2962
3064
|
}
|
|
2963
|
-
},
|
|
3065
|
+
}, _callee57);
|
|
2964
3066
|
}));
|
|
2965
3067
|
return function (_x7) {
|
|
2966
|
-
return
|
|
3068
|
+
return _ref58.apply(this, arguments);
|
|
2967
3069
|
};
|
|
2968
3070
|
}());
|
|
2969
3071
|
call.doHoldResume();
|
|
2970
|
-
|
|
3072
|
+
_context58.next = 1;
|
|
2971
3073
|
return _promise.default.resolve();
|
|
2972
3074
|
case 1:
|
|
2973
|
-
|
|
3075
|
+
_context58.next = 2;
|
|
2974
3076
|
return _promise.default.resolve();
|
|
2975
3077
|
case 2:
|
|
2976
3078
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2986,11 +3088,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2986
3088
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2987
3089
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2988
3090
|
roapEvent.data.type = 'ANSWER';
|
|
2989
|
-
|
|
3091
|
+
_context58.next = 3;
|
|
2990
3092
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2991
3093
|
case 3:
|
|
2992
3094
|
roapEvent.data.type = 'OK';
|
|
2993
|
-
|
|
3095
|
+
_context58.next = 4;
|
|
2994
3096
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2995
3097
|
case 4:
|
|
2996
3098
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -3005,14 +3107,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3005
3107
|
});
|
|
3006
3108
|
case 5:
|
|
3007
3109
|
case "end":
|
|
3008
|
-
return
|
|
3110
|
+
return _context58.stop();
|
|
3009
3111
|
}
|
|
3010
|
-
},
|
|
3112
|
+
}, _callee58);
|
|
3011
3113
|
})));
|
|
3012
|
-
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3114
|
+
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60() {
|
|
3013
3115
|
var responsePayload;
|
|
3014
|
-
return _regenerator.default.wrap(function (
|
|
3015
|
-
while (1) switch (
|
|
3116
|
+
return _regenerator.default.wrap(function (_context60) {
|
|
3117
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
3016
3118
|
case 0:
|
|
3017
3119
|
expect.assertions(4);
|
|
3018
3120
|
responsePayload = {
|
|
@@ -3022,26 +3124,26 @@ describe('Supplementary Services tests', function () {
|
|
|
3022
3124
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3023
3125
|
call['held'] = true;
|
|
3024
3126
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3025
|
-
var
|
|
3026
|
-
return _regenerator.default.wrap(function (
|
|
3027
|
-
while (1) switch (
|
|
3127
|
+
var _ref60 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59(errObj) {
|
|
3128
|
+
return _regenerator.default.wrap(function (_context59) {
|
|
3129
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
3028
3130
|
case 0:
|
|
3029
3131
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3030
3132
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3031
3133
|
case 1:
|
|
3032
3134
|
case "end":
|
|
3033
|
-
return
|
|
3135
|
+
return _context59.stop();
|
|
3034
3136
|
}
|
|
3035
|
-
},
|
|
3137
|
+
}, _callee59);
|
|
3036
3138
|
}));
|
|
3037
3139
|
return function (_x8) {
|
|
3038
|
-
return
|
|
3140
|
+
return _ref60.apply(this, arguments);
|
|
3039
3141
|
};
|
|
3040
3142
|
}());
|
|
3041
|
-
|
|
3143
|
+
_context60.next = 1;
|
|
3042
3144
|
return call.doHoldResume();
|
|
3043
3145
|
case 1:
|
|
3044
|
-
|
|
3146
|
+
_context60.next = 2;
|
|
3045
3147
|
return (0, _testUtil.flushPromises)(2);
|
|
3046
3148
|
case 2:
|
|
3047
3149
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3052,14 +3154,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3052
3154
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3053
3155
|
case 3:
|
|
3054
3156
|
case "end":
|
|
3055
|
-
return
|
|
3157
|
+
return _context60.stop();
|
|
3056
3158
|
}
|
|
3057
|
-
},
|
|
3159
|
+
}, _callee60);
|
|
3058
3160
|
})));
|
|
3059
|
-
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3161
|
+
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62() {
|
|
3060
3162
|
var responsePayload, rejectPayload, roapEvent;
|
|
3061
|
-
return _regenerator.default.wrap(function (
|
|
3062
|
-
while (1) switch (
|
|
3163
|
+
return _regenerator.default.wrap(function (_context62) {
|
|
3164
|
+
while (1) switch (_context62.prev = _context62.next) {
|
|
3063
3165
|
case 0:
|
|
3064
3166
|
expect.assertions(5);
|
|
3065
3167
|
responsePayload = {
|
|
@@ -3073,24 +3175,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3073
3175
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
3074
3176
|
call['held'] = true;
|
|
3075
3177
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3076
|
-
var
|
|
3077
|
-
return _regenerator.default.wrap(function (
|
|
3078
|
-
while (1) switch (
|
|
3178
|
+
var _ref62 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61(errObj) {
|
|
3179
|
+
return _regenerator.default.wrap(function (_context61) {
|
|
3180
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
3079
3181
|
case 0:
|
|
3080
3182
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
3081
3183
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
3082
3184
|
case 1:
|
|
3083
3185
|
case "end":
|
|
3084
|
-
return
|
|
3186
|
+
return _context61.stop();
|
|
3085
3187
|
}
|
|
3086
|
-
},
|
|
3188
|
+
}, _callee61);
|
|
3087
3189
|
}));
|
|
3088
3190
|
return function (_x9) {
|
|
3089
|
-
return
|
|
3191
|
+
return _ref62.apply(this, arguments);
|
|
3090
3192
|
};
|
|
3091
3193
|
}());
|
|
3092
3194
|
call.doHoldResume();
|
|
3093
|
-
|
|
3195
|
+
_context62.next = 1;
|
|
3094
3196
|
return (0, _testUtil.flushPromises)(2);
|
|
3095
3197
|
case 1:
|
|
3096
3198
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -3101,7 +3203,7 @@ describe('Supplementary Services tests', function () {
|
|
|
3101
3203
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3102
3204
|
/* We are intentionally failing the ROAP ANSWER */
|
|
3103
3205
|
roapEvent.data.type = 'ANSWER';
|
|
3104
|
-
|
|
3206
|
+
_context62.next = 2;
|
|
3105
3207
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3106
3208
|
case 2:
|
|
3107
3209
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -3109,14 +3211,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3109
3211
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3110
3212
|
case 3:
|
|
3111
3213
|
case "end":
|
|
3112
|
-
return
|
|
3214
|
+
return _context62.stop();
|
|
3113
3215
|
}
|
|
3114
|
-
},
|
|
3216
|
+
}, _callee62);
|
|
3115
3217
|
})));
|
|
3116
|
-
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3218
|
+
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64() {
|
|
3117
3219
|
var responsePayload, roapEvent;
|
|
3118
|
-
return _regenerator.default.wrap(function (
|
|
3119
|
-
while (1) switch (
|
|
3220
|
+
return _regenerator.default.wrap(function (_context64) {
|
|
3221
|
+
while (1) switch (_context64.prev = _context64.next) {
|
|
3120
3222
|
case 0:
|
|
3121
3223
|
expect.assertions(5);
|
|
3122
3224
|
responsePayload = {
|
|
@@ -3126,24 +3228,24 @@ describe('Supplementary Services tests', function () {
|
|
|
3126
3228
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
3127
3229
|
call['held'] = true;
|
|
3128
3230
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
3129
|
-
var
|
|
3130
|
-
return _regenerator.default.wrap(function (
|
|
3131
|
-
while (1) switch (
|
|
3231
|
+
var _ref64 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63(errObj) {
|
|
3232
|
+
return _regenerator.default.wrap(function (_context63) {
|
|
3233
|
+
while (1) switch (_context63.prev = _context63.next) {
|
|
3132
3234
|
case 0:
|
|
3133
3235
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
3134
3236
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
3135
3237
|
case 1:
|
|
3136
3238
|
case "end":
|
|
3137
|
-
return
|
|
3239
|
+
return _context63.stop();
|
|
3138
3240
|
}
|
|
3139
|
-
},
|
|
3241
|
+
}, _callee63);
|
|
3140
3242
|
}));
|
|
3141
3243
|
return function (_x0) {
|
|
3142
|
-
return
|
|
3244
|
+
return _ref64.apply(this, arguments);
|
|
3143
3245
|
};
|
|
3144
3246
|
}());
|
|
3145
3247
|
call.doHoldResume();
|
|
3146
|
-
|
|
3248
|
+
_context64.next = 1;
|
|
3147
3249
|
return (0, _testUtil.flushPromises)(2);
|
|
3148
3250
|
case 1:
|
|
3149
3251
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
@@ -3156,11 +3258,11 @@ describe('Supplementary Services tests', function () {
|
|
|
3156
3258
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
3157
3259
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
3158
3260
|
roapEvent.data.type = 'ANSWER';
|
|
3159
|
-
|
|
3261
|
+
_context64.next = 2;
|
|
3160
3262
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
3161
3263
|
case 2:
|
|
3162
3264
|
roapEvent.data.type = 'OK';
|
|
3163
|
-
|
|
3265
|
+
_context64.next = 3;
|
|
3164
3266
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
3165
3267
|
case 3:
|
|
3166
3268
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -3170,9 +3272,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3170
3272
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
3171
3273
|
case 4:
|
|
3172
3274
|
case "end":
|
|
3173
|
-
return
|
|
3275
|
+
return _context64.stop();
|
|
3174
3276
|
}
|
|
3175
|
-
},
|
|
3277
|
+
}, _callee64);
|
|
3176
3278
|
})));
|
|
3177
3279
|
});
|
|
3178
3280
|
describe('Call transfer tests', function () {
|
|
@@ -3205,10 +3307,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3205
3307
|
secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
|
|
3206
3308
|
secondCall['held'] = false;
|
|
3207
3309
|
});
|
|
3208
|
-
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3310
|
+
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67() {
|
|
3209
3311
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3210
|
-
return _regenerator.default.wrap(function (
|
|
3211
|
-
while (1) switch (
|
|
3312
|
+
return _regenerator.default.wrap(function (_context67) {
|
|
3313
|
+
while (1) switch (_context67.prev = _context67.next) {
|
|
3212
3314
|
case 0:
|
|
3213
3315
|
expect.assertions(12); // Updated to match actual assertion count
|
|
3214
3316
|
responsePayload = {
|
|
@@ -3220,41 +3322,41 @@ describe('Supplementary Services tests', function () {
|
|
|
3220
3322
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3221
3323
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3222
3324
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3223
|
-
var
|
|
3224
|
-
return _regenerator.default.wrap(function (
|
|
3225
|
-
while (1) switch (
|
|
3325
|
+
var _ref66 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65(correlationId) {
|
|
3326
|
+
return _regenerator.default.wrap(function (_context65) {
|
|
3327
|
+
while (1) switch (_context65.prev = _context65.next) {
|
|
3226
3328
|
case 0:
|
|
3227
3329
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3228
3330
|
case 1:
|
|
3229
3331
|
case "end":
|
|
3230
|
-
return
|
|
3332
|
+
return _context65.stop();
|
|
3231
3333
|
}
|
|
3232
|
-
},
|
|
3334
|
+
}, _callee65);
|
|
3233
3335
|
}));
|
|
3234
3336
|
return function (_x1) {
|
|
3235
|
-
return
|
|
3337
|
+
return _ref66.apply(this, arguments);
|
|
3236
3338
|
};
|
|
3237
3339
|
}());
|
|
3238
3340
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3239
|
-
var
|
|
3240
|
-
return _regenerator.default.wrap(function (
|
|
3241
|
-
while (1) switch (
|
|
3341
|
+
var _ref67 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66(correlationId) {
|
|
3342
|
+
return _regenerator.default.wrap(function (_context66) {
|
|
3343
|
+
while (1) switch (_context66.prev = _context66.next) {
|
|
3242
3344
|
case 0:
|
|
3243
3345
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
3244
3346
|
case 1:
|
|
3245
3347
|
case "end":
|
|
3246
|
-
return
|
|
3348
|
+
return _context66.stop();
|
|
3247
3349
|
}
|
|
3248
|
-
},
|
|
3350
|
+
}, _callee66);
|
|
3249
3351
|
}));
|
|
3250
3352
|
return function (_x10) {
|
|
3251
|
-
return
|
|
3353
|
+
return _ref67.apply(this, arguments);
|
|
3252
3354
|
};
|
|
3253
3355
|
}());
|
|
3254
|
-
|
|
3356
|
+
_context67.next = 1;
|
|
3255
3357
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3256
3358
|
case 1:
|
|
3257
|
-
|
|
3359
|
+
_context67.next = 2;
|
|
3258
3360
|
return (0, _testUtil.flushPromises)(2);
|
|
3259
3361
|
case 2:
|
|
3260
3362
|
expect(requestSpy).toBeCalled();
|
|
@@ -3277,14 +3379,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3277
3379
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3278
3380
|
case 3:
|
|
3279
3381
|
case "end":
|
|
3280
|
-
return
|
|
3382
|
+
return _context67.stop();
|
|
3281
3383
|
}
|
|
3282
|
-
},
|
|
3384
|
+
}, _callee67);
|
|
3283
3385
|
})));
|
|
3284
|
-
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3386
|
+
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69() {
|
|
3285
3387
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
3286
|
-
return _regenerator.default.wrap(function (
|
|
3287
|
-
while (1) switch (
|
|
3388
|
+
return _regenerator.default.wrap(function (_context69) {
|
|
3389
|
+
while (1) switch (_context69.prev = _context69.next) {
|
|
3288
3390
|
case 0:
|
|
3289
3391
|
expect.assertions(10); // Updated to match actual assertion count
|
|
3290
3392
|
responsePayload = {
|
|
@@ -3296,25 +3398,25 @@ describe('Supplementary Services tests', function () {
|
|
|
3296
3398
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
3297
3399
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3298
3400
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
3299
|
-
var
|
|
3300
|
-
return _regenerator.default.wrap(function (
|
|
3301
|
-
while (1) switch (
|
|
3401
|
+
var _ref69 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68(correlationId) {
|
|
3402
|
+
return _regenerator.default.wrap(function (_context68) {
|
|
3403
|
+
while (1) switch (_context68.prev = _context68.next) {
|
|
3302
3404
|
case 0:
|
|
3303
3405
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
3304
3406
|
case 1:
|
|
3305
3407
|
case "end":
|
|
3306
|
-
return
|
|
3408
|
+
return _context68.stop();
|
|
3307
3409
|
}
|
|
3308
|
-
},
|
|
3410
|
+
}, _callee68);
|
|
3309
3411
|
}));
|
|
3310
3412
|
return function (_x11) {
|
|
3311
|
-
return
|
|
3413
|
+
return _ref69.apply(this, arguments);
|
|
3312
3414
|
};
|
|
3313
3415
|
}());
|
|
3314
|
-
|
|
3416
|
+
_context69.next = 1;
|
|
3315
3417
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3316
3418
|
case 1:
|
|
3317
|
-
|
|
3419
|
+
_context69.next = 2;
|
|
3318
3420
|
return (0, _testUtil.flushPromises)(2);
|
|
3319
3421
|
case 2:
|
|
3320
3422
|
expect(requestSpy).toBeCalled();
|
|
@@ -3333,14 +3435,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3333
3435
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3334
3436
|
case 3:
|
|
3335
3437
|
case "end":
|
|
3336
|
-
return
|
|
3438
|
+
return _context69.stop();
|
|
3337
3439
|
}
|
|
3338
|
-
},
|
|
3440
|
+
}, _callee69);
|
|
3339
3441
|
})));
|
|
3340
|
-
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3442
|
+
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee70() {
|
|
3341
3443
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3342
|
-
return _regenerator.default.wrap(function (
|
|
3343
|
-
while (1) switch (
|
|
3444
|
+
return _regenerator.default.wrap(function (_context70) {
|
|
3445
|
+
while (1) switch (_context70.prev = _context70.next) {
|
|
3344
3446
|
case 0:
|
|
3345
3447
|
responsePayload = {
|
|
3346
3448
|
statusCode: 403,
|
|
@@ -3351,10 +3453,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3351
3453
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3352
3454
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3353
3455
|
call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
|
|
3354
|
-
|
|
3456
|
+
_context70.next = 1;
|
|
3355
3457
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
3356
3458
|
case 1:
|
|
3357
|
-
|
|
3459
|
+
_context70.next = 2;
|
|
3358
3460
|
return (0, _testUtil.flushPromises)(1);
|
|
3359
3461
|
case 2:
|
|
3360
3462
|
expect(requestSpy).toBeCalled();
|
|
@@ -3375,14 +3477,14 @@ describe('Supplementary Services tests', function () {
|
|
|
3375
3477
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3376
3478
|
case 3:
|
|
3377
3479
|
case "end":
|
|
3378
|
-
return
|
|
3480
|
+
return _context70.stop();
|
|
3379
3481
|
}
|
|
3380
|
-
},
|
|
3482
|
+
}, _callee70);
|
|
3381
3483
|
})));
|
|
3382
|
-
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3484
|
+
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee71() {
|
|
3383
3485
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
3384
|
-
return _regenerator.default.wrap(function (
|
|
3385
|
-
while (1) switch (
|
|
3486
|
+
return _regenerator.default.wrap(function (_context71) {
|
|
3487
|
+
while (1) switch (_context71.prev = _context71.next) {
|
|
3386
3488
|
case 0:
|
|
3387
3489
|
responsePayload = {
|
|
3388
3490
|
statusCode: 403,
|
|
@@ -3392,10 +3494,10 @@ describe('Supplementary Services tests', function () {
|
|
|
3392
3494
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
3393
3495
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3394
3496
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
3395
|
-
|
|
3497
|
+
_context71.next = 1;
|
|
3396
3498
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
3397
3499
|
case 1:
|
|
3398
|
-
|
|
3500
|
+
_context71.next = 2;
|
|
3399
3501
|
return (0, _testUtil.flushPromises)(2);
|
|
3400
3502
|
case 2:
|
|
3401
3503
|
expect(requestSpy).toBeCalled();
|
|
@@ -3416,18 +3518,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3416
3518
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
3417
3519
|
case 3:
|
|
3418
3520
|
case "end":
|
|
3419
|
-
return
|
|
3521
|
+
return _context71.stop();
|
|
3420
3522
|
}
|
|
3421
|
-
},
|
|
3523
|
+
}, _callee71);
|
|
3422
3524
|
})));
|
|
3423
|
-
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3525
|
+
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee72() {
|
|
3424
3526
|
var requestSpy, warnSpy;
|
|
3425
|
-
return _regenerator.default.wrap(function (
|
|
3426
|
-
while (1) switch (
|
|
3527
|
+
return _regenerator.default.wrap(function (_context72) {
|
|
3528
|
+
while (1) switch (_context72.prev = _context72.next) {
|
|
3427
3529
|
case 0:
|
|
3428
3530
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3429
3531
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3430
|
-
|
|
3532
|
+
_context72.next = 1;
|
|
3431
3533
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
3432
3534
|
case 1:
|
|
3433
3535
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3439,18 +3541,18 @@ describe('Supplementary Services tests', function () {
|
|
|
3439
3541
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3440
3542
|
case 2:
|
|
3441
3543
|
case "end":
|
|
3442
|
-
return
|
|
3544
|
+
return _context72.stop();
|
|
3443
3545
|
}
|
|
3444
|
-
},
|
|
3546
|
+
}, _callee72);
|
|
3445
3547
|
})));
|
|
3446
|
-
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3548
|
+
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee73() {
|
|
3447
3549
|
var requestSpy, warnSpy;
|
|
3448
|
-
return _regenerator.default.wrap(function (
|
|
3449
|
-
while (1) switch (
|
|
3550
|
+
return _regenerator.default.wrap(function (_context73) {
|
|
3551
|
+
while (1) switch (_context73.prev = _context73.next) {
|
|
3450
3552
|
case 0:
|
|
3451
3553
|
requestSpy = jest.spyOn(webex, 'request');
|
|
3452
3554
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
3453
|
-
|
|
3555
|
+
_context73.next = 1;
|
|
3454
3556
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
3455
3557
|
case 1:
|
|
3456
3558
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -3462,9 +3564,9 @@ describe('Supplementary Services tests', function () {
|
|
|
3462
3564
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
3463
3565
|
case 2:
|
|
3464
3566
|
case "end":
|
|
3465
|
-
return
|
|
3567
|
+
return _context73.stop();
|
|
3466
3568
|
}
|
|
3467
|
-
},
|
|
3569
|
+
}, _callee73);
|
|
3468
3570
|
})));
|
|
3469
3571
|
});
|
|
3470
3572
|
});
|