Skip to content

Commit 9092ef2

Browse files
author
Orestis Tsakiridis
committed
Merge branch 'issue2133_rvd_videoSupport_config' into cors_support_and_video_config
2 parents 0cdfafe + 05130bf commit 9092ef2

2 files changed

Lines changed: 69 additions & 0 deletions

File tree

restcomm/configuration/config-scripts/as7-config-scripts/restcomm/advanced.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ LBHOST='' #Obligatory to set if Load Balancer is used for PSTN (DID provider con
9494
#Default: leave empty.
9595
RVD_LOCATION=''
9696
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.
97+
RVD_VIDEO_SUPPORT='false' # Toggle RVD Video RCML generation and UI
98+
RVD_MAX_MEDIA_FILE_SIZE=4194304 # Limit media file size when uploading. For video should probably be greater
99+
97100

98101
#RMS pool size (Un-comment the resource that you want to set the pool size)
99102
#RMS pool size (Should calculated from number of concurrent calls expected).
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
##
3+
## Configures rvd.xml based on global configuration options in restcomm.conf and advanced.conf.
4+
##
5+
## usage:
6+
##
7+
## ./config-rvd-logging.sh - adds handler and logger (INFO) elements if missing
8+
## ./config-rvd-logging.sh DEBUG - creates or updates loggers by setting level to DEBUG
9+
## ./config-rvd-logging.sh DEBUG FILE - creates or updates loggers (DEBUG) but also configures them to use the 'FILE' periodic handler (main restcomm log)
10+
##
11+
## requirements:
12+
##
13+
## RESTCOMM_HOME env variable to be set
14+
## rvd.xml should be in place (under $RESTCOMM_HOME/standalone/deployments/restcomm-rvd.war)
15+
##
16+
## Author: otsakir@gmail.com - Orestis Tsakiridis
17+
18+
# Variables
19+
RVD_ROOT=$RESTCOMM_HOME/standalone/deployments/restcomm-rvd.war
20+
RVD_XML_FILE=$RVD_ROOT/WEB-INF/rvd.xml
21+
22+
updateVideoSupport() {
23+
matchesCount=`xmlstarlet sel -t -v "count(/rvd/videoSupport)" "$RVD_XML_FILE"`
24+
if [ $matchesCount -ge 1 ]; then
25+
xmlstarlet ed -P -u "/rvd/videoSupport" -v "$1" "$RVD_XML_FILE" > ${RVD_XML_FILE}_tmp
26+
mv ${RVD_XML_FILE}_tmp ${RVD_XML_FILE}
27+
else
28+
xmlstarlet ed -P -s "/rvd" -t elem -n "videoSupport" -v "$1" "$RVD_XML_FILE" > ${RVD_XML_FILE}_tmp
29+
mv ${RVD_XML_FILE}_tmp ${RVD_XML_FILE}
30+
fi
31+
}
32+
33+
updateMaxMediaFileSize() {
34+
matchesCount=`xmlstarlet sel -t -v "count(/rvd/maxMediaFileSize)" "$RVD_XML_FILE"`
35+
if [ $matchesCount -ge 1 ]; then
36+
xmlstarlet ed -P -u "/rvd/maxMediaFileSize" -v "$1" "$RVD_XML_FILE" > ${RVD_XML_FILE}_tmp
37+
mv ${RVD_XML_FILE}_tmp ${RVD_XML_FILE}
38+
else
39+
xmlstarlet ed -P -s "/rvd" -t elem -n "maxMediaFileSize" -v "$1" "$RVD_XML_FILE" > ${RVD_XML_FILE}_tmp
40+
mv ${RVD_XML_FILE}_tmp ${RVD_XML_FILE}
41+
fi
42+
}
43+
44+
# MAIN
45+
46+
if [ -z "$RESTCOMM_HOME" ]
47+
then
48+
echo "RESTCOMM_HOME env variable not set. Aborting."
49+
exit 1
50+
fi
51+
if [ ! -f "$RVD_XML_FILE" ]
52+
then
53+
echo "rvd.xml not found. Aborting."
54+
return
55+
fi
56+
57+
echo "Configuring RVD"
58+
59+
if [ "$RVD_VIDEO_SUPPORT" = true ] ; then
60+
updateVideoSupport true
61+
else
62+
updateVideoSupport false
63+
fi
64+
updateMaxMediaFileSize "$RVD_MAX_MEDIA_FILE_SIZE"
65+
echo "Updated rvd.xml"
66+

0 commit comments

Comments
 (0)