| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,91 @@ |
| 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 |
+ // 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 |
+ $('#save_sipph_settings').on('click', function(event){
|
|
| 34 |
+ |
|
| 35 |
+ event.preventDefault(); |
|
| 36 |
+ OC.msg.startAction('#sip_trip_phone_save_msg', t('sip_trip_phone', 'Saved'));
|
|
| 37 |
+ |
|
| 38 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/updatesettings');
|
|
| 39 |
+ var checkedornot = 0; |
|
| 40 |
+ if ($("#tracesipmsg").is(":checked")) { checkedornot = 1; }
|
|
| 41 |
+ |
|
| 42 |
+ var datatobesaved = {
|
|
| 43 |
+ pdisplayname: $('#pdisplayname').val(),
|
|
| 44 |
+ sipusername: $('#sipusername').val(),
|
|
| 45 |
+ sipuserpassword: $('#sipuserpassword').val(),
|
|
| 46 |
+ stphwssurl: $('#stphwssurl').val(),
|
|
| 47 |
+ siprealm: $('#siprealm').val(),
|
|
| 48 |
+ stunserver: $('#stunserver').val(),
|
|
| 49 |
+ tracesipmsg: checkedornot, |
|
| 50 |
+ voicenumbers: $('#voicenumbers').val(),
|
|
| 51 |
+ defaultvoicenumber: $('#defaultvoicenumber').val()
|
|
| 52 |
+ }; |
|
| 53 |
+ |
|
| 54 |
+ $.ajax({
|
|
| 55 |
+ method: 'PUT', |
|
| 56 |
+ url: baseUrl, |
|
| 57 |
+ contentType: 'application/json', |
|
| 58 |
+ data: JSON.stringify(datatobesaved), |
|
| 59 |
+ error: function(resp) {
|
|
| 60 |
+ alert('Error ! Please check your settings !');
|
|
| 61 |
+ } |
|
| 62 |
+ |
|
| 63 |
+ }); |
|
| 64 |
+ |
|
| 65 |
+ }); |
|
| 66 |
+ |
|
| 67 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 68 |
+ |
|
| 69 |
+ $.ajax({
|
|
| 70 |
+ method: 'GET', |
|
| 71 |
+ url: baseUrl, |
|
| 72 |
+ contentType: 'application/json', |
|
| 73 |
+ success: function(settingsdb) {
|
|
| 74 |
+ $("#pdisplayname").val(settingsdb.pdisplayname);
|
|
| 75 |
+ $("#sipusername").val(settingsdb.sipusername);
|
|
| 76 |
+ $("#sipuserpassword").val(settingsdb.sipuserpassword);
|
|
| 77 |
+ $("#stphwssurl").val(settingsdb.stphwssurl);
|
|
| 78 |
+ $("#siprealm").val(settingsdb.siprealm);
|
|
| 79 |
+ $("#stunserver").val(settingsdb.stunserver);
|
|
| 80 |
+ $('#voicenumbers').val(settingsdb.voicenumbers);
|
|
| 81 |
+ $('#defaultvoicenumber').val(settingsdb.defaultvoicenumber);
|
|
| 82 |
+ |
|
| 83 |
+ if (settingsdb.tracesipmsg == 1) {
|
|
| 84 |
+ $('#tracesipmsg').attr('checked', true);
|
|
| 85 |
+ } else {
|
|
| 86 |
+ $('#tracesipmsg').attr('checked', false);
|
|
| 87 |
+ } |
|
| 88 |
+ } |
|
| 89 |
+ }); |
|
| 90 |
+ |
|
| 91 |
+}); |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,83 +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 |
- $('#save_sipph_settings').on('click', function(event){
|
|
| 26 |
- |
|
| 27 |
- event.preventDefault(); |
|
| 28 |
- OC.msg.startAction('#sip_trip_phone_save_msg', t('sip_trip_phone', 'Saved'));
|
|
| 29 |
- |
|
| 30 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/updatesettings');
|
|
| 31 |
- var checkedornot = 0; |
|
| 32 |
- if ($("#tracesipmsg").is(":checked")) { checkedornot = 1; }
|
|
| 33 |
- |
|
| 34 |
- var datatobesaved = {
|
|
| 35 |
- pdisplayname: $('#pdisplayname').val(),
|
|
| 36 |
- sipusername: $('#sipusername').val(),
|
|
| 37 |
- sipuserpassword: $('#sipuserpassword').val(),
|
|
| 38 |
- stphwssurl: $('#stphwssurl').val(),
|
|
| 39 |
- siprealm: $('#siprealm').val(),
|
|
| 40 |
- stunserver: $('#stunserver').val(),
|
|
| 41 |
- tracesipmsg: checkedornot, |
|
| 42 |
- voicenumbers: $('#voicenumbers').val(),
|
|
| 43 |
- defaultvoicenumber: $('#defaultvoicenumber').val()
|
|
| 44 |
- }; |
|
| 45 |
- |
|
| 46 |
- $.ajax({
|
|
| 47 |
- method: 'PUT', |
|
| 48 |
- url: baseUrl, |
|
| 49 |
- contentType: 'application/json', |
|
| 50 |
- data: JSON.stringify(datatobesaved), |
|
| 51 |
- error: function(resp) {
|
|
| 52 |
- alert('Error ! Please check your settings !');
|
|
| 53 |
- } |
|
| 54 |
- |
|
| 55 |
- }); |
|
| 56 |
- |
|
| 57 |
- }); |
|
| 58 |
- |
|
| 59 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 60 |
- |
|
| 61 |
- $.ajax({
|
|
| 62 |
- method: 'GET', |
|
| 63 |
- url: baseUrl, |
|
| 64 |
- contentType: 'application/json', |
|
| 65 |
- success: function(settingsdb) {
|
|
| 66 |
- $("#pdisplayname").val(settingsdb.pdisplayname);
|
|
| 67 |
- $("#sipusername").val(settingsdb.sipusername);
|
|
| 68 |
- $("#sipuserpassword").val(settingsdb.sipuserpassword);
|
|
| 69 |
- $("#stphwssurl").val(settingsdb.stphwssurl);
|
|
| 70 |
- $("#siprealm").val(settingsdb.siprealm);
|
|
| 71 |
- $("#stunserver").val(settingsdb.stunserver);
|
|
| 72 |
- $('#voicenumbers').val(settingsdb.voicenumbers);
|
|
| 73 |
- $('#defaultvoicenumber').val(settingsdb.defaultvoicenumber);
|
|
| 74 |
- |
|
| 75 |
- if (settingsdb.tracesipmsg == 1) {
|
|
| 76 |
- $('#tracesipmsg').attr('checked', true);
|
|
| 77 |
- } else {
|
|
| 78 |
- $('#tracesipmsg').attr('checked', false);
|
|
| 79 |
- } |
|
| 80 |
- } |
|
| 81 |
- }); |
|
| 82 |
- |
|
| 83 |
-}); |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,83 @@ |
| 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 |
+ $('#save_sipph_settings').on('click', function(event){
|
|
| 26 |
+ |
|
| 27 |
+ event.preventDefault(); |
|
| 28 |
+ OC.msg.startAction('#sip_trip_phone_save_msg', t('sip_trip_phone', 'Saved'));
|
|
| 29 |
+ |
|
| 30 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/updatesettings');
|
|
| 31 |
+ var checkedornot = 0; |
|
| 32 |
+ if ($("#tracesipmsg").is(":checked")) { checkedornot = 1; }
|
|
| 33 |
+ |
|
| 34 |
+ var datatobesaved = {
|
|
| 35 |
+ pdisplayname: $('#pdisplayname').val(),
|
|
| 36 |
+ sipusername: $('#sipusername').val(),
|
|
| 37 |
+ sipuserpassword: $('#sipuserpassword').val(),
|
|
| 38 |
+ stphwssurl: $('#stphwssurl').val(),
|
|
| 39 |
+ siprealm: $('#siprealm').val(),
|
|
| 40 |
+ stunserver: $('#stunserver').val(),
|
|
| 41 |
+ tracesipmsg: checkedornot, |
|
| 42 |
+ voicenumbers: $('#voicenumbers').val(),
|
|
| 43 |
+ defaultvoicenumber: $('#defaultvoicenumber').val()
|
|
| 44 |
+ }; |
|
| 45 |
+ |
|
| 46 |
+ $.ajax({
|
|
| 47 |
+ method: 'PUT', |
|
| 48 |
+ url: baseUrl, |
|
| 49 |
+ contentType: 'application/json', |
|
| 50 |
+ data: JSON.stringify(datatobesaved), |
|
| 51 |
+ error: function(resp) {
|
|
| 52 |
+ alert('Error ! Please check your settings !');
|
|
| 53 |
+ } |
|
| 54 |
+ |
|
| 55 |
+ }); |
|
| 56 |
+ |
|
| 57 |
+ }); |
|
| 58 |
+ |
|
| 59 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 60 |
+ |
|
| 61 |
+ $.ajax({
|
|
| 62 |
+ method: 'GET', |
|
| 63 |
+ url: baseUrl, |
|
| 64 |
+ contentType: 'application/json', |
|
| 65 |
+ success: function(settingsdb) {
|
|
| 66 |
+ $("#pdisplayname").val(settingsdb.pdisplayname);
|
|
| 67 |
+ $("#sipusername").val(settingsdb.sipusername);
|
|
| 68 |
+ $("#sipuserpassword").val(settingsdb.sipuserpassword);
|
|
| 69 |
+ $("#stphwssurl").val(settingsdb.stphwssurl);
|
|
| 70 |
+ $("#siprealm").val(settingsdb.siprealm);
|
|
| 71 |
+ $("#stunserver").val(settingsdb.stunserver);
|
|
| 72 |
+ $('#voicenumbers').val(settingsdb.voicenumbers);
|
|
| 73 |
+ $('#defaultvoicenumber').val(settingsdb.defaultvoicenumber);
|
|
| 74 |
+ |
|
| 75 |
+ if (settingsdb.tracesipmsg == 1) {
|
|
| 76 |
+ $('#tracesipmsg').attr('checked', true);
|
|
| 77 |
+ } else {
|
|
| 78 |
+ $('#tracesipmsg').attr('checked', false);
|
|
| 79 |
+ } |
|
| 80 |
+ } |
|
| 81 |
+ }); |
|
| 82 |
+ |
|
| 83 |
+}); |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,86 +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 |
- $('#save_sipph_settings').on('click', function(event){
|
|
| 26 |
- |
|
| 27 |
- event.preventDefault(); |
|
| 28 |
- OC.msg.startAction('#sip_trip_phone_save_msg', t('sip_trip_phone', 'Saved'));
|
|
| 29 |
- |
|
| 30 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/updatesettings');
|
|
| 31 |
- var userid = "<?php p($userId); ?>"; |
|
| 32 |
- var checkedornot = 0; |
|
| 33 |
- if ($("#tracesipmsg").is(":checked")) { checkedornot = 1; }
|
|
| 34 |
- |
|
| 35 |
- var datatobesaved = {
|
|
| 36 |
- userId: userid, |
|
| 37 |
- pdisplayname: $('#pdisplayname').val(),
|
|
| 38 |
- sipusername: $('#sipusername').val(),
|
|
| 39 |
- sipuserpassword: $('#sipuserpassword').val(),
|
|
| 40 |
- stphwssurl: $('#stphwssurl').val(),
|
|
| 41 |
- siprealm: $('#siprealm').val(),
|
|
| 42 |
- stunserver: $('#stunserver').val(),
|
|
| 43 |
- tracesipmsg: checkedornot, |
|
| 44 |
- voicenumbers: $('#voicenumbers').val(),
|
|
| 45 |
- defaultvoicenumber: $('#defaultvoicenumber').val()
|
|
| 46 |
- }; |
|
| 47 |
- |
|
| 48 |
- $.ajax({
|
|
| 49 |
- method: 'PUT', |
|
| 50 |
- url: baseUrl + '/' + userid, |
|
| 51 |
- contentType: 'application/json', |
|
| 52 |
- data: JSON.stringify(datatobesaved), |
|
| 53 |
- error: function(resp) {
|
|
| 54 |
- alert('Error ! Please check your settings !');
|
|
| 55 |
- } |
|
| 56 |
- |
|
| 57 |
- }); |
|
| 58 |
- |
|
| 59 |
- }); |
|
| 60 |
- |
|
| 61 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 62 |
- var userid = "<?php p($userId); ?>"; |
|
| 63 |
- |
|
| 64 |
- $.ajax({
|
|
| 65 |
- method: 'GET', |
|
| 66 |
- url: baseUrl + '/' + userid, |
|
| 67 |
- contentType: 'application/json', |
|
| 68 |
- success: function(settingsdb) {
|
|
| 69 |
- $("#pdisplayname").val(settingsdb.pdisplayname);
|
|
| 70 |
- $("#sipusername").val(settingsdb.sipusername);
|
|
| 71 |
- $("#sipuserpassword").val(settingsdb.sipuserpassword);
|
|
| 72 |
- $("#stphwssurl").val(settingsdb.stphwssurl);
|
|
| 73 |
- $("#siprealm").val(settingsdb.siprealm);
|
|
| 74 |
- $("#stunserver").val(settingsdb.stunserver);
|
|
| 75 |
- $('#voicenumbers').val(settingsdb.voicenumbers);
|
|
| 76 |
- $('#defaultvoicenumber').val(settingsdb.defaultvoicenumber);
|
|
| 77 |
- |
|
| 78 |
- if (settingsdb.tracesipmsg == 1) {
|
|
| 79 |
- $('#tracesipmsg').attr('checked', true);
|
|
| 80 |
- } else {
|
|
| 81 |
- $('#tracesipmsg').attr('checked', false);
|
|
| 82 |
- } |
|
| 83 |
- } |
|
| 84 |
- }); |
|
| 85 |
- |
|
| 86 |
-}); |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,86 @@ |
| 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 |
+ $('#save_sipph_settings').on('click', function(event){
|
|
| 26 |
+ |
|
| 27 |
+ event.preventDefault(); |
|
| 28 |
+ OC.msg.startAction('#sip_trip_phone_save_msg', t('sip_trip_phone', 'Saved'));
|
|
| 29 |
+ |
|
| 30 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/updatesettings');
|
|
| 31 |
+ var userid = "<?php p($userId); ?>"; |
|
| 32 |
+ var checkedornot = 0; |
|
| 33 |
+ if ($("#tracesipmsg").is(":checked")) { checkedornot = 1; }
|
|
| 34 |
+ |
|
| 35 |
+ var datatobesaved = {
|
|
| 36 |
+ userId: userid, |
|
| 37 |
+ pdisplayname: $('#pdisplayname').val(),
|
|
| 38 |
+ sipusername: $('#sipusername').val(),
|
|
| 39 |
+ sipuserpassword: $('#sipuserpassword').val(),
|
|
| 40 |
+ stphwssurl: $('#stphwssurl').val(),
|
|
| 41 |
+ siprealm: $('#siprealm').val(),
|
|
| 42 |
+ stunserver: $('#stunserver').val(),
|
|
| 43 |
+ tracesipmsg: checkedornot, |
|
| 44 |
+ voicenumbers: $('#voicenumbers').val(),
|
|
| 45 |
+ defaultvoicenumber: $('#defaultvoicenumber').val()
|
|
| 46 |
+ }; |
|
| 47 |
+ |
|
| 48 |
+ $.ajax({
|
|
| 49 |
+ method: 'PUT', |
|
| 50 |
+ url: baseUrl + '/' + userid, |
|
| 51 |
+ contentType: 'application/json', |
|
| 52 |
+ data: JSON.stringify(datatobesaved), |
|
| 53 |
+ error: function(resp) {
|
|
| 54 |
+ alert('Error ! Please check your settings !');
|
|
| 55 |
+ } |
|
| 56 |
+ |
|
| 57 |
+ }); |
|
| 58 |
+ |
|
| 59 |
+ }); |
|
| 60 |
+ |
|
| 61 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 62 |
+ var userid = "<?php p($userId); ?>"; |
|
| 63 |
+ |
|
| 64 |
+ $.ajax({
|
|
| 65 |
+ method: 'GET', |
|
| 66 |
+ url: baseUrl + '/' + userid, |
|
| 67 |
+ contentType: 'application/json', |
|
| 68 |
+ success: function(settingsdb) {
|
|
| 69 |
+ $("#pdisplayname").val(settingsdb.pdisplayname);
|
|
| 70 |
+ $("#sipusername").val(settingsdb.sipusername);
|
|
| 71 |
+ $("#sipuserpassword").val(settingsdb.sipuserpassword);
|
|
| 72 |
+ $("#stphwssurl").val(settingsdb.stphwssurl);
|
|
| 73 |
+ $("#siprealm").val(settingsdb.siprealm);
|
|
| 74 |
+ $("#stunserver").val(settingsdb.stunserver);
|
|
| 75 |
+ $('#voicenumbers').val(settingsdb.voicenumbers);
|
|
| 76 |
+ $('#defaultvoicenumber').val(settingsdb.defaultvoicenumber);
|
|
| 77 |
+ |
|
| 78 |
+ if (settingsdb.tracesipmsg == 1) {
|
|
| 79 |
+ $('#tracesipmsg').attr('checked', true);
|
|
| 80 |
+ } else {
|
|
| 81 |
+ $('#tracesipmsg').attr('checked', false);
|
|
| 82 |
+ } |
|
| 83 |
+ } |
|
| 84 |
+ }); |
|
| 85 |
+ |
|
| 86 |
+}); |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,73 +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 |
- $('#save_sipph_settings').on('click', function(event){
|
|
| 26 |
- |
|
| 27 |
- event.preventDefault(); |
|
| 28 |
- OC.msg.startAction('#sip_trip_phone_save_msg', t('sip_trip_phone', 'Saved'));
|
|
| 29 |
- |
|
| 30 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/updatesettings');
|
|
| 31 |
- var userid = "<?php p($userId); ?>"; |
|
| 32 |
- |
|
| 33 |
- var datatobesaved = {
|
|
| 34 |
- userId: userid, |
|
| 35 |
- pdisplayname: $('#pdisplayname').val(),
|
|
| 36 |
- sipusername: $('#sipusername').val(),
|
|
| 37 |
- sipuserpassword: $('#sipuserpassword').val(),
|
|
| 38 |
- stphwssurl: $('#stphwssurl').val(),
|
|
| 39 |
- siprealm: $('#siprealm').val(),
|
|
| 40 |
- stunserver: $('#stunserver').val()
|
|
| 41 |
- }; |
|
| 42 |
- |
|
| 43 |
- $.ajax({
|
|
| 44 |
- method: 'PUT', |
|
| 45 |
- url: baseUrl + '/' + userid, |
|
| 46 |
- contentType: 'application/json', |
|
| 47 |
- data: JSON.stringify(datatobesaved), |
|
| 48 |
- error: function(resp) {
|
|
| 49 |
- alert('Error ! Please check your settings !');
|
|
| 50 |
- } |
|
| 51 |
- |
|
| 52 |
- }); |
|
| 53 |
- |
|
| 54 |
- }); |
|
| 55 |
- |
|
| 56 |
- var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 57 |
- var userid = "<?php p($userId); ?>"; |
|
| 58 |
- |
|
| 59 |
- $.ajax({
|
|
| 60 |
- method: 'GET', |
|
| 61 |
- url: baseUrl + '/' + userid, |
|
| 62 |
- contentType: 'application/json', |
|
| 63 |
- success: function(settingsdb) {
|
|
| 64 |
- $("#pdisplayname").val(settingsdb.pdisplayname);
|
|
| 65 |
- $("#sipusername").val(settingsdb.sipusername);
|
|
| 66 |
- $("#sipuserpassword").val(settingsdb.sipuserpassword);
|
|
| 67 |
- $("#stphwssurl").val(settingsdb.stphwssurl);
|
|
| 68 |
- $("#siprealm").val(settingsdb.siprealm);
|
|
| 69 |
- $("#stunserver").val(settingsdb.stunserver);
|
|
| 70 |
- } |
|
| 71 |
- }); |
|
| 72 |
- |
|
| 73 |
-}); |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,73 @@ |
| 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 |
+ $('#save_sipph_settings').on('click', function(event){
|
|
| 26 |
+ |
|
| 27 |
+ event.preventDefault(); |
|
| 28 |
+ OC.msg.startAction('#sip_trip_phone_save_msg', t('sip_trip_phone', 'Saved'));
|
|
| 29 |
+ |
|
| 30 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/updatesettings');
|
|
| 31 |
+ var userid = "<?php p($userId); ?>"; |
|
| 32 |
+ |
|
| 33 |
+ var datatobesaved = {
|
|
| 34 |
+ userId: userid, |
|
| 35 |
+ pdisplayname: $('#pdisplayname').val(),
|
|
| 36 |
+ sipusername: $('#sipusername').val(),
|
|
| 37 |
+ sipuserpassword: $('#sipuserpassword').val(),
|
|
| 38 |
+ stphwssurl: $('#stphwssurl').val(),
|
|
| 39 |
+ siprealm: $('#siprealm').val(),
|
|
| 40 |
+ stunserver: $('#stunserver').val()
|
|
| 41 |
+ }; |
|
| 42 |
+ |
|
| 43 |
+ $.ajax({
|
|
| 44 |
+ method: 'PUT', |
|
| 45 |
+ url: baseUrl + '/' + userid, |
|
| 46 |
+ contentType: 'application/json', |
|
| 47 |
+ data: JSON.stringify(datatobesaved), |
|
| 48 |
+ error: function(resp) {
|
|
| 49 |
+ alert('Error ! Please check your settings !');
|
|
| 50 |
+ } |
|
| 51 |
+ |
|
| 52 |
+ }); |
|
| 53 |
+ |
|
| 54 |
+ }); |
|
| 55 |
+ |
|
| 56 |
+ var baseUrl = OC.generateUrl('/apps/sip_trip_phone/user/getsettings');
|
|
| 57 |
+ var userid = "<?php p($userId); ?>"; |
|
| 58 |
+ |
|
| 59 |
+ $.ajax({
|
|
| 60 |
+ method: 'GET', |
|
| 61 |
+ url: baseUrl + '/' + userid, |
|
| 62 |
+ contentType: 'application/json', |
|
| 63 |
+ success: function(settingsdb) {
|
|
| 64 |
+ $("#pdisplayname").val(settingsdb.pdisplayname);
|
|
| 65 |
+ $("#sipusername").val(settingsdb.sipusername);
|
|
| 66 |
+ $("#sipuserpassword").val(settingsdb.sipuserpassword);
|
|
| 67 |
+ $("#stphwssurl").val(settingsdb.stphwssurl);
|
|
| 68 |
+ $("#siprealm").val(settingsdb.siprealm);
|
|
| 69 |
+ $("#stunserver").val(settingsdb.stunserver);
|
|
| 70 |
+ } |
|
| 71 |
+ }); |
|
| 72 |
+ |
|
| 73 |
+}); |