Skip to content

Commit d92d4d5

Browse files
authored
Merge pull request #2719 from RestComm/issue2718_rvd_http_timeout_configuration
Added RVD_HTTP_TIMEOUT configuration option to advanced.conf and conf…
2 parents 120b97a + 8c1cc23 commit d92d4d5

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ RVD_UNDEPLOY='false'
9797
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. This affects restcomm.xml/<rcmlserver/>
9898
RVD_VIDEO_SUPPORT='false' # Toggle RVD Video RCML generation and UI
9999
RVD_MAX_MEDIA_FILE_SIZE=4194304 # Limit media file size when uploading. For video should probably be greater
100+
RVD_HTTP_TIMEOUT='' # Timeout (ms) for http connections in rvd http client. It mainly affects connections to restcomm (create calls, fetch account etc.). It does not affect ES.
100101

101102

102103
#RMS pool size (Un-comment the resource that you want to set the pool size)

restcomm/configuration/config-scripts/as7-config-scripts/restcomm/autoconfig.d/config-rvd.sh

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,28 @@ updateMaxMediaFileSize() {
4141
fi
4242
}
4343

44+
# $1 is RVD_HTTP_TIMEOUT
45+
updateHttpTimeout() {
46+
if [ -z $1 ]; then
47+
xmlstarlet ed -P -d "/rvd/defaultHttpTimeout" "$RVD_XML_FILE" > ${RVD_XML_FILE}_tmp
48+
mv ${RVD_XML_FILE}_tmp ${RVD_XML_FILE}
49+
echo "disabled defaultHttpTimeout option";
50+
else
51+
matchesCount=`xmlstarlet sel -t -v "count(/rvd/defaultHttpTimeout)" "$RVD_XML_FILE"`
52+
if [ $matchesCount -ge 1 ]; then
53+
xmlstarlet ed -P -u "/rvd/defaultHttpTimeout" -v "$1" "$RVD_XML_FILE" > ${RVD_XML_FILE}_tmp
54+
mv ${RVD_XML_FILE}_tmp ${RVD_XML_FILE}
55+
else
56+
xmlstarlet ed -P -s "/rvd" -t elem -n "defaultHttpTimeout" -v "$1" "$RVD_XML_FILE" > ${RVD_XML_FILE}_tmp
57+
mv ${RVD_XML_FILE}_tmp ${RVD_XML_FILE}
58+
fi
59+
echo "set defaultHttpTimeout to $1"
60+
fi
61+
}
62+
4463
# MAIN
4564

46-
if [[ "$RVD_UNDEPLOY" = true || "$RVD_UNDEPLOY" = TRUE || "$RVD_UNDEPLOY" != True ]]; then
65+
if [[ "$RVD_UNDEPLOY" = true || "$RVD_UNDEPLOY" = TRUE || "$RVD_UNDEPLOY" = True ]]; then
4766
echo "Skipping RVD configuration since it's not deployed"
4867
else
4968
if [ -z "$RESTCOMM_HOME" ]
@@ -65,5 +84,9 @@ else
6584
updateVideoSupport false
6685
fi
6786
updateMaxMediaFileSize "$RVD_MAX_MEDIA_FILE_SIZE"
87+
88+
updateHttpTimeout "$RVD_HTTP_TIMEOUT"
89+
90+
6891
echo "Updated rvd.xml"
6992
fi

0 commit comments

Comments
 (0)