Skip to content

Commit

Permalink
Merge branch 'master' of github.com:RestComm/Restcomm-Connect
Browse files Browse the repository at this point in the history
  • Loading branch information
gvagenas committed Aug 7, 2017
2 parents 3ee7c54 + 53ca1a9 commit 879bb7a
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ LBHOST='' #Obligatory to set if Load Balancer is used for PSTN (DID provider con
#RVD workspace path. (If not set default will be used).
#Default: leave empty.
RVD_LOCATION=''
RVD_URL='' # override if RVD is not under the same domain with restcomm. Use a base url like http://myrvd.restcomm.com . No path included.
RVD_URL='' # override if RVD is not under the same domain with restcomm. Use a base url like http://myrvd.restcomm.com . No path included. Also, if provided, bundled RVD will get undeployed.
RVD_VIDEO_SUPPORT='false' # Toggle RVD Video RCML generation and UI
RVD_MAX_MEDIA_FILE_SIZE=4194304 # Limit media file size when uploading. For video should probably be greater

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ FILE=$BASEDIR/standalone/deployments/olympus.war/resources/xml/olympus.xml
local SIP_PORT_WS=$((SIP_PORT_WS + PORT_OFFSET))
local SIP_PORT_WSS=$((SIP_PORT_WSS + PORT_OFFSET))

if [ -n "$SECURESSL" ]; then
xmlstarlet ed -L -P -u "/olympus/server/@secure" -v "true" $FILE
else
if [ -z "$SECURESSL" ] || [ "$SECURESSL" == "false" ] || [ "$SECURESSL" == "FALSE" ]; then
xmlstarlet ed -L -P -u "/olympus/server/@secure" -v "false" $FILE
else
xmlstarlet ed -L -P -u "/olympus/server/@secure" -v "true" $FILE
fi

if [ "$ACTIVATE_LB" == "true" ] || [ "$ACTIVATE_LB" == "TRUE" ]; then
Expand All @@ -43,4 +43,4 @@ FILE=$BASEDIR/standalone/deployments/olympus.war/resources/xml/olympus.xml
# MAIN
echo 'Configuring Olympus...'
#Reload Variables
olympusPortConf
olympusPortConf
Original file line number Diff line number Diff line change
Expand Up @@ -540,26 +540,50 @@ otherRestCommConf(){
echo "End Rest RestComm configuration"
}

confRVD(){
echo "Configure RVD"
if [ -n "$RVD_LOCATION" ]; then
echo "RVD_LOCATION $RVD_LOCATION"
mkdir -p `echo $RVD_LOCATION`
sed -i "s|<workspaceLocation>.*</workspaceLocation>|<workspaceLocation>${RVD_LOCATION}</workspaceLocation>|" $RVD_DEPLOY/WEB-INF/rvd.xml

COPYFLAG=$RVD_LOCATION/.demos_initialized
if [ -f "$COPYFLAG" ]; then
#Do nothing, we already copied the demo file to the new workspace
echo "RVD demo application are already copied"
else
echo "Will copy RVD demo applications to the new workspace $RVD_LOCATION"
cp -ar $RVD_DEPLOY/workspace/* $RVD_LOCATION
touch $COPYFLAG
fi
disableRVD() {
if [[ -f "$RVD_DEPLOY.deployed" || -f "$RVD_DEPLOY.dodeploy" ]]; then
rm -f "$RVD_DEPLOY.deployed"
rm -f "$RVD_DEPLOY.dodeploy"
echo "RVD undeployed (or not deployed at all)"
else
echo "RVD not deployed"
fi
}

enableRVD() {
if [ -f "$RVD_DEPLOY.deployed" ]; then
echo "RVD already deployed"
else
touch "$RVD_DEPLOY".dodeploy
echo "RVD deployed"
fi
}

confRVD(){
if [ -z "$RVD_URL" ]; then
enableRVD
echo "Configure bundled RVD"
if [ -n "$RVD_LOCATION" ]; then
echo "RVD_LOCATION $RVD_LOCATION"
mkdir -p `echo $RVD_LOCATION`
sed -i "s|<workspaceLocation>.*</workspaceLocation>|<workspaceLocation>${RVD_LOCATION}</workspaceLocation>|" $RVD_DEPLOY/WEB-INF/rvd.xml

COPYFLAG=$RVD_LOCATION/.demos_initialized
if [ -f "$COPYFLAG" ]; then
#Do nothing, we already copied the demo file to the new workspace
echo "RVD demo application are already copied"
else
echo "Will copy RVD demo applications to the new workspace $RVD_LOCATION"
cp -ar $RVD_DEPLOY/workspace/* $RVD_LOCATION
touch $COPYFLAG
fi

fi
else
disableRVD
fi
}

## Adds/removes <rcmlserver>/<base-url> element based on $RVD_URL
## This version of confRcmlserver() will used xmlstarlet and will probably sed commands that rely on empty elements like <x></x> instead of <x/>
#confRcmlserver(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ rcMod.controller('DashboardCtrl', function ($scope, $resource, $rootScope, RComm
angular.forEach(data, function(value,key){
//console.log(value.start_date, value.count, value.usage);
$scope.callsData[0].values.push([value.start_date, value.count || 0]);
$scope.callsData[1].values.push([value.start_date, Math.floor(value.usage/60*10)/10 || 0]);
maxDuration = Math.max(maxDuration, Math.floor(value.usage/60*10)/10);
$scope.callsData[1].values.push([value.start_date, value.usage || 0]);
maxDuration = Math.max(maxDuration, value.usage);
maxCalls = Math.max(maxCalls, value.count);
});
$scope.options.chart.lines.yDomain = [0, maxDuration];
Expand Down Expand Up @@ -153,4 +153,4 @@ rcMod.controller('DashboardCtrl', function ($scope, $resource, $rootScope, RComm
}
}

});
});

0 comments on commit 879bb7a

Please sign in to comment.