@wazo/sdk 0.38.4 → 0.38.5

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 (50) hide show
  1. package/README.md +3 -3
  2. package/dist/wazo-sdk.js +2 -2
  3. package/esm/__tests__/web-rtc-client.test.js +8 -0
  4. package/esm/checker/Checker.js +8 -0
  5. package/esm/checker/checks/index.js +8 -0
  6. package/esm/checker/checks/webrtc-transport.js +8 -0
  7. package/esm/checker/checks/webrtc.js +8 -0
  8. package/esm/domain/__tests__/Line.test.js +5 -5
  9. package/esm/index.js +9 -2
  10. package/esm/lib/WazoSessionDescriptionHandler.js +8 -0
  11. package/esm/simple/Auth.js +9 -2
  12. package/esm/simple/Configuration.js +9 -2
  13. package/esm/simple/Phone.js +9 -2
  14. package/esm/simple/Softphone.js +1 -2
  15. package/esm/simple/index.js +9 -2
  16. package/esm/simple/room/LocalParticipant.js +9 -2
  17. package/esm/simple/room/Participant.js +9 -2
  18. package/esm/simple/room/RemoteParticipant.js +9 -2
  19. package/esm/simple/room/Room.js +9 -2
  20. package/esm/simple/room/SipRoom.js +9 -2
  21. package/esm/simple/room/Stream.js +9 -2
  22. package/esm/simple/room/__tests__/RemoteParticipant.test.js +9 -2
  23. package/esm/simple/utils.js +9 -2
  24. package/esm/web-rtc-client.js +8 -0
  25. package/lib/__tests__/web-rtc-client.test.js +8 -0
  26. package/lib/checker/Checker.js +8 -0
  27. package/lib/checker/checks/index.js +8 -0
  28. package/lib/checker/checks/webrtc-transport.js +8 -0
  29. package/lib/checker/checks/webrtc.js +8 -0
  30. package/lib/domain/__tests__/Line.test.js +5 -5
  31. package/lib/index.js +9 -2
  32. package/lib/lib/WazoSessionDescriptionHandler.js +8 -0
  33. package/lib/simple/Auth.js +9 -2
  34. package/lib/simple/Configuration.js +9 -2
  35. package/lib/simple/Phone.js +9 -2
  36. package/lib/simple/Softphone.js +1 -2
  37. package/lib/simple/index.js +9 -2
  38. package/lib/simple/room/LocalParticipant.js +9 -2
  39. package/lib/simple/room/Participant.js +9 -2
  40. package/lib/simple/room/RemoteParticipant.js +9 -2
  41. package/lib/simple/room/Room.js +9 -2
  42. package/lib/simple/room/SipRoom.js +9 -2
  43. package/lib/simple/room/Stream.js +9 -2
  44. package/lib/simple/room/__tests__/RemoteParticipant.test.js +9 -2
  45. package/lib/simple/utils.js +9 -2
  46. package/lib/web-rtc-client.js +8 -0
  47. package/package.json +1 -1
  48. package/src/domain/__tests__/Line.test.js +5 -5
  49. package/src/lib/WazoSessionDescriptionHandler.js +8 -0
  50. package/src/simple/Softphone.js +1 -2
package/lib/index.js CHANGED
@@ -5828,6 +5828,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
5828
5828
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
5829
5829
  if (event.candidate) {
5830
5830
  this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
5831
+
5832
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
5833
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
5834
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
5835
+ ice: event.candidate.candidate,
5836
+ });
5837
+ this.iceGatheringComplete();
5838
+ }
5831
5839
  }
5832
5840
  };
5833
5841
 
@@ -14240,8 +14248,7 @@ class Softphone {
14240
14248
  window.addEventListener('message', this._onMessage.bind(this), false);
14241
14249
 
14242
14250
  if (!server) {
14243
- // eslint-disable-next-line no-param-reassign
14244
- server = 'stack.dev.wazo.io';
14251
+ throw new Error('`server` is not set');
14245
14252
  }
14246
14253
 
14247
14254
  const config = { server };
@@ -550,6 +550,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
550
550
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
551
551
  if (event.candidate) {
552
552
  this.gatheredCandidates.push(parseCandidate(event.candidate.candidate));
553
+
554
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
555
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
556
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
557
+ ice: event.candidate.candidate,
558
+ });
559
+ this.iceGatheringComplete();
560
+ }
553
561
  }
554
562
  };
555
563
 
@@ -6007,6 +6007,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
6007
6007
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
6008
6008
  if (event.candidate) {
6009
6009
  this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
6010
+
6011
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
6012
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
6013
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
6014
+ ice: event.candidate.candidate,
6015
+ });
6016
+ this.iceGatheringComplete();
6017
+ }
6010
6018
  }
6011
6019
  };
6012
6020
 
@@ -13802,8 +13810,7 @@ class Softphone {
13802
13810
  window.addEventListener('message', this._onMessage.bind(this), false);
13803
13811
 
13804
13812
  if (!server) {
13805
- // eslint-disable-next-line no-param-reassign
13806
- server = 'stack.dev.wazo.io';
13813
+ throw new Error('`server` is not set');
13807
13814
  }
13808
13815
 
13809
13816
  const config = { server };
@@ -6005,6 +6005,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
6005
6005
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
6006
6006
  if (event.candidate) {
6007
6007
  this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
6008
+
6009
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
6010
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
6011
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
6012
+ ice: event.candidate.candidate,
6013
+ });
6014
+ this.iceGatheringComplete();
6015
+ }
6008
6016
  }
6009
6017
  };
6010
6018
 
@@ -13783,8 +13791,7 @@ class Softphone {
13783
13791
  window.addEventListener('message', this._onMessage.bind(this), false);
13784
13792
 
13785
13793
  if (!server) {
13786
- // eslint-disable-next-line no-param-reassign
13787
- server = 'stack.dev.wazo.io';
13794
+ throw new Error('`server` is not set');
13788
13795
  }
13789
13796
 
13790
13797
  const config = { server };
@@ -6005,6 +6005,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
6005
6005
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
6006
6006
  if (event.candidate) {
6007
6007
  this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
6008
+
6009
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
6010
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
6011
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
6012
+ ice: event.candidate.candidate,
6013
+ });
6014
+ this.iceGatheringComplete();
6015
+ }
6008
6016
  }
6009
6017
  };
6010
6018
 
@@ -13691,8 +13699,7 @@ class Softphone {
13691
13699
  window.addEventListener('message', this._onMessage.bind(this), false);
13692
13700
 
13693
13701
  if (!server) {
13694
- // eslint-disable-next-line no-param-reassign
13695
- server = 'stack.dev.wazo.io';
13702
+ throw new Error('`server` is not set');
13696
13703
  }
13697
13704
 
13698
13705
  const config = { server };
@@ -122,8 +122,7 @@ class Softphone {
122
122
  window.addEventListener('message', this._onMessage.bind(this), false);
123
123
 
124
124
  if (!server) {
125
- // eslint-disable-next-line no-param-reassign
126
- server = 'stack.dev.wazo.io';
125
+ throw new Error('`server` is not set');
127
126
  }
128
127
 
129
128
  const config = { server };
@@ -6306,6 +6306,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
6306
6306
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
6307
6307
  if (event.candidate) {
6308
6308
  this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
6309
+
6310
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
6311
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
6312
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
6313
+ ice: event.candidate.candidate,
6314
+ });
6315
+ this.iceGatheringComplete();
6316
+ }
6309
6317
  }
6310
6318
  };
6311
6319
 
@@ -14101,8 +14109,7 @@ class Softphone {
14101
14109
  window.addEventListener('message', this._onMessage.bind(this), false);
14102
14110
 
14103
14111
  if (!server) {
14104
- // eslint-disable-next-line no-param-reassign
14105
- server = 'stack.dev.wazo.io';
14112
+ throw new Error('`server` is not set');
14106
14113
  }
14107
14114
 
14108
14115
  const config = { server };
@@ -6306,6 +6306,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
6306
6306
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
6307
6307
  if (event.candidate) {
6308
6308
  this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
6309
+
6310
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
6311
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
6312
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
6313
+ ice: event.candidate.candidate,
6314
+ });
6315
+ this.iceGatheringComplete();
6316
+ }
6309
6317
  }
6310
6318
  };
6311
6319
 
@@ -12970,8 +12978,7 @@ class Softphone {
12970
12978
  window.addEventListener('message', this._onMessage.bind(this), false);
12971
12979
 
12972
12980
  if (!server) {
12973
- // eslint-disable-next-line no-param-reassign
12974
- server = 'stack.dev.wazo.io';
12981
+ throw new Error('`server` is not set');
12975
12982
  }
12976
12983
 
12977
12984
  const config = { server };
@@ -6306,6 +6306,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
6306
6306
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
6307
6307
  if (event.candidate) {
6308
6308
  this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
6309
+
6310
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
6311
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
6312
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
6313
+ ice: event.candidate.candidate,
6314
+ });
6315
+ this.iceGatheringComplete();
6316
+ }
6309
6317
  }
6310
6318
  };
6311
6319
 
@@ -12975,8 +12983,7 @@ class Softphone {
12975
12983
  window.addEventListener('message', this._onMessage.bind(this), false);
12976
12984
 
12977
12985
  if (!server) {
12978
- // eslint-disable-next-line no-param-reassign
12979
- server = 'stack.dev.wazo.io';
12986
+ throw new Error('`server` is not set');
12980
12987
  }
12981
12988
 
12982
12989
  const config = { server };
@@ -6306,6 +6306,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
6306
6306
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
6307
6307
  if (event.candidate) {
6308
6308
  this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
6309
+
6310
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
6311
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
6312
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
6313
+ ice: event.candidate.candidate,
6314
+ });
6315
+ this.iceGatheringComplete();
6316
+ }
6309
6317
  }
6310
6318
  };
6311
6319
 
@@ -13254,8 +13262,7 @@ class Softphone {
13254
13262
  window.addEventListener('message', this._onMessage.bind(this), false);
13255
13263
 
13256
13264
  if (!server) {
13257
- // eslint-disable-next-line no-param-reassign
13258
- server = 'stack.dev.wazo.io';
13265
+ throw new Error('`server` is not set');
13259
13266
  }
13260
13267
 
13261
13268
  const config = { server };
@@ -6308,6 +6308,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
6308
6308
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
6309
6309
  if (event.candidate) {
6310
6310
  this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
6311
+
6312
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
6313
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
6314
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
6315
+ ice: event.candidate.candidate,
6316
+ });
6317
+ this.iceGatheringComplete();
6318
+ }
6311
6319
  }
6312
6320
  };
6313
6321
 
@@ -13267,8 +13275,7 @@ class Softphone {
13267
13275
  window.addEventListener('message', this._onMessage.bind(this), false);
13268
13276
 
13269
13277
  if (!server) {
13270
- // eslint-disable-next-line no-param-reassign
13271
- server = 'stack.dev.wazo.io';
13278
+ throw new Error('`server` is not set');
13272
13279
  }
13273
13280
 
13274
13281
  const config = { server };
@@ -6306,6 +6306,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
6306
6306
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
6307
6307
  if (event.candidate) {
6308
6308
  this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
6309
+
6310
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
6311
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
6312
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
6313
+ ice: event.candidate.candidate,
6314
+ });
6315
+ this.iceGatheringComplete();
6316
+ }
6309
6317
  }
6310
6318
  };
6311
6319
 
@@ -13962,8 +13970,7 @@ class Softphone {
13962
13970
  window.addEventListener('message', this._onMessage.bind(this), false);
13963
13971
 
13964
13972
  if (!server) {
13965
- // eslint-disable-next-line no-param-reassign
13966
- server = 'stack.dev.wazo.io';
13973
+ throw new Error('`server` is not set');
13967
13974
  }
13968
13975
 
13969
13976
  const config = { server };
@@ -6306,6 +6306,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
6306
6306
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
6307
6307
  if (event.candidate) {
6308
6308
  this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
6309
+
6310
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
6311
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
6312
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
6313
+ ice: event.candidate.candidate,
6314
+ });
6315
+ this.iceGatheringComplete();
6316
+ }
6309
6317
  }
6310
6318
  };
6311
6319
 
@@ -14043,8 +14051,7 @@ class Softphone {
14043
14051
  window.addEventListener('message', this._onMessage.bind(this), false);
14044
14052
 
14045
14053
  if (!server) {
14046
- // eslint-disable-next-line no-param-reassign
14047
- server = 'stack.dev.wazo.io';
14054
+ throw new Error('`server` is not set');
14048
14055
  }
14049
14056
 
14050
14057
  const config = { server };
@@ -6306,6 +6306,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
6306
6306
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
6307
6307
  if (event.candidate) {
6308
6308
  this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
6309
+
6310
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
6311
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
6312
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
6313
+ ice: event.candidate.candidate,
6314
+ });
6315
+ this.iceGatheringComplete();
6316
+ }
6309
6317
  }
6310
6318
  };
6311
6319
 
@@ -14101,8 +14109,7 @@ class Softphone {
14101
14109
  window.addEventListener('message', this._onMessage.bind(this), false);
14102
14110
 
14103
14111
  if (!server) {
14104
- // eslint-disable-next-line no-param-reassign
14105
- server = 'stack.dev.wazo.io';
14112
+ throw new Error('`server` is not set');
14106
14113
  }
14107
14114
 
14108
14115
  const config = { server };
@@ -6308,6 +6308,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
6308
6308
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
6309
6309
  if (event.candidate) {
6310
6310
  this.gatheredCandidates.push(parseCandidate$1(event.candidate.candidate));
6311
+
6312
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
6313
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
6314
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
6315
+ ice: event.candidate.candidate,
6316
+ });
6317
+ this.iceGatheringComplete();
6318
+ }
6311
6319
  }
6312
6320
  };
6313
6321
 
@@ -14087,8 +14095,7 @@ class Softphone {
14087
14095
  window.addEventListener('message', this._onMessage.bind(this), false);
14088
14096
 
14089
14097
  if (!server) {
14090
- // eslint-disable-next-line no-param-reassign
14091
- server = 'stack.dev.wazo.io';
14098
+ throw new Error('`server` is not set');
14092
14099
  }
14093
14100
 
14094
14101
  const config = { server };
@@ -887,6 +887,14 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
887
887
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
888
888
  if (event.candidate) {
889
889
  this.gatheredCandidates.push(parseCandidate(event.candidate.candidate));
890
+
891
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
892
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
893
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
894
+ ice: event.candidate.candidate,
895
+ });
896
+ this.iceGatheringComplete();
897
+ }
890
898
  }
891
899
  };
892
900
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wazo/sdk",
3
- "version": "0.38.4",
3
+ "version": "0.38.5",
4
4
  "description": "Wazo's JavaScript Software Development Kit.",
5
5
  "main": "dist/wazo-sdk.js",
6
6
  "author": "Wazo (http://wazo.io)",
@@ -11,7 +11,7 @@ describe('Line domain', () => {
11
11
  username: 'ipcor1pj',
12
12
  links: [
13
13
  {
14
- href: 'https://stack.dev.wazo.io/api/confd/1.1/endpoints/sip/19',
14
+ href: 'https://stack.example.com/api/confd/1.1/endpoints/sip/19',
15
15
  rel: 'endpoint_sip',
16
16
  },
17
17
  ],
@@ -25,7 +25,7 @@ describe('Line domain', () => {
25
25
  context: 'default',
26
26
  links: [
27
27
  {
28
- href: 'https://stack.dev.wazo.io/api/confd/1.1/extensions/59',
28
+ href: 'https://stack.example.com/api/confd/1.1/extensions/59',
29
29
  rel: 'extensions',
30
30
  },
31
31
  ],
@@ -33,7 +33,7 @@ describe('Line domain', () => {
33
33
  ],
34
34
  links: [
35
35
  {
36
- href: 'https://stack.dev.wazo.io/api/confd/1.1/lines/8',
36
+ href: 'https://stack.example.com/api/confd/1.1/lines/8',
37
37
  rel: 'lines',
38
38
  },
39
39
  ],
@@ -51,7 +51,7 @@ describe('Line domain', () => {
51
51
  context: 'default',
52
52
  links: [
53
53
  {
54
- href: 'https://stack.dev.wazo.io/api/confd/1.1/extensions/59',
54
+ href: 'https://stack.example.com/api/confd/1.1/extensions/59',
55
55
  rel: 'extensions',
56
56
  },
57
57
  ],
@@ -61,7 +61,7 @@ describe('Line domain', () => {
61
61
  id: 19,
62
62
  links: [
63
63
  {
64
- href: 'https://stack.dev.wazo.io/api/confd/1.1/endpoints/sip/19',
64
+ href: 'https://stack.example.com/api/confd/1.1/endpoints/sip/19',
65
65
  rel: 'endpoint_sip',
66
66
  },
67
67
  ],
@@ -110,6 +110,14 @@ class WazoSessionDescriptionHandler extends SessionDescriptionHandler {
110
110
  wazoLogger.trace('onicecandidate', event.candidate ? event.candidate.candidate : { done: true });
111
111
  if (event.candidate) {
112
112
  this.gatheredCandidates.push(parseCandidate(event.candidate.candidate));
113
+
114
+ // When receiving a `srflx` or a `relay` candidate, consider the negotiation done.
115
+ if (event.candidate.candidate.indexOf('srflx') !== -1 || event.candidate.candidate.indexOf('relay') !== -1) {
116
+ wazoLogger.info('A valid ice was found, triggering ice gathering complete callback.', {
117
+ ice: event.candidate.candidate,
118
+ });
119
+ this.iceGatheringComplete();
120
+ }
113
121
  }
114
122
  };
115
123
 
@@ -120,8 +120,7 @@ class Softphone {
120
120
  window.addEventListener('message', this._onMessage.bind(this), false);
121
121
 
122
122
  if (!server) {
123
- // eslint-disable-next-line no-param-reassign
124
- server = 'stack.dev.wazo.io';
123
+ throw new Error('`server` is not set');
125
124
  }
126
125
 
127
126
  const config: Object = { server };