@exotel-npm-dev/webrtc-client-sdk 1.0.8 → 1.0.10

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.
Binary file
package/dist/ringtone.wav CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exotel-npm-dev/webrtc-client-sdk",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "client sdk for webrtc based on webrtc core sdk",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "homepage": "https://bitbucket.org/Exotel/webrtc#readme",
23
23
  "dependencies": {
24
- "@exotel-npm-dev/webrtc-core-sdk": "^1.0.7"
24
+ "@exotel-npm-dev/webrtc-core-sdk": "^1.0.10"
25
25
  },
26
26
  "devDependencies": {
27
27
  "babel-loader": "^8.2.5",
@@ -4,8 +4,8 @@ import { webrtcLogger } from "../omAPI/WebrtcLogger"
4
4
  import { webrtcSIPPhone } from '@exotel-npm-dev/webrtc-core-sdk';
5
5
  var logger = webrtcLogger()
6
6
 
7
- export function Call() {
8
- this.Answer = function() {
7
+ export function Call() {
8
+ this.Answer = function () {
9
9
  /**
10
10
  * When agent accepts phone, add appropriate msg to be sent to webclient
11
11
  */
@@ -13,7 +13,7 @@ export function Call() {
13
13
  webrtcSIPPhone.pickCall();
14
14
  }
15
15
 
16
- this.Hangup = function() {
16
+ this.Hangup = function () {
17
17
  /**
18
18
  * When call is terminated
19
19
  */
@@ -21,7 +21,7 @@ export function Call() {
21
21
  webrtcSIPPhone.rejectCall();
22
22
  }
23
23
 
24
- this.MuteToggle = function() {
24
+ this.MuteToggle = function () {
25
25
  /**
26
26
  * When agent clicks on mute
27
27
  */
@@ -30,7 +30,7 @@ export function Call() {
30
30
  webrtcSIPPhone.webRTCMuteUnmute(null);
31
31
  }
32
32
 
33
- this.Mute = function() {
33
+ this.Mute = function () {
34
34
  /**
35
35
  * When agent clicks on mute
36
36
  */
@@ -39,7 +39,7 @@ export function Call() {
39
39
  webrtcSIPPhone.webRTCMuteUnmute(dummyFlag);
40
40
  }
41
41
 
42
- this.UnMute = function() {
42
+ this.UnMute = function () {
43
43
  /**
44
44
  * When agent clicks on mute
45
45
  */
@@ -48,7 +48,7 @@ export function Call() {
48
48
  webrtcSIPPhone.webRTCMuteUnmute(dummyFlag);
49
49
  }
50
50
 
51
- this.HoldToggle = function() {
51
+ this.HoldToggle = function () {
52
52
  /**
53
53
  * When user clicks on hold
54
54
  */
@@ -56,7 +56,7 @@ export function Call() {
56
56
  webrtcSIPPhone.holdCall();
57
57
  }
58
58
 
59
- this.Hold = function() {
59
+ this.Hold = function () {
60
60
  /**
61
61
  * When user clicks on hold
62
62
  */
@@ -65,19 +65,27 @@ export function Call() {
65
65
  webrtcSIPPhone.holdCall();
66
66
  }
67
67
 
68
- this.UnHold = function() {
68
+ this.UnHold = function () {
69
69
  /**
70
70
  * When user clicks on hold
71
71
  */
72
- logger.log('unhold clicked')
73
- let dummyFlag = true;
74
- webrtcSIPPhone.holdCall();
72
+ logger.log('unhold clicked')
73
+ let dummyFlag = true;
74
+ webrtcSIPPhone.holdCall();
75
75
  }
76
76
 
77
- this.callDetails = function() {
77
+ this.callDetails = function () {
78
78
  /**
79
79
  * return call details object here
80
80
  */
81
81
  return CallDetails.getCallDetails();
82
82
  }
83
+
84
+ this.sendDTMF = function (digit) {
85
+ /**
86
+ * sends dtmf digit as SIP info over websocket
87
+ */
88
+ logger.log("trying to send dtmf " + digit);
89
+ webrtcSIPPhone.sendDTMFWebRTC(digit);
90
+ }
83
91
  }
@@ -482,7 +482,7 @@ export class ExotelWebClient {
482
482
  transportState = transportState.toLowerCase();
483
483
  switch (transportState) {
484
484
  case "":
485
- callback("not_intialized");
485
+ callback("not_initialized");
486
486
  break;
487
487
  case "unknown":
488
488
  case "connecting":
@@ -1,37 +0,0 @@
1
- # Demonstrations
2
-
3
- ## Building
4
-
5
- index.html require exotel sdk bundle.
6
-
7
- Steps to generating webrtc core bundle.
8
-
9
- * go to webrtc client sdk
10
-
11
- `cd <path>/webrtc-client-sdk`
12
-
13
- * generate core bundle
14
-
15
- ```
16
- npm install
17
- npm run build
18
- ```
19
-
20
- * `exotelsdk.js` will generate in `dist` directory along with wav files.
21
-
22
- ## Running
23
-
24
- The demos will run in Chrome, Firefox, or other web browsers which supports WebRTC.
25
-
26
- In your web browser, open the `index.html` file in this directory to run the demos.
27
-
28
-
29
- ## Development
30
-
31
- This demonstration are build on simple html which provides some basic functionality via a simple interface.
32
-
33
- ## Issues
34
- ### ringtone not playing
35
-
36
- 1. remove the wav files from `../dist/`.
37
- 2. copy the wav files from `assets/sounds` and paste to `../dist/`.
Binary file
@@ -1,4 +0,0 @@
1
- #openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
2
-
3
- rm -rf dist;cd ..;npm uninstall @exotel-npm-dev/webrtc-core-sdk;npm install ../webrtc-core-sdk;npm run build;cp -r dist demo-non-npm/;cd demo-non-npm;
4
- http-server -S -C ~/pki/cert.pem -K ~/pki/key.pem
@@ -1,21 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIDazCCAlOgAwIBAgIUPnkjfhKE3f0E3XyUc/6/pMVL4QMwDQYJKoZIhvcNAQEL
3
- BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
4
- GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMzA4MjQxNzU0NDJaFw0zMzA4
5
- MjExNzU0NDJaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw
6
- HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB
7
- AQUAA4IBDwAwggEKAoIBAQDks953etyaeo1SpyY9mXMUtYiSJyOoGfKw27Tp8Pq1
8
- 5J5jdgJaBjpfkypol+GqIHBuwu1jBv1xu5f08hiAsiqPITC/Kf7KiZV6FxJUdAr3
9
- CFgF0Aec1h10V9N7dpAxFEMmwqiRIpYj+if2kkrOT08OliiH42g4RlZTxUWc2HQz
10
- rnfXm3lqqJ6C1g0xcYFCGJwLyh+YpY9uTY4GKJQStRsK4ku6Czl6JkXpVVM+4POj
11
- Eg8qolZJ9txpdGpTaRHA/dH2dDhgwi+EqIeZwc2ZkTiiNsIe8G3Xc2SR4M270Z47
12
- 09ZbzqHHEDCD13YR7NtAtz3zickd04dB/Ib5Z5944FnzAgMBAAGjUzBRMB0GA1Ud
13
- DgQWBBQ2bhbIwJnqZT9c8te1qKayUznotjAfBgNVHSMEGDAWgBQ2bhbIwJnqZT9c
14
- 8te1qKayUznotjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQDE
15
- YEcuaKrHnEApFfEktH2Q5g7Ps2KzH+K2HpAMFSTTAEiiEroahJFeAbmk7LTPg1Hz
16
- JFXUECblPyJGNYjQ/qCbs0I/wva1FhAvixX4c66MuVFKOPzr0iv0bQqff7k0iQgw
17
- jI1ikFgwADlbEZ3oFs3ylu34rbiEBfQGVJvaDTmWpfTT9UEmv5HybcFA8NBHVoFs
18
- JwoSD19ULLwql5oc9ZTcZ4dDb6w7gPU/IJzR+Mfn0Pbnq1STU+jr5ldggh5MWx2G
19
- Q6Xe/PG8S6pt6f4Yjv5ocBAQLTcduHTvo0PazfFGeLPFixhx7Ddr5YHcR05mJTj5
20
- 08LEywwyxNoUd/Gb2jFd
21
- -----END CERTIFICATE-----
@@ -1,86 +0,0 @@
1
- const exWebClient = new exotelSDK.ExotelWebClient();
2
- var call = null;
3
- function UserAgentRegistration() {
4
- var sipInfo = JSON.parse(phone)[0];
5
- var sipAccountInfo = {
6
- 'userName': sipInfo.Username,
7
- 'authUser': sipInfo.Username,
8
- 'sipdomain': sipInfo.Domain,
9
- 'domain': sipInfo.HostServer + ":" + sipInfo.Port,
10
- 'displayname': sipInfo.DisplayName,
11
- 'secret': sipInfo.Password,
12
- 'port': sipInfo.Port,
13
- 'security': sipInfo.Security,
14
- 'endpoint': sipInfo.EndPoint
15
- };
16
- exWebClient.initWebrtc(sipAccountInfo, RegisterEventCallBack, CallListenerCallback, SessionCallback)
17
- console.log("Test.js: Calling DoRegister")
18
- exWebClient.DoRegister();
19
- }
20
-
21
- function registerToggle() {
22
- if (document.getElementById("registerButton").innerHTML === "REGISTER") {
23
- UserAgentRegistration();
24
- } else {
25
- exWebClient.unregister();
26
- }
27
- }
28
-
29
- function CallListenerCallback(callObj, eventType, phone) {
30
- call = exWebClient.getCall();
31
- document.getElementById("call_status").innerHTML = eventType + " " + phone;
32
- }
33
-
34
- function RegisterEventCallBack(state, phone) {
35
- document.getElementById("status").innerHTML = state;
36
- if (state === 'registered') {
37
- document.getElementById("registerButton").innerHTML = "UNREGISTER";
38
- } else {
39
- document.getElementById("registerButton").innerHTML = "REGISTER";
40
- }
41
-
42
- }
43
-
44
- function SessionCallback(state, phone) {
45
- console.log('Session state:', state, 'for number...', phone);
46
- }
47
-
48
- function toggleMuteButton() {
49
- if (call) {
50
- call.Mute();
51
- if (document.getElementById("muteButton").innerHTML === "UNMUTE") {
52
- document.getElementById("muteButton").innerHTML = "MUTE";
53
- } else {
54
- document.getElementById("muteButton").innerHTML = "UNMUTE";
55
- }
56
- }
57
- }
58
-
59
- function acceptCall() {
60
- if (call) {
61
- call.Answer();
62
- }
63
- }
64
-
65
- function rejectCall() {
66
- if (call) {
67
- call.Hangup();
68
- }
69
- }
70
-
71
- function toggleHoldButton() {
72
- if (call) {
73
- call.HoldToggle();
74
- if (document.getElementById("holdButton").innerHTML === "UNHOLD") {
75
- document.getElementById("holdButton").innerHTML = "HOLD";
76
- } else {
77
- document.getElementById("holdButton").innerHTML = "UNHOLD";
78
- }
79
- }
80
- }
81
-
82
- function sdkReady() {
83
- exWebClient.checkClientStatus(function (status) {
84
- console.log("SDK Status " + status);
85
- });
86
- }
Binary file