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

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/src/phone.json ADDED
@@ -0,0 +1,75 @@
1
+ [
2
+ {
3
+ "agentName": "agent1",
4
+ "agentPwd": "agent1",
5
+ "AccountSID": {
6
+ "value": "exotelt",
7
+ "ua": [
8
+ {
9
+ "Username":"webrtcClient",
10
+ "DisplayName":"webrtcClient",
11
+ "HostServer":"voiptest.exotel.com",
12
+ "Domain":"voiptest.exotel.com",
13
+ "Port":443,
14
+ "Password":"webrtc",
15
+ "CallTimeout":1000,
16
+ "Security": "wss",
17
+ "AccountSID":"exotelt",
18
+ "AccountNo":"webrtcClient",
19
+ "AutoRegistration": true
20
+
21
+ },
22
+
23
+ {
24
+ "Username":"mobileClient",
25
+ "DisplayName":"mobileClient",
26
+ "HostServer":"voiptest.exotel.com",
27
+ "Domain":"voiptest.exotel.com",
28
+ "Port":443,
29
+ "Password":"webrtc",
30
+ "CallTimeout":1000,
31
+ "Security": "wss",
32
+ "AccountSID":"exotelt",
33
+ "AccountNo":"webrtcUser3",
34
+ "AutoRegistration": true
35
+ }
36
+ ]
37
+ }
38
+ },
39
+ {
40
+ "agentName": "agent2",
41
+ "agentPwd": "agent2",
42
+ "AccountSID": {
43
+ "value": "exotelt1",
44
+ "ua": [
45
+
46
+ {
47
+ "Username":"harsham79e843e5",
48
+ "DisplayName":"Harsha",
49
+ "HostServer":"voip.exotel.in",
50
+ "Domain":"ccplexopoc1m.voip.exotel.com",
51
+ "Port":443,
52
+ "Password":"webrtc123",
53
+ "CallTimeout":1000,
54
+ "Security": "wss",
55
+ "AccountSID":"exotelt1",
56
+ "AccountNo":"harsham79e843e5",
57
+ "AutoRegistration": true
58
+ },
59
+ {
60
+ "Username":"anushar81271313",
61
+ "DisplayName":"Anusha",
62
+ "HostServer":"voip.exotel.in",
63
+ "Domain":"ccplexopoc1m.voip.exotel.com",
64
+ "Port":443,
65
+ "Password":"webrtc@123",
66
+ "CallTimeout":1000,
67
+ "Security": "wss",
68
+ "AccountSID":"exotelt1",
69
+ "AccountNo":"anushar81271313",
70
+ "AutoRegistration": true
71
+ }
72
+ ]
73
+ }
74
+ }
75
+ ]
@@ -0,0 +1,43 @@
1
+ import data from './phone.json';
2
+
3
+ /**
4
+ * After successful login, user needs to pass username and accountSID to fetch the phones configured
5
+ * under their name. GetPhoneDetails shall fetch the list of phones pre-configured
6
+ * @param {*} username
7
+ * @param {*} accountSID
8
+ * @returns
9
+ */
10
+ export function GetPhoneDetails(username, accountSID){
11
+ /**
12
+ * Based on accountSID and username fetch the relevant phone details either from
13
+ * server or from phone.json. Time being it is fetched from phone.json
14
+ */
15
+ var phoneObj;
16
+ for(var x=0; x<data.length; x++){
17
+ if(data[x].agentName == username && data[x].AccountSID.value == accountSID){
18
+ phoneObj = data[x].AccountSID.ua;
19
+ return phoneObj;
20
+ }
21
+ }
22
+ return phoneObj;
23
+ }
24
+
25
+ /**
26
+ * Passes the JSON object to update the details
27
+ * @param {*} configDetails
28
+ */
29
+ export function UpdatePhoneDetails(configDetails){
30
+ /**
31
+ * Call the API to update the phone details whenever user edits the configuration
32
+ */
33
+ }
34
+
35
+ /**
36
+ * Add config details for a phone
37
+ * @param {*} configDetails
38
+ */
39
+ export function AddPhoneDetails(configDetails){
40
+ /**
41
+ * Call appropriate API to configure a new phone here
42
+ */
43
+ }