| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,127 @@ |
| 1 |
+/** |
|
| 2 |
+ * @copyright 2021, 2024 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
+ * |
|
| 4 |
+ * @author Double Bastion LLC |
|
| 5 |
+ * |
|
| 6 |
+ * @license GNU AGPL version 3 or any later version |
|
| 7 |
+ * |
|
| 8 |
+ * This program is free software; you can redistribute it and/or |
|
| 9 |
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
+ * License as published by the Free Software Foundation; either |
|
| 11 |
+ * version 3 of the License, or any later version. |
|
| 12 |
+ * |
|
| 13 |
+ * This program is distributed in the hope that it will be useful, |
|
| 14 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
+ * |
|
| 18 |
+ * You should have received a copy of the GNU Affero General Public |
|
| 19 |
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
+ * |
|
| 21 |
+ */ |
|
| 22 |
+ |
|
| 23 |
+$(document).ready(function() {
|
|
| 24 |
+ |
|
| 25 |
+ // Send the CSRF token as an HTTP header |
|
| 26 |
+ XMLHttpRequest.prototype.open = (function(open) {
|
|
| 27 |
+ return function(method,url,async) {
|
|
| 28 |
+ open.apply(this,arguments); |
|
| 29 |
+ this.setRequestHeader('requesttoken', OC.requestToken);
|
|
| 30 |
+ }; |
|
| 31 |
+ })(XMLHttpRequest.prototype.open); |
|
| 32 |
+ |
|
| 33 |
+ var stpappdir = 'apps'; |
|
| 34 |
+ |
|
| 35 |
+ // Get app directory |
|
| 36 |
+ var getstpurl = OC.generateUrl('/apps/sip_trip_phone/user/getappdirectory');
|
|
| 37 |
+ |
|
| 38 |
+ $.ajax({
|
|
| 39 |
+ method: 'GET', |
|
| 40 |
+ url: getstpurl, |
|
| 41 |
+ contentType: 'application/json', |
|
| 42 |
+ success: function(stpappdirfdb) {
|
|
| 43 |
+ stpappdir = stpappdirfdb; |
|
| 44 |
+ |
|
| 45 |
+ // Get the app's settings |
|
| 46 |
+ var getsetUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 47 |
+ |
|
| 48 |
+ $.ajax({
|
|
| 49 |
+ method: 'GET', |
|
| 50 |
+ url: getsetUrl, |
|
| 51 |
+ contentType: 'application/json', |
|
| 52 |
+ success: function(settingsdb) {
|
|
| 53 |
+ |
|
| 54 |
+ var connectData = {
|
|
| 55 |
+ "User" : settingsdb.sipusername, |
|
| 56 |
+ "Realm" : settingsdb.siprealm, |
|
| 57 |
+ "Display" : settingsdb.pdisplayname, |
|
| 58 |
+ "WSServer" : settingsdb.stphwssurl, |
|
| 59 |
+ "Stun" : settingsdb.stunserver, |
|
| 60 |
+ "Tracesipmsg" : settingsdb.tracesipmsg, |
|
| 61 |
+ "Voicenumbers" : settingsdb.voicenumbers, |
|
| 62 |
+ "Defaultvoicenumber" : settingsdb.defaultvoicenumber |
|
| 63 |
+ }; |
|
| 64 |
+ |
|
| 65 |
+ localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 66 |
+ |
|
| 67 |
+ // Get the (voice call capable) phone numbers of the current user's contacts and of all the Nextcloud users who didn't hide their phone numbers |
|
| 68 |
+ var getctpnUrl = OC.generateUrl('/apps/sip_trip_phone/user/getcontactsnmbrs');
|
|
| 69 |
+ |
|
| 70 |
+ $.ajax({
|
|
| 71 |
+ method: 'GET', |
|
| 72 |
+ url: getctpnUrl, |
|
| 73 |
+ contentType: 'application/json', |
|
| 74 |
+ success: function(contactspndb) {
|
|
| 75 |
+ |
|
| 76 |
+ localStorage.setItem('NCContacts', JSON.stringify(contactspndb));
|
|
| 77 |
+ |
|
| 78 |
+ |
|
| 79 |
+ var getspswdUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 80 |
+ |
|
| 81 |
+ $.ajax({
|
|
| 82 |
+ method: 'GET', |
|
| 83 |
+ url: getspswdUrl, |
|
| 84 |
+ contentType: 'text', |
|
| 85 |
+ success: function(sippassword) {
|
|
| 86 |
+ |
|
| 87 |
+ if (!localStorage.getItem('SipTripPhone')) {
|
|
| 88 |
+ |
|
| 89 |
+ function generateAESKey(passphrase) {
|
|
| 90 |
+ const salt = CryptoJS.lib.WordArray.random(128 / 8); |
|
| 91 |
+ const key256Bits = CryptoJS.PBKDF2(passphrase, salt, { keySize: 256 / 32, iterations: 100, });
|
|
| 92 |
+ return key256Bits; |
|
| 93 |
+ } |
|
| 94 |
+ function encryptAES(token, key) {
|
|
| 95 |
+ var token = CryptoJS.AES.encrypt(token, key); |
|
| 96 |
+ return token.toString(); |
|
| 97 |
+ } |
|
| 98 |
+ var genPassphr = Date.now() + Math.floor(Math.random()*10000).toString(6).toUpperCase(); |
|
| 99 |
+ var aesKey = String(generateAESKey(genPassphr)); |
|
| 100 |
+ var encryptedTkn = encryptAES(sippassword, aesKey); |
|
| 101 |
+ document.cookie = 'crsptknks='+ aesKey +'; max-age=30; path=/; samesite=strict; secure'; |
|
| 102 |
+ localStorage.setItem('sipUserToken', encryptedTkn);
|
|
| 103 |
+ |
|
| 104 |
+ // Open the phone window |
|
| 105 |
+ var url = OC.generateUrl('/'+ stpappdir +'/sip_trip_phone/phone/index.php');
|
|
| 106 |
+ window.open(url, "SipTripPhone", "width=354,height=572,menubar=no,scrollbars=no,status=no,addressbar=no,resizable=no"); |
|
| 107 |
+ |
|
| 108 |
+ } else {
|
|
| 109 |
+ window.alert('The phone is already open!');
|
|
| 110 |
+ } |
|
| 111 |
+ }, |
|
| 112 |
+ error: function() {}
|
|
| 113 |
+ }); |
|
| 114 |
+ |
|
| 115 |
+ }, |
|
| 116 |
+ error: function() { alert("An error occurred while getting the contacts. You can check the Nextcloud log to find more details about this issue."); }
|
|
| 117 |
+ }); |
|
| 118 |
+ |
|
| 119 |
+ }, |
|
| 120 |
+ error: function() { alert("An error occurred while getting the app's settings. You can check the Nextcloud log to find more details about this issue."); }
|
|
| 121 |
+ }); |
|
| 122 |
+ |
|
| 123 |
+ }, |
|
| 124 |
+ error: function() { alert("An error occurred while getting the app's directory. You can check the Nextcloud log to find more details about this issue."); }
|
|
| 125 |
+ }); |
|
| 126 |
+ |
|
| 127 |
+}); |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,119 +0,0 @@ |
| 1 |
-/** |
|
| 2 |
- * @copyright 2021, 2024 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
- * |
|
| 4 |
- * @author Double Bastion LLC |
|
| 5 |
- * |
|
| 6 |
- * @license GNU AGPL version 3 or any later version |
|
| 7 |
- * |
|
| 8 |
- * This program is free software; you can redistribute it and/or |
|
| 9 |
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
- * License as published by the Free Software Foundation; either |
|
| 11 |
- * version 3 of the License, or any later version. |
|
| 12 |
- * |
|
| 13 |
- * This program is distributed in the hope that it will be useful, |
|
| 14 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
- * |
|
| 18 |
- * You should have received a copy of the GNU Affero General Public |
|
| 19 |
- * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
- * |
|
| 21 |
- */ |
|
| 22 |
- |
|
| 23 |
-$(document).ready(function() {
|
|
| 24 |
- |
|
| 25 |
- var stpappdir = 'apps'; |
|
| 26 |
- |
|
| 27 |
- // Get app directory |
|
| 28 |
- var getstpurl = OC.generateUrl('/apps/sip_trip_phone/user/getappdirectory');
|
|
| 29 |
- |
|
| 30 |
- $.ajax({
|
|
| 31 |
- method: 'GET', |
|
| 32 |
- url: getstpurl, |
|
| 33 |
- contentType: 'application/json', |
|
| 34 |
- success: function(stpappdirfdb) {
|
|
| 35 |
- stpappdir = stpappdirfdb; |
|
| 36 |
- |
|
| 37 |
- // Get the app's settings |
|
| 38 |
- var getsetUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 39 |
- |
|
| 40 |
- $.ajax({
|
|
| 41 |
- method: 'GET', |
|
| 42 |
- url: getsetUrl, |
|
| 43 |
- contentType: 'application/json', |
|
| 44 |
- success: function(settingsdb) {
|
|
| 45 |
- |
|
| 46 |
- var connectData = {
|
|
| 47 |
- "User" : settingsdb.sipusername, |
|
| 48 |
- "Realm" : settingsdb.siprealm, |
|
| 49 |
- "Display" : settingsdb.pdisplayname, |
|
| 50 |
- "WSServer" : settingsdb.stphwssurl, |
|
| 51 |
- "Stun" : settingsdb.stunserver, |
|
| 52 |
- "Tracesipmsg" : settingsdb.tracesipmsg, |
|
| 53 |
- "Voicenumbers" : settingsdb.voicenumbers, |
|
| 54 |
- "Defaultvoicenumber" : settingsdb.defaultvoicenumber |
|
| 55 |
- }; |
|
| 56 |
- |
|
| 57 |
- localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 58 |
- |
|
| 59 |
- // Get the (voice call capable) phone numbers of the current user's contacts and of all the Nextcloud users who didn't hide their phone numbers |
|
| 60 |
- var getctpnUrl = OC.generateUrl('/apps/sip_trip_phone/user/getcontactsnmbrs');
|
|
| 61 |
- |
|
| 62 |
- $.ajax({
|
|
| 63 |
- method: 'GET', |
|
| 64 |
- url: getctpnUrl, |
|
| 65 |
- contentType: 'application/json', |
|
| 66 |
- success: function(contactspndb) {
|
|
| 67 |
- |
|
| 68 |
- localStorage.setItem('NCContacts', JSON.stringify(contactspndb));
|
|
| 69 |
- |
|
| 70 |
- |
|
| 71 |
- var getspswdUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 72 |
- |
|
| 73 |
- $.ajax({
|
|
| 74 |
- method: 'GET', |
|
| 75 |
- url: getspswdUrl, |
|
| 76 |
- contentType: 'text', |
|
| 77 |
- success: function(sippassword) {
|
|
| 78 |
- |
|
| 79 |
- if (!localStorage.getItem('SipTripPhone')) {
|
|
| 80 |
- |
|
| 81 |
- function generateAESKey(passphrase) {
|
|
| 82 |
- const salt = CryptoJS.lib.WordArray.random(128 / 8); |
|
| 83 |
- const key256Bits = CryptoJS.PBKDF2(passphrase, salt, { keySize: 256 / 32, iterations: 100, });
|
|
| 84 |
- return key256Bits; |
|
| 85 |
- } |
|
| 86 |
- function encryptAES(token, key) {
|
|
| 87 |
- var token = CryptoJS.AES.encrypt(token, key); |
|
| 88 |
- return token.toString(); |
|
| 89 |
- } |
|
| 90 |
- var genPassphr = Date.now() + Math.floor(Math.random()*10000).toString(6).toUpperCase(); |
|
| 91 |
- var aesKey = String(generateAESKey(genPassphr)); |
|
| 92 |
- var encryptedTkn = encryptAES(sippassword, aesKey); |
|
| 93 |
- document.cookie = 'crsptknks='+ aesKey +'; max-age=30; path=/; samesite=strict; secure'; |
|
| 94 |
- localStorage.setItem('sipUserToken', encryptedTkn);
|
|
| 95 |
- |
|
| 96 |
- // Open the phone window |
|
| 97 |
- var url = OC.generateUrl('/'+ stpappdir +'/sip_trip_phone/phone/index.php');
|
|
| 98 |
- window.open(url, "SipTripPhone", "width=354,height=572,menubar=no,scrollbars=no,status=no,addressbar=no,resizable=no"); |
|
| 99 |
- |
|
| 100 |
- } else {
|
|
| 101 |
- window.alert('The phone is already open!');
|
|
| 102 |
- } |
|
| 103 |
- }, |
|
| 104 |
- error: function() {}
|
|
| 105 |
- }); |
|
| 106 |
- |
|
| 107 |
- }, |
|
| 108 |
- error: function() { alert("An error occurred while getting the contacts. You can check the Nextcloud log to find more details about this issue."); }
|
|
| 109 |
- }); |
|
| 110 |
- |
|
| 111 |
- }, |
|
| 112 |
- error: function() { alert("An error occurred while getting the app's settings. You can check the Nextcloud log to find more details about this issue."); }
|
|
| 113 |
- }); |
|
| 114 |
- |
|
| 115 |
- }, |
|
| 116 |
- error: function() { alert("An error occurred while getting the app's directory. You can check the Nextcloud log to find more details about this issue."); }
|
|
| 117 |
- }); |
|
| 118 |
- |
|
| 119 |
-}); |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,119 @@ |
| 1 |
+/** |
|
| 2 |
+ * @copyright 2021, 2024 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
+ * |
|
| 4 |
+ * @author Double Bastion LLC |
|
| 5 |
+ * |
|
| 6 |
+ * @license GNU AGPL version 3 or any later version |
|
| 7 |
+ * |
|
| 8 |
+ * This program is free software; you can redistribute it and/or |
|
| 9 |
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
+ * License as published by the Free Software Foundation; either |
|
| 11 |
+ * version 3 of the License, or any later version. |
|
| 12 |
+ * |
|
| 13 |
+ * This program is distributed in the hope that it will be useful, |
|
| 14 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
+ * |
|
| 18 |
+ * You should have received a copy of the GNU Affero General Public |
|
| 19 |
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
+ * |
|
| 21 |
+ */ |
|
| 22 |
+ |
|
| 23 |
+$(document).ready(function() {
|
|
| 24 |
+ |
|
| 25 |
+ var stpappdir = 'apps'; |
|
| 26 |
+ |
|
| 27 |
+ // Get app directory |
|
| 28 |
+ var getstpurl = OC.generateUrl('/apps/sip_trip_phone/user/getappdirectory');
|
|
| 29 |
+ |
|
| 30 |
+ $.ajax({
|
|
| 31 |
+ method: 'GET', |
|
| 32 |
+ url: getstpurl, |
|
| 33 |
+ contentType: 'application/json', |
|
| 34 |
+ success: function(stpappdirfdb) {
|
|
| 35 |
+ stpappdir = stpappdirfdb; |
|
| 36 |
+ |
|
| 37 |
+ // Get the app's settings |
|
| 38 |
+ var getsetUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 39 |
+ |
|
| 40 |
+ $.ajax({
|
|
| 41 |
+ method: 'GET', |
|
| 42 |
+ url: getsetUrl, |
|
| 43 |
+ contentType: 'application/json', |
|
| 44 |
+ success: function(settingsdb) {
|
|
| 45 |
+ |
|
| 46 |
+ var connectData = {
|
|
| 47 |
+ "User" : settingsdb.sipusername, |
|
| 48 |
+ "Realm" : settingsdb.siprealm, |
|
| 49 |
+ "Display" : settingsdb.pdisplayname, |
|
| 50 |
+ "WSServer" : settingsdb.stphwssurl, |
|
| 51 |
+ "Stun" : settingsdb.stunserver, |
|
| 52 |
+ "Tracesipmsg" : settingsdb.tracesipmsg, |
|
| 53 |
+ "Voicenumbers" : settingsdb.voicenumbers, |
|
| 54 |
+ "Defaultvoicenumber" : settingsdb.defaultvoicenumber |
|
| 55 |
+ }; |
|
| 56 |
+ |
|
| 57 |
+ localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 58 |
+ |
|
| 59 |
+ // Get the (voice call capable) phone numbers of the current user's contacts and of all the Nextcloud users who didn't hide their phone numbers |
|
| 60 |
+ var getctpnUrl = OC.generateUrl('/apps/sip_trip_phone/user/getcontactsnmbrs');
|
|
| 61 |
+ |
|
| 62 |
+ $.ajax({
|
|
| 63 |
+ method: 'GET', |
|
| 64 |
+ url: getctpnUrl, |
|
| 65 |
+ contentType: 'application/json', |
|
| 66 |
+ success: function(contactspndb) {
|
|
| 67 |
+ |
|
| 68 |
+ localStorage.setItem('NCContacts', JSON.stringify(contactspndb));
|
|
| 69 |
+ |
|
| 70 |
+ |
|
| 71 |
+ var getspswdUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 72 |
+ |
|
| 73 |
+ $.ajax({
|
|
| 74 |
+ method: 'GET', |
|
| 75 |
+ url: getspswdUrl, |
|
| 76 |
+ contentType: 'text', |
|
| 77 |
+ success: function(sippassword) {
|
|
| 78 |
+ |
|
| 79 |
+ if (!localStorage.getItem('SipTripPhone')) {
|
|
| 80 |
+ |
|
| 81 |
+ function generateAESKey(passphrase) {
|
|
| 82 |
+ const salt = CryptoJS.lib.WordArray.random(128 / 8); |
|
| 83 |
+ const key256Bits = CryptoJS.PBKDF2(passphrase, salt, { keySize: 256 / 32, iterations: 100, });
|
|
| 84 |
+ return key256Bits; |
|
| 85 |
+ } |
|
| 86 |
+ function encryptAES(token, key) {
|
|
| 87 |
+ var token = CryptoJS.AES.encrypt(token, key); |
|
| 88 |
+ return token.toString(); |
|
| 89 |
+ } |
|
| 90 |
+ var genPassphr = Date.now() + Math.floor(Math.random()*10000).toString(6).toUpperCase(); |
|
| 91 |
+ var aesKey = String(generateAESKey(genPassphr)); |
|
| 92 |
+ var encryptedTkn = encryptAES(sippassword, aesKey); |
|
| 93 |
+ document.cookie = 'crsptknks='+ aesKey +'; max-age=30; path=/; samesite=strict; secure'; |
|
| 94 |
+ localStorage.setItem('sipUserToken', encryptedTkn);
|
|
| 95 |
+ |
|
| 96 |
+ // Open the phone window |
|
| 97 |
+ var url = OC.generateUrl('/'+ stpappdir +'/sip_trip_phone/phone/index.php');
|
|
| 98 |
+ window.open(url, "SipTripPhone", "width=354,height=572,menubar=no,scrollbars=no,status=no,addressbar=no,resizable=no"); |
|
| 99 |
+ |
|
| 100 |
+ } else {
|
|
| 101 |
+ window.alert('The phone is already open!');
|
|
| 102 |
+ } |
|
| 103 |
+ }, |
|
| 104 |
+ error: function() {}
|
|
| 105 |
+ }); |
|
| 106 |
+ |
|
| 107 |
+ }, |
|
| 108 |
+ error: function() { alert("An error occurred while getting the contacts. You can check the Nextcloud log to find more details about this issue."); }
|
|
| 109 |
+ }); |
|
| 110 |
+ |
|
| 111 |
+ }, |
|
| 112 |
+ error: function() { alert("An error occurred while getting the app's settings. You can check the Nextcloud log to find more details about this issue."); }
|
|
| 113 |
+ }); |
|
| 114 |
+ |
|
| 115 |
+ }, |
|
| 116 |
+ error: function() { alert("An error occurred while getting the app's directory. You can check the Nextcloud log to find more details about this issue."); }
|
|
| 117 |
+ }); |
|
| 118 |
+ |
|
| 119 |
+}); |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,107 +0,0 @@ |
| 1 |
-/** |
|
| 2 |
- * @copyright 2021, 2024 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
- * |
|
| 4 |
- * @author Double Bastion LLC |
|
| 5 |
- * |
|
| 6 |
- * @license GNU AGPL version 3 or any later version |
|
| 7 |
- * |
|
| 8 |
- * This program is free software; you can redistribute it and/or |
|
| 9 |
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
- * License as published by the Free Software Foundation; either |
|
| 11 |
- * version 3 of the License, or any later version. |
|
| 12 |
- * |
|
| 13 |
- * This program is distributed in the hope that it will be useful, |
|
| 14 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
- * |
|
| 18 |
- * You should have received a copy of the GNU Affero General Public |
|
| 19 |
- * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
- * |
|
| 21 |
- */ |
|
| 22 |
- |
|
| 23 |
-$(document).ready(function() {
|
|
| 24 |
- |
|
| 25 |
- var userid = "<?php p($userId); ?>"; |
|
| 26 |
- var stpappdir = 'apps'; |
|
| 27 |
- |
|
| 28 |
- // Get app directory |
|
| 29 |
- var getstpurl = OC.generateUrl('/apps/sip_trip_phone/user/getappdirectory');
|
|
| 30 |
- |
|
| 31 |
- $.ajax({
|
|
| 32 |
- method: 'GET', |
|
| 33 |
- url: getstpurl + '/' + userid, |
|
| 34 |
- contentType: 'application/json', |
|
| 35 |
- success: function(stpappdirfdb) {
|
|
| 36 |
- stpappdir = stpappdirfdb; |
|
| 37 |
- |
|
| 38 |
- // Get the app's settings |
|
| 39 |
- var getsetUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 40 |
- |
|
| 41 |
- $.ajax({
|
|
| 42 |
- method: 'GET', |
|
| 43 |
- url: getsetUrl + '/' + userid, |
|
| 44 |
- contentType: 'application/json', |
|
| 45 |
- success: function(settingsdb) {
|
|
| 46 |
- |
|
| 47 |
- var connectData = {
|
|
| 48 |
- "User" : settingsdb.sipusername, |
|
| 49 |
- "Realm" : settingsdb.siprealm, |
|
| 50 |
- "Display" : settingsdb.pdisplayname, |
|
| 51 |
- "WSServer" : settingsdb.stphwssurl, |
|
| 52 |
- "Stun" : settingsdb.stunserver, |
|
| 53 |
- "Tracesipmsg" : settingsdb.tracesipmsg, |
|
| 54 |
- "Voicenumbers" : settingsdb.voicenumbers, |
|
| 55 |
- "Defaultvoicenumber" : settingsdb.defaultvoicenumber |
|
| 56 |
- }; |
|
| 57 |
- |
|
| 58 |
- localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 59 |
- |
|
| 60 |
- // Get the (voice call capable) phone numbers of the current user's contacts and of all the Nextcloud users who didn't hide their phone numbers |
|
| 61 |
- var getctpnUrl = OC.generateUrl('/apps/sip_trip_phone/user/getcontactsnmbrs');
|
|
| 62 |
- |
|
| 63 |
- $.ajax({
|
|
| 64 |
- method: 'GET', |
|
| 65 |
- url: getctpnUrl + '/' + userid, |
|
| 66 |
- contentType: 'application/json', |
|
| 67 |
- success: function(contactspndb) {
|
|
| 68 |
- |
|
| 69 |
- localStorage.setItem('NCContacts', JSON.stringify(contactspndb));
|
|
| 70 |
- |
|
| 71 |
- |
|
| 72 |
- var getspswdUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 73 |
- |
|
| 74 |
- $.ajax({
|
|
| 75 |
- method: 'GET', |
|
| 76 |
- url: getspswdUrl + '/' + userid, |
|
| 77 |
- contentType: 'text', |
|
| 78 |
- success: function(sippassword) {
|
|
| 79 |
- |
|
| 80 |
- if (!localStorage.getItem('SipTripPhone')) {
|
|
| 81 |
- |
|
| 82 |
- localStorage.setItem('sipUserToken', sippassword);
|
|
| 83 |
- |
|
| 84 |
- // Open the phone window |
|
| 85 |
- var url = OC.generateUrl('/'+ stpappdir +'/sip_trip_phone/phone/index.php');
|
|
| 86 |
- window.open(url, "SipTripPhone", "width=354,height=572,menubar=no,scrollbars=no,status=no,addressbar=no,resizable=no"); |
|
| 87 |
- |
|
| 88 |
- } else {
|
|
| 89 |
- window.alert('The phone is already open!');
|
|
| 90 |
- } |
|
| 91 |
- }, |
|
| 92 |
- error: function() {}
|
|
| 93 |
- }); |
|
| 94 |
- |
|
| 95 |
- }, |
|
| 96 |
- error: function() { alert("An error occurred while getting the contacts. You can check the Nextcloud log to find more details about this issue."); }
|
|
| 97 |
- }); |
|
| 98 |
- |
|
| 99 |
- }, |
|
| 100 |
- error: function() { alert("An error occurred while getting the app's settings. You can check the Nextcloud log to find more details about this issue."); }
|
|
| 101 |
- }); |
|
| 102 |
- |
|
| 103 |
- }, |
|
| 104 |
- error: function() { alert("An error occurred while getting the app's directory. You can check the Nextcloud log to find more details about this issue."); }
|
|
| 105 |
- }); |
|
| 106 |
- |
|
| 107 |
-}); |
| ... | ... |
@@ -68,6 +68,7 @@ $(document).ready(function() {
|
| 68 | 68 |
|
| 69 | 69 |
localStorage.setItem('NCContacts', JSON.stringify(contactspndb));
|
| 70 | 70 |
|
| 71 |
+ |
|
| 71 | 72 |
var getspswdUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
| 72 | 73 |
|
| 73 | 74 |
$.ajax({
|
| ... | ... |
@@ -78,25 +79,11 @@ $(document).ready(function() {
|
| 78 | 79 |
|
| 79 | 80 |
if (!localStorage.getItem('SipTripPhone')) {
|
| 80 | 81 |
|
| 81 |
- function generateAESKey(passphrase) {
|
|
| 82 |
- const salt = CryptoJS.lib.WordArray.random(128 / 8); |
|
| 83 |
- const key256Bits = CryptoJS.PBKDF2(passphrase, salt, { keySize: 256 / 32, iterations: 100, });
|
|
| 84 |
- return key256Bits; |
|
| 85 |
- } |
|
| 86 |
- function encryptAES(token, key) {
|
|
| 87 |
- var token = CryptoJS.AES.encrypt(token, key); |
|
| 88 |
- return token.toString(); |
|
| 89 |
- } |
|
| 90 |
- var genPassphr = Date.now() + Math.floor(Math.random()*10000).toString(6).toUpperCase(); |
|
| 91 |
- var aesKey = String(generateAESKey(genPassphr)); |
|
| 92 |
- var encryptedTkn = encryptAES(sippassword, aesKey); |
|
| 93 |
- document.cookie = 'crsptknks='+ aesKey +'; max-age=30; path=/; samesite=strict; secure'; |
|
| 94 |
- localStorage.setItem('sipUserToken', encryptedTkn);
|
|
| 82 |
+ localStorage.setItem('sipUserToken', sippassword);
|
|
| 95 | 83 |
|
| 96 | 84 |
// Open the phone window |
| 97 | 85 |
var url = OC.generateUrl('/'+ stpappdir +'/sip_trip_phone/phone/index.php');
|
| 98 | 86 |
window.open(url, "SipTripPhone", "width=354,height=572,menubar=no,scrollbars=no,status=no,addressbar=no,resizable=no"); |
| 99 |
- if (localStorage.getItem('ctxPhone')) { localStorage.removeItem('sipUserToken'); }
|
|
| 100 | 87 |
|
| 101 | 88 |
} else {
|
| 102 | 89 |
window.alert('The phone is already open!');
|
| ... | ... |
@@ -105,7 +92,6 @@ $(document).ready(function() {
|
| 105 | 92 |
error: function() {}
|
| 106 | 93 |
}); |
| 107 | 94 |
|
| 108 |
- |
|
| 109 | 95 |
}, |
| 110 | 96 |
error: function() { alert("An error occurred while getting the contacts. You can check the Nextcloud log to find more details about this issue."); }
|
| 111 | 97 |
}); |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,121 @@ |
| 1 |
+/** |
|
| 2 |
+ * @copyright 2021, 2024 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
+ * |
|
| 4 |
+ * @author Double Bastion LLC |
|
| 5 |
+ * |
|
| 6 |
+ * @license GNU AGPL version 3 or any later version |
|
| 7 |
+ * |
|
| 8 |
+ * This program is free software; you can redistribute it and/or |
|
| 9 |
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
+ * License as published by the Free Software Foundation; either |
|
| 11 |
+ * version 3 of the License, or any later version. |
|
| 12 |
+ * |
|
| 13 |
+ * This program is distributed in the hope that it will be useful, |
|
| 14 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
+ * |
|
| 18 |
+ * You should have received a copy of the GNU Affero General Public |
|
| 19 |
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
+ * |
|
| 21 |
+ */ |
|
| 22 |
+ |
|
| 23 |
+$(document).ready(function() {
|
|
| 24 |
+ |
|
| 25 |
+ var userid = "<?php p($userId); ?>"; |
|
| 26 |
+ var stpappdir = 'apps'; |
|
| 27 |
+ |
|
| 28 |
+ // Get app directory |
|
| 29 |
+ var getstpurl = OC.generateUrl('/apps/sip_trip_phone/user/getappdirectory');
|
|
| 30 |
+ |
|
| 31 |
+ $.ajax({
|
|
| 32 |
+ method: 'GET', |
|
| 33 |
+ url: getstpurl + '/' + userid, |
|
| 34 |
+ contentType: 'application/json', |
|
| 35 |
+ success: function(stpappdirfdb) {
|
|
| 36 |
+ stpappdir = stpappdirfdb; |
|
| 37 |
+ |
|
| 38 |
+ // Get the app's settings |
|
| 39 |
+ var getsetUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 40 |
+ |
|
| 41 |
+ $.ajax({
|
|
| 42 |
+ method: 'GET', |
|
| 43 |
+ url: getsetUrl + '/' + userid, |
|
| 44 |
+ contentType: 'application/json', |
|
| 45 |
+ success: function(settingsdb) {
|
|
| 46 |
+ |
|
| 47 |
+ var connectData = {
|
|
| 48 |
+ "User" : settingsdb.sipusername, |
|
| 49 |
+ "Realm" : settingsdb.siprealm, |
|
| 50 |
+ "Display" : settingsdb.pdisplayname, |
|
| 51 |
+ "WSServer" : settingsdb.stphwssurl, |
|
| 52 |
+ "Stun" : settingsdb.stunserver, |
|
| 53 |
+ "Tracesipmsg" : settingsdb.tracesipmsg, |
|
| 54 |
+ "Voicenumbers" : settingsdb.voicenumbers, |
|
| 55 |
+ "Defaultvoicenumber" : settingsdb.defaultvoicenumber |
|
| 56 |
+ }; |
|
| 57 |
+ |
|
| 58 |
+ localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 59 |
+ |
|
| 60 |
+ // Get the (voice call capable) phone numbers of the current user's contacts and of all the Nextcloud users who didn't hide their phone numbers |
|
| 61 |
+ var getctpnUrl = OC.generateUrl('/apps/sip_trip_phone/user/getcontactsnmbrs');
|
|
| 62 |
+ |
|
| 63 |
+ $.ajax({
|
|
| 64 |
+ method: 'GET', |
|
| 65 |
+ url: getctpnUrl + '/' + userid, |
|
| 66 |
+ contentType: 'application/json', |
|
| 67 |
+ success: function(contactspndb) {
|
|
| 68 |
+ |
|
| 69 |
+ localStorage.setItem('NCContacts', JSON.stringify(contactspndb));
|
|
| 70 |
+ |
|
| 71 |
+ var getspswdUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 72 |
+ |
|
| 73 |
+ $.ajax({
|
|
| 74 |
+ method: 'GET', |
|
| 75 |
+ url: getspswdUrl + '/' + userid, |
|
| 76 |
+ contentType: 'text', |
|
| 77 |
+ success: function(sippassword) {
|
|
| 78 |
+ |
|
| 79 |
+ if (!localStorage.getItem('SipTripPhone')) {
|
|
| 80 |
+ |
|
| 81 |
+ function generateAESKey(passphrase) {
|
|
| 82 |
+ const salt = CryptoJS.lib.WordArray.random(128 / 8); |
|
| 83 |
+ const key256Bits = CryptoJS.PBKDF2(passphrase, salt, { keySize: 256 / 32, iterations: 100, });
|
|
| 84 |
+ return key256Bits; |
|
| 85 |
+ } |
|
| 86 |
+ function encryptAES(token, key) {
|
|
| 87 |
+ var token = CryptoJS.AES.encrypt(token, key); |
|
| 88 |
+ return token.toString(); |
|
| 89 |
+ } |
|
| 90 |
+ var genPassphr = Date.now() + Math.floor(Math.random()*10000).toString(6).toUpperCase(); |
|
| 91 |
+ var aesKey = String(generateAESKey(genPassphr)); |
|
| 92 |
+ var encryptedTkn = encryptAES(sippassword, aesKey); |
|
| 93 |
+ document.cookie = 'crsptknks='+ aesKey +'; max-age=30; path=/; samesite=strict; secure'; |
|
| 94 |
+ localStorage.setItem('sipUserToken', encryptedTkn);
|
|
| 95 |
+ |
|
| 96 |
+ // Open the phone window |
|
| 97 |
+ var url = OC.generateUrl('/'+ stpappdir +'/sip_trip_phone/phone/index.php');
|
|
| 98 |
+ window.open(url, "SipTripPhone", "width=354,height=572,menubar=no,scrollbars=no,status=no,addressbar=no,resizable=no"); |
|
| 99 |
+ if (localStorage.getItem('ctxPhone')) { localStorage.removeItem('sipUserToken'); }
|
|
| 100 |
+ |
|
| 101 |
+ } else {
|
|
| 102 |
+ window.alert('The phone is already open!');
|
|
| 103 |
+ } |
|
| 104 |
+ }, |
|
| 105 |
+ error: function() {}
|
|
| 106 |
+ }); |
|
| 107 |
+ |
|
| 108 |
+ |
|
| 109 |
+ }, |
|
| 110 |
+ error: function() { alert("An error occurred while getting the contacts. You can check the Nextcloud log to find more details about this issue."); }
|
|
| 111 |
+ }); |
|
| 112 |
+ |
|
| 113 |
+ }, |
|
| 114 |
+ error: function() { alert("An error occurred while getting the app's settings. You can check the Nextcloud log to find more details about this issue."); }
|
|
| 115 |
+ }); |
|
| 116 |
+ |
|
| 117 |
+ }, |
|
| 118 |
+ error: function() { alert("An error occurred while getting the app's directory. You can check the Nextcloud log to find more details about this issue."); }
|
|
| 119 |
+ }); |
|
| 120 |
+ |
|
| 121 |
+}); |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,71 +0,0 @@ |
| 1 |
-/** |
|
| 2 |
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
- * |
|
| 4 |
- * @author Double Bastion LLC |
|
| 5 |
- * |
|
| 6 |
- * @license GNU AGPL version 3 or any later version |
|
| 7 |
- * |
|
| 8 |
- * This program is free software; you can redistribute it and/or |
|
| 9 |
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
- * License as published by the Free Software Foundation; either |
|
| 11 |
- * version 3 of the License, or any later version. |
|
| 12 |
- * |
|
| 13 |
- * This program is distributed in the hope that it will be useful, |
|
| 14 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
- * |
|
| 18 |
- * You should have received a copy of the GNU Affero General Public |
|
| 19 |
- * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
- * |
|
| 21 |
- */ |
|
| 22 |
- |
|
| 23 |
-$(document).ready(function() {
|
|
| 24 |
- |
|
| 25 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 26 |
- var userid = "<?php p($userId); ?>"; |
|
| 27 |
- |
|
| 28 |
- $.ajax({
|
|
| 29 |
- method: 'GET', |
|
| 30 |
- url: baseUrl + '/' + userid, |
|
| 31 |
- contentType: 'application/json', |
|
| 32 |
- success: function(settingsdb) {
|
|
| 33 |
- |
|
| 34 |
- var connectData = {
|
|
| 35 |
- "User" : settingsdb.sipusername, |
|
| 36 |
- "Realm" : settingsdb.siprealm, |
|
| 37 |
- "Display" : settingsdb.pdisplayname, |
|
| 38 |
- "WSServer" : settingsdb.stphwssurl, |
|
| 39 |
- "Stun" : settingsdb.stunserver, |
|
| 40 |
- "Tracesipmsg" : settingsdb.tracesipmsg, |
|
| 41 |
- "Voicenumbers" : settingsdb.voicenumbers, |
|
| 42 |
- "Defaultvoicenumber" : settingsdb.defaultvoicenumber |
|
| 43 |
- }; |
|
| 44 |
- |
|
| 45 |
- localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 46 |
- |
|
| 47 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 48 |
- |
|
| 49 |
- $.ajax({
|
|
| 50 |
- method: 'GET', |
|
| 51 |
- url: baseUrl + '/' + userid, |
|
| 52 |
- contentType: 'text', |
|
| 53 |
- success: function(sippassword) {
|
|
| 54 |
- |
|
| 55 |
- var url = OC.generateUrl('/apps/sip_trip_phone/phone/index.html');
|
|
| 56 |
- |
|
| 57 |
- if (!localStorage.getItem('SipTripPhone')) {
|
|
| 58 |
- |
|
| 59 |
- window.open(url, "SipTripPhone", "width=354,height=572,menubar=no,scrollbars=no,status=no,addressbar=no,resizable=no"); |
|
| 60 |
- window.sipUserPasswd = sippassword; |
|
| 61 |
- |
|
| 62 |
- } else {
|
|
| 63 |
- window.alert('The phone is already open !');
|
|
| 64 |
- } |
|
| 65 |
- } |
|
| 66 |
- |
|
| 67 |
- }); |
|
| 68 |
- } |
|
| 69 |
- }); |
|
| 70 |
-}); |
|
| 71 |
- |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,71 @@ |
| 1 |
+/** |
|
| 2 |
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
+ * |
|
| 4 |
+ * @author Double Bastion LLC |
|
| 5 |
+ * |
|
| 6 |
+ * @license GNU AGPL version 3 or any later version |
|
| 7 |
+ * |
|
| 8 |
+ * This program is free software; you can redistribute it and/or |
|
| 9 |
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
+ * License as published by the Free Software Foundation; either |
|
| 11 |
+ * version 3 of the License, or any later version. |
|
| 12 |
+ * |
|
| 13 |
+ * This program is distributed in the hope that it will be useful, |
|
| 14 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
+ * |
|
| 18 |
+ * You should have received a copy of the GNU Affero General Public |
|
| 19 |
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
+ * |
|
| 21 |
+ */ |
|
| 22 |
+ |
|
| 23 |
+$(document).ready(function() {
|
|
| 24 |
+ |
|
| 25 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 26 |
+ var userid = "<?php p($userId); ?>"; |
|
| 27 |
+ |
|
| 28 |
+ $.ajax({
|
|
| 29 |
+ method: 'GET', |
|
| 30 |
+ url: baseUrl + '/' + userid, |
|
| 31 |
+ contentType: 'application/json', |
|
| 32 |
+ success: function(settingsdb) {
|
|
| 33 |
+ |
|
| 34 |
+ var connectData = {
|
|
| 35 |
+ "User" : settingsdb.sipusername, |
|
| 36 |
+ "Realm" : settingsdb.siprealm, |
|
| 37 |
+ "Display" : settingsdb.pdisplayname, |
|
| 38 |
+ "WSServer" : settingsdb.stphwssurl, |
|
| 39 |
+ "Stun" : settingsdb.stunserver, |
|
| 40 |
+ "Tracesipmsg" : settingsdb.tracesipmsg, |
|
| 41 |
+ "Voicenumbers" : settingsdb.voicenumbers, |
|
| 42 |
+ "Defaultvoicenumber" : settingsdb.defaultvoicenumber |
|
| 43 |
+ }; |
|
| 44 |
+ |
|
| 45 |
+ localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 46 |
+ |
|
| 47 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 48 |
+ |
|
| 49 |
+ $.ajax({
|
|
| 50 |
+ method: 'GET', |
|
| 51 |
+ url: baseUrl + '/' + userid, |
|
| 52 |
+ contentType: 'text', |
|
| 53 |
+ success: function(sippassword) {
|
|
| 54 |
+ |
|
| 55 |
+ var url = OC.generateUrl('/apps/sip_trip_phone/phone/index.html');
|
|
| 56 |
+ |
|
| 57 |
+ if (!localStorage.getItem('SipTripPhone')) {
|
|
| 58 |
+ |
|
| 59 |
+ window.open(url, "SipTripPhone", "width=354,height=572,menubar=no,scrollbars=no,status=no,addressbar=no,resizable=no"); |
|
| 60 |
+ window.sipUserPasswd = sippassword; |
|
| 61 |
+ |
|
| 62 |
+ } else {
|
|
| 63 |
+ window.alert('The phone is already open !');
|
|
| 64 |
+ } |
|
| 65 |
+ } |
|
| 66 |
+ |
|
| 67 |
+ }); |
|
| 68 |
+ } |
|
| 69 |
+ }); |
|
| 70 |
+}); |
|
| 71 |
+ |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,71 +0,0 @@ |
| 1 |
-/** |
|
| 2 |
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
- * |
|
| 4 |
- * @author Double Bastion LLC |
|
| 5 |
- * |
|
| 6 |
- * @license GNU AGPL version 3 or any later version |
|
| 7 |
- * |
|
| 8 |
- * This program is free software; you can redistribute it and/or |
|
| 9 |
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
- * License as published by the Free Software Foundation; either |
|
| 11 |
- * version 3 of the License, or any later version. |
|
| 12 |
- * |
|
| 13 |
- * This program is distributed in the hope that it will be useful, |
|
| 14 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
- * |
|
| 18 |
- * You should have received a copy of the GNU Affero General Public |
|
| 19 |
- * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
- * |
|
| 21 |
- */ |
|
| 22 |
- |
|
| 23 |
-$(document).ready(function() {
|
|
| 24 |
- |
|
| 25 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 26 |
- var userid = "<?php p($userId); ?>"; |
|
| 27 |
- |
|
| 28 |
- $.ajax({
|
|
| 29 |
- method: 'GET', |
|
| 30 |
- url: baseUrl + '/' + userid, |
|
| 31 |
- contentType: 'application/json', |
|
| 32 |
- success: function(settingsdb) {
|
|
| 33 |
- |
|
| 34 |
- var connectData = {
|
|
| 35 |
- "User" : settingsdb.sipusername, |
|
| 36 |
- "Realm" : settingsdb.siprealm, |
|
| 37 |
- "Display" : settingsdb.pdisplayname, |
|
| 38 |
- "WSServer" : settingsdb.stphwssurl, |
|
| 39 |
- "Stun" : settingsdb.stunserver, |
|
| 40 |
- "Tracesipmsg" : settingsdb.tracesipmsg, |
|
| 41 |
- "Voicenumbers" : settingsdb.voicenumbers, |
|
| 42 |
- "Defaultvoicenumber" : settingsdb.defaultvoicenumber |
|
| 43 |
- }; |
|
| 44 |
- |
|
| 45 |
- localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 46 |
- |
|
| 47 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 48 |
- |
|
| 49 |
- $.ajax({
|
|
| 50 |
- method: 'GET', |
|
| 51 |
- url: baseUrl + '/' + userid, |
|
| 52 |
- contentType: 'text', |
|
| 53 |
- success: function(sippassword) {
|
|
| 54 |
- |
|
| 55 |
- var url = OC.generateUrl('/apps/sip_trip_phone/phone/index.html');
|
|
| 56 |
- |
|
| 57 |
- if (!localStorage.getItem('SipTripPhone')) {
|
|
| 58 |
- |
|
| 59 |
- window.open(url, "SipTripPhone", "width=354,height=572,menubar=no,scrollbars=no,status=no,addressbar=no,resizable=no"); |
|
| 60 |
- window.sipUserPasswd = sippassword; |
|
| 61 |
- |
|
| 62 |
- } else {
|
|
| 63 |
- window.alert('The phone is already open !');
|
|
| 64 |
- } |
|
| 65 |
- } |
|
| 66 |
- |
|
| 67 |
- }); |
|
| 68 |
- } |
|
| 69 |
- }); |
|
| 70 |
-}); |
|
| 71 |
- |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,71 @@ |
| 1 |
+/** |
|
| 2 |
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
+ * |
|
| 4 |
+ * @author Double Bastion LLC |
|
| 5 |
+ * |
|
| 6 |
+ * @license GNU AGPL version 3 or any later version |
|
| 7 |
+ * |
|
| 8 |
+ * This program is free software; you can redistribute it and/or |
|
| 9 |
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
+ * License as published by the Free Software Foundation; either |
|
| 11 |
+ * version 3 of the License, or any later version. |
|
| 12 |
+ * |
|
| 13 |
+ * This program is distributed in the hope that it will be useful, |
|
| 14 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
+ * |
|
| 18 |
+ * You should have received a copy of the GNU Affero General Public |
|
| 19 |
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
+ * |
|
| 21 |
+ */ |
|
| 22 |
+ |
|
| 23 |
+$(document).ready(function() {
|
|
| 24 |
+ |
|
| 25 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 26 |
+ var userid = "<?php p($userId); ?>"; |
|
| 27 |
+ |
|
| 28 |
+ $.ajax({
|
|
| 29 |
+ method: 'GET', |
|
| 30 |
+ url: baseUrl + '/' + userid, |
|
| 31 |
+ contentType: 'application/json', |
|
| 32 |
+ success: function(settingsdb) {
|
|
| 33 |
+ |
|
| 34 |
+ var connectData = {
|
|
| 35 |
+ "User" : settingsdb.sipusername, |
|
| 36 |
+ "Realm" : settingsdb.siprealm, |
|
| 37 |
+ "Display" : settingsdb.pdisplayname, |
|
| 38 |
+ "WSServer" : settingsdb.stphwssurl, |
|
| 39 |
+ "Stun" : settingsdb.stunserver, |
|
| 40 |
+ "Tracesipmsg" : settingsdb.tracesipmsg, |
|
| 41 |
+ "Voicenumbers" : settingsdb.voicenumbers, |
|
| 42 |
+ "Defaultvoicenumber" : settingsdb.defaultvoicenumber |
|
| 43 |
+ }; |
|
| 44 |
+ |
|
| 45 |
+ localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 46 |
+ |
|
| 47 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 48 |
+ |
|
| 49 |
+ $.ajax({
|
|
| 50 |
+ method: 'GET', |
|
| 51 |
+ url: baseUrl + '/' + userid, |
|
| 52 |
+ contentType: 'text', |
|
| 53 |
+ success: function(sippassword) {
|
|
| 54 |
+ |
|
| 55 |
+ var url = OC.generateUrl('/apps/sip_trip_phone/phone/index.html');
|
|
| 56 |
+ |
|
| 57 |
+ if (!localStorage.getItem('SipTripPhone')) {
|
|
| 58 |
+ |
|
| 59 |
+ window.open(url, "SipTripPhone", "width=354,height=572,menubar=no,scrollbars=no,status=no,addressbar=no,resizable=no"); |
|
| 60 |
+ window.sipUserPasswd = sippassword; |
|
| 61 |
+ |
|
| 62 |
+ } else {
|
|
| 63 |
+ window.alert('The phone is already open !');
|
|
| 64 |
+ } |
|
| 65 |
+ } |
|
| 66 |
+ |
|
| 67 |
+ }); |
|
| 68 |
+ } |
|
| 69 |
+ }); |
|
| 70 |
+}); |
|
| 71 |
+ |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,71 +0,0 @@ |
| 1 |
-/** |
|
| 2 |
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
- * |
|
| 4 |
- * @author Double Bastion LLC |
|
| 5 |
- * |
|
| 6 |
- * @license GNU AGPL version 3 or any later version |
|
| 7 |
- * |
|
| 8 |
- * This program is free software; you can redistribute it and/or |
|
| 9 |
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
- * License as published by the Free Software Foundation; either |
|
| 11 |
- * version 3 of the License, or any later version. |
|
| 12 |
- * |
|
| 13 |
- * This program is distributed in the hope that it will be useful, |
|
| 14 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
- * |
|
| 18 |
- * You should have received a copy of the GNU Affero General Public |
|
| 19 |
- * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
- * |
|
| 21 |
- */ |
|
| 22 |
- |
|
| 23 |
-$(document).ready(function() {
|
|
| 24 |
- |
|
| 25 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 26 |
- var userid = "<?php p($userId); ?>"; |
|
| 27 |
- |
|
| 28 |
- $.ajax({
|
|
| 29 |
- method: 'GET', |
|
| 30 |
- url: baseUrl + '/' + userid, |
|
| 31 |
- contentType: 'application/json', |
|
| 32 |
- success: function(settingsdb) {
|
|
| 33 |
- |
|
| 34 |
- var connectData = {
|
|
| 35 |
- "User" : settingsdb.sipusername, |
|
| 36 |
- "Realm" : settingsdb.siprealm, |
|
| 37 |
- "Display" : settingsdb.pdisplayname, |
|
| 38 |
- "WSServer" : settingsdb.stphwssurl, |
|
| 39 |
- "Stun" : settingsdb.stunserver |
|
| 40 |
- }; |
|
| 41 |
- |
|
| 42 |
- localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 43 |
- |
|
| 44 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 45 |
- |
|
| 46 |
- $.ajax({
|
|
| 47 |
- method: 'GET', |
|
| 48 |
- url: baseUrl + '/' + userid, |
|
| 49 |
- contentType: 'text', |
|
| 50 |
- success: function(sippassword) {
|
|
| 51 |
- |
|
| 52 |
- var url = OC.generateUrl('/apps/sip_trip_phone/phone/index.html');
|
|
| 53 |
- |
|
| 54 |
- if (!localStorage.getItem('SipTripPhone')) {
|
|
| 55 |
- |
|
| 56 |
- window.open(url, "SipTripPhone", "width=320,height=490,menubar=no,scrollbars=no,status=no,addressbar=no,resizable=no"); |
|
| 57 |
- |
|
| 58 |
- window.sipUserPasswd = sippassword; |
|
| 59 |
- |
|
| 60 |
- } else {
|
|
| 61 |
- |
|
| 62 |
- window.alert('The phone is already open !');
|
|
| 63 |
- |
|
| 64 |
- } |
|
| 65 |
- } |
|
| 66 |
- |
|
| 67 |
- }); |
|
| 68 |
- } |
|
| 69 |
- }); |
|
| 70 |
-}); |
|
| 71 |
- |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,71 @@ |
| 1 |
+/** |
|
| 2 |
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
+ * |
|
| 4 |
+ * @author Double Bastion LLC |
|
| 5 |
+ * |
|
| 6 |
+ * @license GNU AGPL version 3 or any later version |
|
| 7 |
+ * |
|
| 8 |
+ * This program is free software; you can redistribute it and/or |
|
| 9 |
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
+ * License as published by the Free Software Foundation; either |
|
| 11 |
+ * version 3 of the License, or any later version. |
|
| 12 |
+ * |
|
| 13 |
+ * This program is distributed in the hope that it will be useful, |
|
| 14 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
+ * |
|
| 18 |
+ * You should have received a copy of the GNU Affero General Public |
|
| 19 |
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
+ * |
|
| 21 |
+ */ |
|
| 22 |
+ |
|
| 23 |
+$(document).ready(function() {
|
|
| 24 |
+ |
|
| 25 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 26 |
+ var userid = "<?php p($userId); ?>"; |
|
| 27 |
+ |
|
| 28 |
+ $.ajax({
|
|
| 29 |
+ method: 'GET', |
|
| 30 |
+ url: baseUrl + '/' + userid, |
|
| 31 |
+ contentType: 'application/json', |
|
| 32 |
+ success: function(settingsdb) {
|
|
| 33 |
+ |
|
| 34 |
+ var connectData = {
|
|
| 35 |
+ "User" : settingsdb.sipusername, |
|
| 36 |
+ "Realm" : settingsdb.siprealm, |
|
| 37 |
+ "Display" : settingsdb.pdisplayname, |
|
| 38 |
+ "WSServer" : settingsdb.stphwssurl, |
|
| 39 |
+ "Stun" : settingsdb.stunserver |
|
| 40 |
+ }; |
|
| 41 |
+ |
|
| 42 |
+ localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 43 |
+ |
|
| 44 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 45 |
+ |
|
| 46 |
+ $.ajax({
|
|
| 47 |
+ method: 'GET', |
|
| 48 |
+ url: baseUrl + '/' + userid, |
|
| 49 |
+ contentType: 'text', |
|
| 50 |
+ success: function(sippassword) {
|
|
| 51 |
+ |
|
| 52 |
+ var url = OC.generateUrl('/apps/sip_trip_phone/phone/index.html');
|
|
| 53 |
+ |
|
| 54 |
+ if (!localStorage.getItem('SipTripPhone')) {
|
|
| 55 |
+ |
|
| 56 |
+ window.open(url, "SipTripPhone", "width=320,height=490,menubar=no,scrollbars=no,status=no,addressbar=no,resizable=no"); |
|
| 57 |
+ |
|
| 58 |
+ window.sipUserPasswd = sippassword; |
|
| 59 |
+ |
|
| 60 |
+ } else {
|
|
| 61 |
+ |
|
| 62 |
+ window.alert('The phone is already open !');
|
|
| 63 |
+ |
|
| 64 |
+ } |
|
| 65 |
+ } |
|
| 66 |
+ |
|
| 67 |
+ }); |
|
| 68 |
+ } |
|
| 69 |
+ }); |
|
| 70 |
+}); |
|
| 71 |
+ |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,69 +0,0 @@ |
| 1 |
-/** |
|
| 2 |
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
- * |
|
| 4 |
- * @author Double Bastion LLC |
|
| 5 |
- * |
|
| 6 |
- * @license GNU AGPL version 3 or any later version |
|
| 7 |
- * |
|
| 8 |
- * This program is free software; you can redistribute it and/or |
|
| 9 |
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
- * License as published by the Free Software Foundation; either |
|
| 11 |
- * version 3 of the License, or any later version. |
|
| 12 |
- * |
|
| 13 |
- * This program is distributed in the hope that it will be useful, |
|
| 14 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
- * |
|
| 18 |
- * You should have received a copy of the GNU Affero General Public |
|
| 19 |
- * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
- * |
|
| 21 |
- */ |
|
| 22 |
- |
|
| 23 |
-$(document).ready(function() {
|
|
| 24 |
- |
|
| 25 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 26 |
- var userid = "<?php p($userId); ?>"; |
|
| 27 |
- |
|
| 28 |
- $.ajax({
|
|
| 29 |
- method: 'GET', |
|
| 30 |
- url: baseUrl + '/' + userid, |
|
| 31 |
- contentType: 'application/json', |
|
| 32 |
- success: function(settingsdb) {
|
|
| 33 |
- |
|
| 34 |
- var connectData = {
|
|
| 35 |
- "User" : settingsdb.sipusername, |
|
| 36 |
- "Realm" : settingsdb.siprealm, |
|
| 37 |
- "Display" : settingsdb.pdisplayname, |
|
| 38 |
- "WSServer" : settingsdb.stphwssurl, |
|
| 39 |
- "Stun" : settingsdb.stunserver |
|
| 40 |
- }; |
|
| 41 |
- |
|
| 42 |
- localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 43 |
- |
|
| 44 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 45 |
- |
|
| 46 |
- $.ajax({
|
|
| 47 |
- method: 'GET', |
|
| 48 |
- url: baseUrl + '/' + userid, |
|
| 49 |
- contentType: 'text', |
|
| 50 |
- success: function(sippassword) {
|
|
| 51 |
- |
|
| 52 |
- var url = OC.generateUrl('/apps/sip_trip_phone/phone/index.html');
|
|
| 53 |
- |
|
| 54 |
- var features = 'menubar=no,location=no,resizable=no,scrollbars=no,status=no,addressbar=no,width=320,height=490'; |
|
| 55 |
- |
|
| 56 |
- if (!localStorage.getItem('SipTripPhone')) {
|
|
| 57 |
- var newPopUpWindow = window.open(url, 'SipTripPhone', features); |
|
| 58 |
- window.sipUserPasswd = sippassword; |
|
| 59 |
- return false; |
|
| 60 |
- } else {
|
|
| 61 |
- window.alert('The phone is already open !');
|
|
| 62 |
- } |
|
| 63 |
- } |
|
| 64 |
- }); |
|
| 65 |
- |
|
| 66 |
- } |
|
| 67 |
- }); |
|
| 68 |
-}); |
|
| 69 |
- |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,69 @@ |
| 1 |
+/** |
|
| 2 |
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
+ * |
|
| 4 |
+ * @author Double Bastion LLC |
|
| 5 |
+ * |
|
| 6 |
+ * @license GNU AGPL version 3 or any later version |
|
| 7 |
+ * |
|
| 8 |
+ * This program is free software; you can redistribute it and/or |
|
| 9 |
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
+ * License as published by the Free Software Foundation; either |
|
| 11 |
+ * version 3 of the License, or any later version. |
|
| 12 |
+ * |
|
| 13 |
+ * This program is distributed in the hope that it will be useful, |
|
| 14 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
+ * |
|
| 18 |
+ * You should have received a copy of the GNU Affero General Public |
|
| 19 |
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
+ * |
|
| 21 |
+ */ |
|
| 22 |
+ |
|
| 23 |
+$(document).ready(function() {
|
|
| 24 |
+ |
|
| 25 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 26 |
+ var userid = "<?php p($userId); ?>"; |
|
| 27 |
+ |
|
| 28 |
+ $.ajax({
|
|
| 29 |
+ method: 'GET', |
|
| 30 |
+ url: baseUrl + '/' + userid, |
|
| 31 |
+ contentType: 'application/json', |
|
| 32 |
+ success: function(settingsdb) {
|
|
| 33 |
+ |
|
| 34 |
+ var connectData = {
|
|
| 35 |
+ "User" : settingsdb.sipusername, |
|
| 36 |
+ "Realm" : settingsdb.siprealm, |
|
| 37 |
+ "Display" : settingsdb.pdisplayname, |
|
| 38 |
+ "WSServer" : settingsdb.stphwssurl, |
|
| 39 |
+ "Stun" : settingsdb.stunserver |
|
| 40 |
+ }; |
|
| 41 |
+ |
|
| 42 |
+ localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 43 |
+ |
|
| 44 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 45 |
+ |
|
| 46 |
+ $.ajax({
|
|
| 47 |
+ method: 'GET', |
|
| 48 |
+ url: baseUrl + '/' + userid, |
|
| 49 |
+ contentType: 'text', |
|
| 50 |
+ success: function(sippassword) {
|
|
| 51 |
+ |
|
| 52 |
+ var url = OC.generateUrl('/apps/sip_trip_phone/phone/index.html');
|
|
| 53 |
+ |
|
| 54 |
+ var features = 'menubar=no,location=no,resizable=no,scrollbars=no,status=no,addressbar=no,width=320,height=490'; |
|
| 55 |
+ |
|
| 56 |
+ if (!localStorage.getItem('SipTripPhone')) {
|
|
| 57 |
+ var newPopUpWindow = window.open(url, 'SipTripPhone', features); |
|
| 58 |
+ window.sipUserPasswd = sippassword; |
|
| 59 |
+ return false; |
|
| 60 |
+ } else {
|
|
| 61 |
+ window.alert('The phone is already open !');
|
|
| 62 |
+ } |
|
| 63 |
+ } |
|
| 64 |
+ }); |
|
| 65 |
+ |
|
| 66 |
+ } |
|
| 67 |
+ }); |
|
| 68 |
+}); |
|
| 69 |
+ |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,69 +0,0 @@ |
| 1 |
-/** |
|
| 2 |
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
- * |
|
| 4 |
- * @author Double Bastion LLC |
|
| 5 |
- * |
|
| 6 |
- * @license GNU AGPL version 3 or any later version |
|
| 7 |
- * |
|
| 8 |
- * This program is free software; you can redistribute it and/or |
|
| 9 |
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
- * License as published by the Free Software Foundation; either |
|
| 11 |
- * version 3 of the License, or any later version. |
|
| 12 |
- * |
|
| 13 |
- * This program is distributed in the hope that it will be useful, |
|
| 14 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
- * |
|
| 18 |
- * You should have received a copy of the GNU Affero General Public |
|
| 19 |
- * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
- * |
|
| 21 |
- */ |
|
| 22 |
- |
|
| 23 |
-$(document).ready(function() {
|
|
| 24 |
- |
|
| 25 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 26 |
- var userid = "<?php p($userId); ?>"; |
|
| 27 |
- |
|
| 28 |
- $.ajax({
|
|
| 29 |
- method: 'GET', |
|
| 30 |
- url: baseUrl + '/' + userid, |
|
| 31 |
- contentType: 'application/json', |
|
| 32 |
- success: function(settingsdb) {
|
|
| 33 |
- |
|
| 34 |
- var connectData = {
|
|
| 35 |
- "User" : settingsdb.sipusername, |
|
| 36 |
- "Realm" : settingsdb.siprealm, |
|
| 37 |
- "Display" : settingsdb.pdisplayname, |
|
| 38 |
- "WSServer" : settingsdb.stphwssurl, |
|
| 39 |
- "Stun" : settingsdb.stunserver |
|
| 40 |
- }; |
|
| 41 |
- |
|
| 42 |
- localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 43 |
- |
|
| 44 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 45 |
- |
|
| 46 |
- $.ajax({
|
|
| 47 |
- method: 'GET', |
|
| 48 |
- url: baseUrl + '/' + userid, |
|
| 49 |
- contentType: 'text', |
|
| 50 |
- success: function(sippassword) {
|
|
| 51 |
- |
|
| 52 |
- var url = window.location.href + 'phone/index.html'; |
|
| 53 |
- |
|
| 54 |
- var features = 'menubar=no,location=no,resizable=no,scrollbars=no,status=no,addressbar=no,width=320,height=490'; |
|
| 55 |
- |
|
| 56 |
- if (!localStorage.getItem('SipTripPhone')) {
|
|
| 57 |
- var newPopUpWindow = window.open(url, 'SipTripPhone', features); |
|
| 58 |
- window.sipUserPasswd = sippassword; |
|
| 59 |
- return false; |
|
| 60 |
- } else {
|
|
| 61 |
- window.alert('The phone is already open !');
|
|
| 62 |
- } |
|
| 63 |
- } |
|
| 64 |
- }); |
|
| 65 |
- |
|
| 66 |
- } |
|
| 67 |
- }); |
|
| 68 |
-}); |
|
| 69 |
- |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,69 @@ |
| 1 |
+/** |
|
| 2 |
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
+ * |
|
| 4 |
+ * @author Double Bastion LLC |
|
| 5 |
+ * |
|
| 6 |
+ * @license GNU AGPL version 3 or any later version |
|
| 7 |
+ * |
|
| 8 |
+ * This program is free software; you can redistribute it and/or |
|
| 9 |
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
+ * License as published by the Free Software Foundation; either |
|
| 11 |
+ * version 3 of the License, or any later version. |
|
| 12 |
+ * |
|
| 13 |
+ * This program is distributed in the hope that it will be useful, |
|
| 14 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
+ * |
|
| 18 |
+ * You should have received a copy of the GNU Affero General Public |
|
| 19 |
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
+ * |
|
| 21 |
+ */ |
|
| 22 |
+ |
|
| 23 |
+$(document).ready(function() {
|
|
| 24 |
+ |
|
| 25 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 26 |
+ var userid = "<?php p($userId); ?>"; |
|
| 27 |
+ |
|
| 28 |
+ $.ajax({
|
|
| 29 |
+ method: 'GET', |
|
| 30 |
+ url: baseUrl + '/' + userid, |
|
| 31 |
+ contentType: 'application/json', |
|
| 32 |
+ success: function(settingsdb) {
|
|
| 33 |
+ |
|
| 34 |
+ var connectData = {
|
|
| 35 |
+ "User" : settingsdb.sipusername, |
|
| 36 |
+ "Realm" : settingsdb.siprealm, |
|
| 37 |
+ "Display" : settingsdb.pdisplayname, |
|
| 38 |
+ "WSServer" : settingsdb.stphwssurl, |
|
| 39 |
+ "Stun" : settingsdb.stunserver |
|
| 40 |
+ }; |
|
| 41 |
+ |
|
| 42 |
+ localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 43 |
+ |
|
| 44 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 45 |
+ |
|
| 46 |
+ $.ajax({
|
|
| 47 |
+ method: 'GET', |
|
| 48 |
+ url: baseUrl + '/' + userid, |
|
| 49 |
+ contentType: 'text', |
|
| 50 |
+ success: function(sippassword) {
|
|
| 51 |
+ |
|
| 52 |
+ var url = window.location.href + 'phone/index.html'; |
|
| 53 |
+ |
|
| 54 |
+ var features = 'menubar=no,location=no,resizable=no,scrollbars=no,status=no,addressbar=no,width=320,height=490'; |
|
| 55 |
+ |
|
| 56 |
+ if (!localStorage.getItem('SipTripPhone')) {
|
|
| 57 |
+ var newPopUpWindow = window.open(url, 'SipTripPhone', features); |
|
| 58 |
+ window.sipUserPasswd = sippassword; |
|
| 59 |
+ return false; |
|
| 60 |
+ } else {
|
|
| 61 |
+ window.alert('The phone is already open !');
|
|
| 62 |
+ } |
|
| 63 |
+ } |
|
| 64 |
+ }); |
|
| 65 |
+ |
|
| 66 |
+ } |
|
| 67 |
+ }); |
|
| 68 |
+}); |
|
| 69 |
+ |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,69 +0,0 @@ |
| 1 |
-/** |
|
| 2 |
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
- * |
|
| 4 |
- * @author Double Bastion LLC |
|
| 5 |
- * |
|
| 6 |
- * @license GNU AGPL version 3 or any later version |
|
| 7 |
- * |
|
| 8 |
- * This program is free software; you can redistribute it and/or |
|
| 9 |
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
- * License as published by the Free Software Foundation; either |
|
| 11 |
- * version 3 of the License, or any later version. |
|
| 12 |
- * |
|
| 13 |
- * This program is distributed in the hope that it will be useful, |
|
| 14 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
- * |
|
| 18 |
- * You should have received a copy of the GNU Affero General Public |
|
| 19 |
- * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
- * |
|
| 21 |
- */ |
|
| 22 |
- |
|
| 23 |
-$(document).ready(function() {
|
|
| 24 |
- |
|
| 25 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 26 |
- var userid = "<?php p($userId); ?>"; |
|
| 27 |
- |
|
| 28 |
- $.ajax({
|
|
| 29 |
- method: 'GET', |
|
| 30 |
- url: baseUrl + '/' + userid, |
|
| 31 |
- contentType: 'application/json', |
|
| 32 |
- success: function(settingsdb) {
|
|
| 33 |
- |
|
| 34 |
- var connectData = {
|
|
| 35 |
- "User" : settingsdb.sipusername, |
|
| 36 |
- "Realm" : settingsdb.siprealm, |
|
| 37 |
- "Display" : settingsdb.pdisplayname, |
|
| 38 |
- "WSServer" : settingsdb.stphwssurl, |
|
| 39 |
- "Stun" : settingsdb.stunserver |
|
| 40 |
- }; |
|
| 41 |
- |
|
| 42 |
- localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 43 |
- |
|
| 44 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 45 |
- |
|
| 46 |
- $.ajax({
|
|
| 47 |
- method: 'GET', |
|
| 48 |
- url: baseUrl + '/' + userid, |
|
| 49 |
- contentType: 'text', |
|
| 50 |
- success: function(sippassword) {
|
|
| 51 |
- |
|
| 52 |
- var url = window.location.href + 'phone/index.html'; |
|
| 53 |
- |
|
| 54 |
- var features = 'menubar=no,location=no,resizable=no,scrollbars=no,status=no,addressbar=no,width=320,height=490'; |
|
| 55 |
- |
|
| 56 |
- if (!localStorage.getItem('SipTripPhone')) {
|
|
| 57 |
- var newPopUpWindow = window.open(url, 'SipTripPhone', features); |
|
| 58 |
- window.sipUserPasswd = sippassword; |
|
| 59 |
- return false; |
|
| 60 |
- } else {
|
|
| 61 |
- window.alert('The phone is already open !');
|
|
| 62 |
- } |
|
| 63 |
- } |
|
| 64 |
- }); |
|
| 65 |
- |
|
| 66 |
- } |
|
| 67 |
- }); |
|
| 68 |
-}); |
|
| 69 |
- |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,69 @@ |
| 1 |
+/** |
|
| 2 |
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
+ * |
|
| 4 |
+ * @author Double Bastion LLC |
|
| 5 |
+ * |
|
| 6 |
+ * @license GNU AGPL version 3 or any later version |
|
| 7 |
+ * |
|
| 8 |
+ * This program is free software; you can redistribute it and/or |
|
| 9 |
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
+ * License as published by the Free Software Foundation; either |
|
| 11 |
+ * version 3 of the License, or any later version. |
|
| 12 |
+ * |
|
| 13 |
+ * This program is distributed in the hope that it will be useful, |
|
| 14 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
+ * |
|
| 18 |
+ * You should have received a copy of the GNU Affero General Public |
|
| 19 |
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
+ * |
|
| 21 |
+ */ |
|
| 22 |
+ |
|
| 23 |
+$(document).ready(function() {
|
|
| 24 |
+ |
|
| 25 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 26 |
+ var userid = "<?php p($userId); ?>"; |
|
| 27 |
+ |
|
| 28 |
+ $.ajax({
|
|
| 29 |
+ method: 'GET', |
|
| 30 |
+ url: baseUrl + '/' + userid, |
|
| 31 |
+ contentType: 'application/json', |
|
| 32 |
+ success: function(settingsdb) {
|
|
| 33 |
+ |
|
| 34 |
+ var connectData = {
|
|
| 35 |
+ "User" : settingsdb.sipusername, |
|
| 36 |
+ "Realm" : settingsdb.siprealm, |
|
| 37 |
+ "Display" : settingsdb.pdisplayname, |
|
| 38 |
+ "WSServer" : settingsdb.stphwssurl, |
|
| 39 |
+ "Stun" : settingsdb.stunserver |
|
| 40 |
+ }; |
|
| 41 |
+ |
|
| 42 |
+ localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 43 |
+ |
|
| 44 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 45 |
+ |
|
| 46 |
+ $.ajax({
|
|
| 47 |
+ method: 'GET', |
|
| 48 |
+ url: baseUrl + '/' + userid, |
|
| 49 |
+ contentType: 'text', |
|
| 50 |
+ success: function(sippassword) {
|
|
| 51 |
+ |
|
| 52 |
+ var url = window.location.href + 'phone/index.html'; |
|
| 53 |
+ |
|
| 54 |
+ var features = 'menubar=no,location=no,resizable=no,scrollbars=no,status=no,addressbar=no,width=320,height=490'; |
|
| 55 |
+ |
|
| 56 |
+ if (!localStorage.getItem('SipTripPhone')) {
|
|
| 57 |
+ var newPopUpWindow = window.open(url, 'SipTripPhone', features); |
|
| 58 |
+ window.sipUserPasswd = sippassword; |
|
| 59 |
+ return false; |
|
| 60 |
+ } else {
|
|
| 61 |
+ window.alert('The phone is already open !');
|
|
| 62 |
+ } |
|
| 63 |
+ } |
|
| 64 |
+ }); |
|
| 65 |
+ |
|
| 66 |
+ } |
|
| 67 |
+ }); |
|
| 68 |
+}); |
|
| 69 |
+ |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,69 +0,0 @@ |
| 1 |
-/** |
|
| 2 |
- * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
- * |
|
| 4 |
- * @author Double Bastion LLC |
|
| 5 |
- * |
|
| 6 |
- * @license GNU AGPL version 3 or any later version |
|
| 7 |
- * |
|
| 8 |
- * This program is free software; you can redistribute it and/or |
|
| 9 |
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
- * License as published by the Free Software Foundation; either |
|
| 11 |
- * version 3 of the License, or any later version. |
|
| 12 |
- * |
|
| 13 |
- * This program is distributed in the hope that it will be useful, |
|
| 14 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
- * |
|
| 18 |
- * You should have received a copy of the GNU Affero General Public |
|
| 19 |
- * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
- * |
|
| 21 |
- */ |
|
| 22 |
- |
|
| 23 |
-$(document).ready(function() {
|
|
| 24 |
- |
|
| 25 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 26 |
- var userid = "<?php p($userId); ?>"; |
|
| 27 |
- |
|
| 28 |
- $.ajax({
|
|
| 29 |
- method: 'GET', |
|
| 30 |
- url: baseUrl + '/' + userid, |
|
| 31 |
- contentType: 'application/json', |
|
| 32 |
- success: function(settingsdb) {
|
|
| 33 |
- |
|
| 34 |
- var connectData = {
|
|
| 35 |
- "User" : settingsdb.sipusername, |
|
| 36 |
- "Realm" : settingsdb.siprealm, |
|
| 37 |
- "Display" : settingsdb.pdisplayname, |
|
| 38 |
- "WSServer" : settingsdb.stphwssurl, |
|
| 39 |
- "Stun" : settingsdb.stunserver |
|
| 40 |
- }; |
|
| 41 |
- |
|
| 42 |
- localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 43 |
- |
|
| 44 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 45 |
- |
|
| 46 |
- $.ajax({
|
|
| 47 |
- method: 'GET', |
|
| 48 |
- url: baseUrl + '/' + userid, |
|
| 49 |
- contentType: 'text', |
|
| 50 |
- success: function(sippassword) {
|
|
| 51 |
- |
|
| 52 |
- var url = 'https://' + window.location.host + '/apps/sip_trip_phone/phone/index.html'; |
|
| 53 |
- |
|
| 54 |
- var features = 'menubar=no,location=no,resizable=no,scrollbars=no,status=no,addressbar=no,width=320,height=490'; |
|
| 55 |
- |
|
| 56 |
- if (!localStorage.getItem('SipTripPhone')) {
|
|
| 57 |
- var newPopUpWindow = window.open(url, 'SipTripPhone', features); |
|
| 58 |
- window.sipUserPasswd = sippassword; |
|
| 59 |
- return false; |
|
| 60 |
- } else {
|
|
| 61 |
- window.alert('The phone is already open !');
|
|
| 62 |
- } |
|
| 63 |
- } |
|
| 64 |
- }); |
|
| 65 |
- |
|
| 66 |
- } |
|
| 67 |
- }); |
|
| 68 |
-}); |
|
| 69 |
- |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,69 @@ |
| 1 |
+/** |
|
| 2 |
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com> |
|
| 3 |
+ * |
|
| 4 |
+ * @author Double Bastion LLC |
|
| 5 |
+ * |
|
| 6 |
+ * @license GNU AGPL version 3 or any later version |
|
| 7 |
+ * |
|
| 8 |
+ * This program is free software; you can redistribute it and/or |
|
| 9 |
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
| 10 |
+ * License as published by the Free Software Foundation; either |
|
| 11 |
+ * version 3 of the License, or any later version. |
|
| 12 |
+ * |
|
| 13 |
+ * This program is distributed in the hope that it will be useful, |
|
| 14 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 15 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 16 |
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
|
| 17 |
+ * |
|
| 18 |
+ * You should have received a copy of the GNU Affero General Public |
|
| 19 |
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 20 |
+ * |
|
| 21 |
+ */ |
|
| 22 |
+ |
|
| 23 |
+$(document).ready(function() {
|
|
| 24 |
+ |
|
| 25 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 26 |
+ var userid = "<?php p($userId); ?>"; |
|
| 27 |
+ |
|
| 28 |
+ $.ajax({
|
|
| 29 |
+ method: 'GET', |
|
| 30 |
+ url: baseUrl + '/' + userid, |
|
| 31 |
+ contentType: 'application/json', |
|
| 32 |
+ success: function(settingsdb) {
|
|
| 33 |
+ |
|
| 34 |
+ var connectData = {
|
|
| 35 |
+ "User" : settingsdb.sipusername, |
|
| 36 |
+ "Realm" : settingsdb.siprealm, |
|
| 37 |
+ "Display" : settingsdb.pdisplayname, |
|
| 38 |
+ "WSServer" : settingsdb.stphwssurl, |
|
| 39 |
+ "Stun" : settingsdb.stunserver |
|
| 40 |
+ }; |
|
| 41 |
+ |
|
| 42 |
+ localStorage.setItem('SIPCreds', JSON.stringify(connectData));
|
|
| 43 |
+ |
|
| 44 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsippass');
|
|
| 45 |
+ |
|
| 46 |
+ $.ajax({
|
|
| 47 |
+ method: 'GET', |
|
| 48 |
+ url: baseUrl + '/' + userid, |
|
| 49 |
+ contentType: 'text', |
|
| 50 |
+ success: function(sippassword) {
|
|
| 51 |
+ |
|
| 52 |
+ var url = 'https://' + window.location.host + '/apps/sip_trip_phone/phone/index.html'; |
|
| 53 |
+ |
|
| 54 |
+ var features = 'menubar=no,location=no,resizable=no,scrollbars=no,status=no,addressbar=no,width=320,height=490'; |
|
| 55 |
+ |
|
| 56 |
+ if (!localStorage.getItem('SipTripPhone')) {
|
|
| 57 |
+ var newPopUpWindow = window.open(url, 'SipTripPhone', features); |
|
| 58 |
+ window.sipUserPasswd = sippassword; |
|
| 59 |
+ return false; |
|
| 60 |
+ } else {
|
|
| 61 |
+ window.alert('The phone is already open !');
|
|
| 62 |
+ } |
|
| 63 |
+ } |
|
| 64 |
+ }); |
|
| 65 |
+ |
|
| 66 |
+ } |
|
| 67 |
+ }); |
|
| 68 |
+}); |
|
| 69 |
+ |