From 65603104b398397765ec81be8552cb0d9f8aa6ad Mon Sep 17 00:00:00 2001 From: Orestis Tsakiridis Date: Wed, 3 May 2017 11:31:16 +0300 Subject: [PATCH] Quick patches to test RVD in standalone mode --- .../connect/rvd/RvdConfiguration.java | 9 +- designer/src/main/webapp/WEB-INF/restcomm.xml | 597 ++++++++++++++++++ .../js/app/controllers/projectManager.js | 4 +- .../src/main/webapp/js/app/interceptors.js | 4 +- designer/src/main/webapp/js/app/services.js | 5 +- 5 files changed, 609 insertions(+), 10 deletions(-) create mode 100644 designer/src/main/webapp/WEB-INF/restcomm.xml diff --git a/designer/src/main/java/org/restcomm/connect/rvd/RvdConfiguration.java b/designer/src/main/java/org/restcomm/connect/rvd/RvdConfiguration.java index e57676e..8f8dbe5 100644 --- a/designer/src/main/java/org/restcomm/connect/rvd/RvdConfiguration.java +++ b/designer/src/main/java/org/restcomm/connect/rvd/RvdConfiguration.java @@ -71,7 +71,7 @@ public class RvdConfiguration { private RvdConfig rvdConfig; // the configuration settings from rvd.xml private RestcommConfig restcommConfig; - private String contextRootPath; + private String contextRootPath; // e.g. a/path/ending/in/slash/ private URI restcommBaseUri; private Integer externalServiceTimeout; @@ -80,13 +80,14 @@ public class RvdConfiguration { } public RvdConfiguration(ServletContext servletContext) { - contextRootPath = servletContext.getRealPath("/"); - logger.info("context root path is " + contextRootPath); - load(); + this(servletContext.getRealPath("/")); } public RvdConfiguration(String contextRootPath) { this.contextRootPath = contextRootPath; + // append trailing slash if not already there + if (this.contextRootPath != null && !this.contextRootPath.endsWith("/")) + this.contextRootPath += "/"; logger.info("context root path is " + contextRootPath); load(); } diff --git a/designer/src/main/webapp/WEB-INF/restcomm.xml b/designer/src/main/webapp/WEB-INF/restcomm.xml new file mode 100644 index 0000000..c08c00c --- /dev/null +++ b/designer/src/main/webapp/WEB-INF/restcomm.xml @@ -0,0 +1,597 @@ + + + + + + + + 2012-04-24 + + + false + + + /restcomm/audio + + + beep.wav + alert.wav + + + ${restcomm:home}/cache + /restcomm/cache + + + false + + + file://${restcomm:home}/recordings + /restcomm/recordings + + + /restcomm/errors + + + 192.168.2.3 + + + true + + + false + + + true + + + + false + + + 5060 + WebRTCGW__1@ + WebRTCGW/1.0 + + + + + 60 + + + false + + true + + + + true + + + false + + + + false + + + + TRUE + + + false + + + + false + + + + + + + + + + + 127.0.0.1:5090 + + + + + false + + + true + + + false + + 20 + + true + + + + + false + + + + site_id + http://127.0.0.1:2080 + + + + + + + + + + + + http://GMLC-IP:port/restcomm/gmlc/rest?msisdn= + + + + + + + + RestComm:*:Accounts + RestComm:*:Applications + RestComm:*:Announcements + RestComm:Read:AvailablePhoneNumbers + RestComm:*:Calls + RestComm:*:Clients + RestComm:*:Conferences + RestComm:Create,Delete,Read:Faxes + RestComm:*:IncomingPhoneNumbers + RestComm:Read:Notifications + RestComm:*:OutgoingCallerIds + RestComm:Delete,Read:Recordings + RestComm:Read,Modify:SandBoxes + RestComm:*:ShortCodes + RestComm:Read:SmsMessages + RestComm:Read:Transcriptions + RestComm:*:OutboundProxies + RestComm:*:EmailMessages + RestComm:*:Usage + RestComm:*:Geolocation + + + + + + + + + + + + + + + + + + + + + + https://backoffice.voipinnovations.com/api2.pl + + + + + + + https://api.inetwork.com/v1.0 + + + + + https://rest.nexmo.com/ + + + + + + https://api.voxbone.com/ws-voxbone/services/rest + + + + + + + + + + + + + + + + + + + + + false + + + + + false + 10 + true + us-east-1 + + secure + false + http://127.0.0.1:8090/s3 + + + + + rms + +
+ 5060 + udp + 5 +
+
+ + + + + 192.168.2.3 + 2727 + 192.168.2.3 + 2427 + 500 + 192.168.2.3 + 60 + im + + + + + + + 6000 + + strict + + true + + 192.168.2.3 + + + + + /restcomm-rvd/services + true + 5000 + 500 + + + + + # + + + + + + + + + + + test + + + + TRANSCEIVER + + + + + 0x34 + -1 + -1 + + + 1 + + 60000 + + 10000 + + 30000 + + 15000 + true + true + + 30000 + + + + + + + + + + + + + + + + + + + + http://vaas.acapela-group.com/Services/Synthesizer + + + + + justine8k + marcia8k + rachel8k graham8k + louise8k + eliska8k + mette8krasmus8k + laura8k ryan8k + sanna8k + claire8k bruno8k + sarah8k klaus8k + dimitris8k + chiara8k vittorio8k + jasmijn8k daan8k + kari8k olav8k + ania8k + celia8k + alyona8k + salma8k mehdi8k + laia8k + maria8k antonio8k + elin8k emil8k + ipek8k + lulu8k + sakura8k + + + + + http://api.voicerss.org + c5958c00a7514469afc535025f051e7f + + ca-es + zh-cn + zh-hk + zh-tw + da-dk + nl-nl + en-au + en-ca + en-gb + en-in + en-us + fi-fi + fr-ca + fr-fr + de-de + it-it + ja-jp + ko-kr + nb-no + pl-pl + pt-br + pt-pt + ru-ru + es-mx + es-es + sv-se + + + + + + + + + + Mizuki + Filiz + TatyanaMaxim + CarmenMaxim + InesCristiano + VitoriaRicardo + MajaJan + LotteRuben + Liv + CarlaGiorgio + DoraKarl + CelineMathieu + Chantal + PenelopeMiguel + ConchitaEnrique + Geraint + Gwyneth + JoannaJoey + Raveena + EmmaBrian + NicoleRussell + MarleneHans + NajaMads + + + + + +
diff --git a/designer/src/main/webapp/js/app/controllers/projectManager.js b/designer/src/main/webapp/js/app/controllers/projectManager.js index 5e5edc7..fd2ab5b 100644 --- a/designer/src/main/webapp/js/app/controllers/projectManager.js +++ b/designer/src/main/webapp/js/app/controllers/projectManager.js @@ -1,4 +1,4 @@ -App.controller('projectManagerCtrl', function ( $scope, $http, $location, $stateParams, $timeout, $upload, notifications, authentication, fileRetriever ) { +App.controller('projectManagerCtrl', function ( $scope, $http, $location, $stateParams, $timeout, $upload, notifications, authentication, fileRetriever, RvdConfiguration ) { var account = authentication.getAccount(); @@ -17,7 +17,7 @@ App.controller('projectManagerCtrl', function ( $scope, $http, $location, $state $scope.appItems = []; $scope.retrievingApps = true; $http({ - url: '/restcomm/2012-04-24/Accounts/' + account.sid + '/Applications.json', + url: RvdConfiguration.restcommBaseUrl + '/restcomm/2012-04-24/Accounts/' + account.sid + '/Applications.json', method: 'GET', headers: {Authorization: authentication.getAuthHeader()} }).success(function (data, status, headers, config) { diff --git a/designer/src/main/webapp/js/app/interceptors.js b/designer/src/main/webapp/js/app/interceptors.js index 47954d6..e551adb 100644 --- a/designer/src/main/webapp/js/app/interceptors.js +++ b/designer/src/main/webapp/js/app/interceptors.js @@ -38,7 +38,7 @@ angular.module('Rvd').config(['$httpProvider', function($httpProvider) { // injects authentication credentials when Restcomm authentication is used angular.module('Rvd').factory('RestcommAuthenticationInterceptor', function ($injector) { function request(config) { - return $injector.invoke(function ($state, authentication) { + return $injector.invoke(function ($state, authentication, RvdConfiguration) { if (config.url.startsWith('services/') || config.url.startsWith('/restcomm-rvd/services/')) { if (authentication.getAuthHeader()) { // if the request is targeted towards RVD add authorization header and there is no authorization header already @@ -47,7 +47,7 @@ angular.module('Rvd').factory('RestcommAuthenticationInterceptor', function ($in config.headers.Authorization = authentication.getAuthHeader(); } } else - if (config.url.startsWith('/restcomm/2012-04-24/')) { + if (config.url.startsWith(RvdConfiguration.restcommBaseUrl + '/restcomm/2012-04-24/')) { if (authentication.getAuthHeader()) { delete config.headers.authorization; // mind the case insensitivity of headers delete config.headers.Authorization; diff --git a/designer/src/main/webapp/js/app/services.js b/designer/src/main/webapp/js/app/services.js index ed5fdf2..bde20b5 100644 --- a/designer/src/main/webapp/js/app/services.js +++ b/designer/src/main/webapp/js/app/services.js @@ -90,7 +90,7 @@ angular.module('Rvd').service('initializer',function (authentication, storage, }; }); -angular.module('Rvd').service('authentication', function ($http, $q, IdentityConfig, storage, $state, md5, $rootScope) { +angular.module('Rvd').service('authentication', function ($http, $q, IdentityConfig, storage, $state, md5, $rootScope, RvdConfiguration) { var authInfo = {}; var account = null; // if this is set it means that user logged in: authentication succeeded and account was retrieved @@ -138,7 +138,7 @@ angular.module('Rvd').service('authentication', function ($http, $q, IdentityCon function restcommLogin(username,password) { var deferredLogin = $q.defer(); var authHeader = basicAuthHeader(username, password); - $http({method:'GET', url:'/restcomm/2012-04-24/Accounts.json/' + encodeURIComponent(username), headers: {Authorization: authHeader}}).then(function (response) { + $http({method:'GET', url: RvdConfiguration.restcommBaseUrl + '/restcomm/2012-04-24/Accounts.json/' + encodeURIComponent(username), headers: {Authorization: authHeader}}).then(function (response) { var acc = response.data; // store temporarily the account returned $http({method:'GET', url:'services/auth/keepalive', headers: {Authorization: "Basic " + btoa(acc.email_address + ":" +acc.auth_token)}}).then(function (response) { // ok, access to both restcomm and RVD is verified @@ -877,5 +877,6 @@ angular.module('Rvd').factory('fileRetriever', function (Blob, FileSaver, $http) // keeps various configuration settings that we need to control from a single point. Fetching from server is also possible. angular.module('Rvd').service('RvdConfiguration', function () { this.projectsRootPath = '/restcomm-rvd/services/projects'; + this.restcommBaseUrl = 'http://192.168.2.3' });