@exotel-npm-dev/webrtc-client-sdk 1.0.0 → 1.0.2

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/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './src/listeners/ExWebClient';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exotel-npm-dev/webrtc-client-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "client sdk for webrtc based on webrtc core sdk",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  import { CallDetails } from "./CallDetails";
2
2
  import { webrtcLogger } from "../omAPI/WebrtcLogger"
3
3
 
4
- var webrtcSIPPhone = require('@exotel-npm-dev/webrtc-core-sdk/src/webrtcSIPPhone').webrtcSIPPhone;
4
+ import { webrtcSIPPhone } from '@exotel-npm-dev/webrtc-core-sdk';
5
5
  var logger = webrtcLogger()
6
6
 
7
7
  export function Call() {
@@ -1,7 +1,7 @@
1
1
  import { diagnosticsCallback } from "../../listeners/Callback";
2
2
  import { webrtcLogger } from "./WebrtcLogger"
3
3
 
4
- var webrtcSIPPhone = require('@exotel-npm-dev/webrtc-core-sdk/src/webrtcSIPPhone').webrtcSIPPhone;
4
+ import { webrtcSIPPhone } from '@exotel-npm-dev/webrtc-core-sdk';
5
5
  var logger = webrtcLogger()
6
6
  var speakerNode;
7
7
  var micNode;
@@ -21,7 +21,7 @@ import { sessionCallback } from '../listeners/Callback';
21
21
  import { webrtcTroubleshooterEventBus } from "./Callback";
22
22
 
23
23
  import { webrtcLogger } from "../api/omAPI/WebrtcLogger";
24
- var webrtcSIPPhone = require('@exotel-npm-dev/webrtc-core-sdk/src/webrtcSIPPhone').webrtcSIPPhone;
24
+ import { webrtcSIPPhone } from '@exotel-npm-dev/webrtc-core-sdk';
25
25
 
26
26
  var intervalId;
27
27
  var intervalIDMap = new Map();
@@ -346,11 +346,11 @@ export const ExotelWebClient = {
346
346
  callEventCallback :(event, phone, param) => {
347
347
  logger.log("Dialer: callEventCallback: Received ---> " + event + 'param sent....' + param + 'for phone....' + phone)
348
348
  if (event === "i_new_call") {
349
- callListener.onIncomingCall(param,phone)
349
+ ExotelWebClient.callListener.onIncomingCall(param,phone)
350
350
  } else if (event === "connected") {
351
- callListener.onCallEstablished(param,phone);
351
+ ExotelWebClient.callListener.onCallEstablished(param,phone);
352
352
  } else if (event === "terminated") {
353
- callListener.onCallEnded(param,phone);
353
+ ExotelWebClient.callListener.onCallEnded(param,phone);
354
354
  }
355
355
  },
356
356
 
@@ -386,7 +386,7 @@ export const ExotelWebClient = {
386
386
  sipAccountInfo) => {
387
387
 
388
388
  let wssPort = sipAccountInfo.port;
389
- let wsPort = 4442;
389
+ let wsPort = 8089;
390
390
  ExotelWebClient.sipAccntInfo = {
391
391
  'userName':'',
392
392
  'authUser':'',
@@ -397,6 +397,7 @@ export const ExotelWebClient = {
397
397
  'secret':'',
398
398
  'sipUri':'',
399
399
  'security':'',
400
+ 'endpoint':'',
400
401
  'port':'',
401
402
  'contactHost':''
402
403
  }
@@ -414,7 +415,7 @@ export const ExotelWebClient = {
414
415
  ExotelWebClient.accountSid = 'exotelt1';
415
416
  ExotelWebClient.subscriberToken = sipAccountInfo.secret;
416
417
  ExotelWebClient.secret = ExotelWebClient.password = sipAccountInfo.secret;
417
- ExotelWebClient.security = sipAccountInfo.security;
418
+ ExotelWebClient.endpoint = sipAccountInfo.endpoint;
418
419
  ExotelWebClient.port = sipAccountInfo.port;
419
420
  ExotelWebClient.contactHost = sipAccountInfo.contactHost;
420
421
  ExotelWebClient.sipWsPort = 5061;
@@ -423,23 +424,25 @@ export const ExotelWebClient = {
423
424
  /* Temporary till we figure out the arguments - End */
424
425
 
425
426
  /* This is permanent -Start */
426
- let webrtcPort = wssPort;
427
+ let webrtcPort = wsPort;
427
428
 
428
- if (ExotelWebClient.security === 'ws') {
429
- webrtcPort = wsPort;
430
- }
429
+ if (ExotelWebClient.endpoint === 'wss') {
430
+ ExotelWebClient.security = 'wss';
431
+ webrtcPort = wssPort;
432
+ }
431
433
 
432
434
 
433
435
 
434
- ExotelWebClient.sipAccntInfo['userName'] = userName;
436
+ ExotelWebClient.sipAccntInfo['userName'] = ExotelWebClient.userName;
435
437
  ExotelWebClient.sipAccntInfo['authUser'] = subscriberName;
436
438
  ExotelWebClient.sipAccntInfo['domain'] = hostName;
437
439
  ExotelWebClient.sipAccntInfo['sipdomain'] = ExotelWebClient.sipdomain;
438
- ExotelWebClient.sipAccntInfo['accountName'] = userName;
440
+ ExotelWebClient.sipAccntInfo['accountName'] = ExotelWebClient.userName;
439
441
  ExotelWebClient.sipAccntInfo['secret'] = ExotelWebClient.password;
440
442
  ExotelWebClient.sipAccntInfo['sipuri'] = ExotelWebClient.sipuri;
441
443
  ExotelWebClient.sipAccntInfo['security'] = ExotelWebClient.security;
442
- ExotelWebClient.sipAccntInfo['port'] = ExotelWebClient.webrtcPort;
444
+ ExotelWebClient.sipAccntInfo['endpoint'] = ExotelWebClient.endpoint;
445
+ ExotelWebClient.sipAccntInfo['port'] = webrtcPort;
443
446
  ExotelWebClient.sipAccntInfo['contactHost'] = ExotelWebClient.contactHost;
444
447
  localStorage.setItem('contactHost', ExotelWebClient.contactHost);
445
448
  /* This is permanent -End */
@@ -450,7 +453,7 @@ export const ExotelWebClient = {
450
453
  var synchronousHandler = new ExSynchronousHandler(ExotelWebClient);
451
454
  var delegationHandler = new ExDelegationHandler(ExotelWebClient);
452
455
 
453
- var userName = userName;
456
+ var userName = ExotelWebClient.userName;
454
457
  /* OLD-Way to be revisited for multile phone support */
455
458
  //webRTCPhones[userName] = webRTC;
456
459