@exotel-npm-dev/webrtc-client-sdk 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export default __webpack_public_path__ + "9b002be293af5cfbf781cfd215e3ea86.wav";
@@ -0,0 +1 @@
1
+ export default __webpack_public_path__ + "c79bd9a78f9efa815c0f1b4a5db3a98b.wav";
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@exotel-npm-dev/webrtc-client-sdk",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "client sdk for webrtc based on webrtc core sdk",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "build": "webpack --config webpack.config.js"
8
9
  },
9
10
  "repository": {
10
11
  "type": "git",
@@ -21,5 +22,13 @@
21
22
  "homepage": "https://bitbucket.org/Exotel/webrtc#readme",
22
23
  "dependencies": {
23
24
  "@exotel-npm-dev/webrtc-core-sdk": "^1.0.0"
25
+ },
26
+ "devDependencies": {
27
+ "babel-loader": "^8.2.5",
28
+ "circular-dependency-plugin": "^5.2.2",
29
+ "file-loader": "^6.2.0",
30
+ "uuid": "^9.0.0",
31
+ "webpack": "^5.74.0",
32
+ "webpack-cli": "^4.10.0"
24
33
  }
25
34
  }
@@ -87,7 +87,7 @@ export function ExDelegationHandler(exClient_) {
87
87
  if (sipMethod == "CONNECTION") {
88
88
  exClient.registerEventCallback(eventType, exClient.userName)
89
89
  } else if (sipMethod == "CALL") {
90
- exClient.callEventCallback(eventType, exClient.userName,exClient.call)
90
+ exClient.callEventCallback(eventType, exClient.callFromNumber,exClient.call)
91
91
  }
92
92
  }
93
93
 
@@ -155,8 +155,9 @@ export function ExDelegationHandler(exClient_) {
155
155
  logger.log("delegationHandler: stopCallStat\n");
156
156
  }
157
157
 
158
- this.onRecieveInvite = function() {
158
+ this.onRecieveInvite = function(incomingSession) {
159
159
  logger.log("delegationHandler: onRecieveInvite\n");
160
+ exClient.callFromNumber = incomingSession.incomingInviteRequest.message.from.displayName;
160
161
  }
161
162
 
162
163
  this.onPickCall = function() {
@@ -203,6 +204,7 @@ export class ExotelWebClient {
203
204
  call = null;
204
205
  eventListener = null;
205
206
  callListener = null;
207
+ callFromNumber = null;
206
208
  /* OLD-Way to be revisited for multile phone support */
207
209
  //this.webRTCPhones = {};
208
210
 
@@ -0,0 +1,75 @@
1
+ const path = require('path');
2
+ var webpack = require('webpack');
3
+ var TerserPlugin = require('terser-webpack-plugin');
4
+ const CircularDependencyPlugin = require('circular-dependency-plugin')
5
+
6
+ var pkg = require('./package.json');
7
+ var banner = '\
8
+ \n\
9
+ WebRTC CLient SIP version ' + pkg.version + '\n\
10
+ ';
11
+
12
+ module.exports = {
13
+ entry: {
14
+ exotelsdk: './index.js'
15
+ },
16
+ devtool: 'source-map',
17
+ mode: 'development',
18
+ output: {
19
+ filename:'[name].js',
20
+ path: path.resolve(__dirname, 'dist'),
21
+ libraryTarget: 'umd',
22
+ library: 'exotelSDK',
23
+ globalObject: 'this',
24
+ assetModuleFilename: '[name][ext][query]'
25
+ },
26
+ module: {
27
+ rules: [
28
+ { test: /\.wav$/,exclude: /node_modules/, use: 'file-loader',type: 'asset/resource' },
29
+ {
30
+ test: /\.ts$/,
31
+ exclude: /node_modules/,
32
+ loader: "ts-loader",
33
+ options: {
34
+ compilerOptions: {
35
+ "declaration": false,
36
+ "declarationMap": false,
37
+ "outDir": path.resolve(__dirname, 'dist')
38
+ }
39
+ }
40
+ },
41
+ {
42
+ test: /\.(js)$/,
43
+ exclude: /node_modules/,
44
+ use: 'babel-loader',
45
+ }
46
+ ],
47
+ },
48
+ resolve: {
49
+ extensions: ['.ts', '.d.ts', '.js']
50
+ },
51
+ optimization: {
52
+ minimizer: [
53
+ new TerserPlugin({
54
+ terserOptions: {
55
+ output: {
56
+ ascii_only: true
57
+ }
58
+ }
59
+ })
60
+ ]
61
+ },
62
+ plugins: [
63
+ new CircularDependencyPlugin({
64
+ // exclude detection of files based on a RegExp
65
+ exclude: /a\.js|node_modules/,
66
+ // add errors to webpack instead of warnings
67
+ failOnError: true,
68
+ // set the current working directory for displaying module paths
69
+ cwd: process.cwd(),
70
+ }),
71
+ new webpack.BannerPlugin({
72
+ banner: banner
73
+ })
74
+ ]
75
+ };