Skip to content

Commit 53d0f3c

Browse files
author
Yorgos Saslis
committed
Necessary fixes for all-in-one profile
Manually uploaded media server 6.0.23 in our own CXS Nexus releases repo and fixed artifact ID. Also added some missing files, which are needed for the all-in-one docker image bundle.
1 parent 71bba56 commit 53d0f3c

5 files changed

Lines changed: 121 additions & 3 deletions

File tree

release/pom.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
</dependency>
2525
<dependency>
2626
<groupId>org.mobicents.media</groupId>
27-
<artifactId>media-server-standalone</artifactId>
27+
<artifactId>server</artifactId>
2828
<version>${mobicents.mgcp.impl.version}</version>
2929
<type>zip</type>
30-
<classifier>assembly</classifier>
30+
<classifier>assembly</classifier>
3131
</dependency>
3232
<dependency>
3333
<groupId>org.restcomm</groupId>
@@ -47,4 +47,11 @@
4747
<module>restcomm-assembly-as7</module>
4848
<module>restcomm-assembly-wildfly10</module>
4949
</modules>
50+
<repositories>
51+
<repository>
52+
<id>cxsnexus-releases</id>
53+
<url>http://cxsnexus.restcomm.com/nexus/content/repositories/releases/</url>
54+
<layout>default</layout>
55+
</repository>
56+
</repositories>
5057
</project>

release/restcomm-assembly-as7/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<artifactItems>
7676
<artifactItem>
7777
<groupId>org.mobicents.media</groupId>
78-
<artifactId>media-server-standalone</artifactId>
78+
<artifactId>server</artifactId>
7979
<type>zip</type>
8080
<classifier>assembly</classifier>
8181
</artifactItem>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
5 8 * * 0 root find /opt/Restcomm-JBoss-AS7/mediaserver/log/server.log -mtime +7 -exec rm {} \;
2+
# An empty line is required at the end of this file for a valid cron file.
3+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#! /bin/bash
2+
3+
export RUN_DOCKER=true
4+
5+
BASEDIR=/opt/Restcomm-JBoss-AS7
6+
RMS_CONF=$BASEDIR/bin/restcomm
7+
ms_conf=$RMS_CONF/mediaserver.conf
8+
ms_home=$BASEDIR/mediaserver
9+
10+
exec $ms_home/start-mediaserver.sh $ms_conf
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#! /bin/bash
2+
## Description: Starts Media Server with auto-configuration.
3+
## Author : Henrique Rosa (henrique.rosa@telestax.com)
4+
## Parameters : 1. path to conf file (optional)
5+
6+
export MS_HOME=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
7+
RESTCOMME_DIR=/opt/Restcomm-JBoss-AS7
8+
source /etc/container_environment.sh
9+
10+
getPID(){
11+
while read -r line
12+
do
13+
if ps -ef | grep $line | grep -q mediaserver
14+
then
15+
RMS_PID=$line
16+
fi
17+
done < <(jps | grep Main | cut -d " " -f 1)
18+
}
19+
20+
configNetwork() {
21+
# Configure RMS network using the read-network-props.sh from RC
22+
if [ "${MS_EXTERNAL^^}" = "FALSE" ]; then
23+
echo "Looking for the IP Address, subnet, network and broadcast_address for RMS"
24+
source $RESTCOMME_DIR/bin/restcomm/utils/read-network-props.sh "eth0"
25+
26+
if [ ! -f /etc/container_environment/BIND_ADDRESS ]; then
27+
sed -i "s|BIND_ADDRESS=.*|BIND_ADDRESS=${PRIVATE_IP}|" $RESTCOMME_DIR/bin/restcomm/mediaserver.conf
28+
fi
29+
30+
if [ ! -f /etc/container_environment/NETWORK ]; then
31+
sed -i "s|NETWORK=.*|NETWORK=${NETWORK}|" $RESTCOMME_DIR/bin/restcomm/mediaserver.conf
32+
fi
33+
34+
if [ ! -f /etc/container_environment/SUBNET ]; then
35+
sed -i "s|SUBNET=.*|SUBNET=${SUBNET_MASK}|" $RESTCOMME_DIR/bin/restcomm/mediaserver.conf
36+
fi
37+
38+
if [ ! -f /etc/container_environment/RMSCONF_MGCP_ADDRESS ]; then
39+
sed -i "s|MGCP_ADDRESS=.*|MGCP_ADDRESS=${PRIVATE_IP}|" $RESTCOMME_DIR/bin/restcomm/mediaserver.conf
40+
fi
41+
42+
fi
43+
44+
}
45+
46+
verifyDependencies() {
47+
source $MS_HOME/.autoconfig/verify-dependencies.sh
48+
}
49+
50+
loadConfigurationParams() {
51+
local override_conf=$1
52+
53+
# load default configuration files
54+
source $MS_HOME/mediaserver.conf
55+
source $MS_HOME/logger.conf
56+
source $MS_HOME/ssl.conf
57+
58+
# load file to override configuration (if any)
59+
if [ -n "$override_conf" ]; then
60+
source $override_conf
61+
fi
62+
}
63+
64+
configureMediaServer() {
65+
# Configure media server
66+
source $MS_HOME/.autoconfig/autoconfigure.sh
67+
# Set permissions of run script because it may have been overwritten by commands like sed
68+
chmod 755 $MS_HOME/bin/run.sh
69+
}
70+
71+
startMediaServer() {
72+
echo 'Starting RestComm Media Server...'
73+
# Check if RestComm is already running
74+
if [[ "$RUN_DOCKER" == "true" || "$RUN_DOCKER" == "TRUE" ]]; then
75+
if [ -n "$RMS_PID" ]; then
76+
echo '... already running Aborted.'
77+
exit 1;
78+
else
79+
$MS_HOME/bin/run.sh
80+
echo '...RestComm Media Server started running!'
81+
fi
82+
else
83+
if tmux ls | grep -q 'mediaserver'; then
84+
echo '... already running a session named "mediaserver"! Aborted.'
85+
exit 1
86+
else
87+
tmux new -s mediaserver -d $MS_HOME/bin/run.sh
88+
echo '...RestComm Media Server started running on session named "mediaserver"!'
89+
fi
90+
fi
91+
}
92+
93+
getPID
94+
#verifyDependencies
95+
configNetwork
96+
loadConfigurationParams $1
97+
configureMediaServer
98+
startMediaServer

0 commit comments

Comments
 (0)