Skip to content

Commit

Permalink
Merge branch 'master' into issue1726_CallerRejectNotification
Browse files Browse the repository at this point in the history
  • Loading branch information
ghjansen committed Mar 23, 2017
2 parents 63ef982 + 505f0c7 commit 735b365
Show file tree
Hide file tree
Showing 1,310 changed files with 37,806 additions and 99,568 deletions.
26 changes: 22 additions & 4 deletions load_tests/prepare-restcomm-for-perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ echo "LOCAL_INTERFACE: $LOCAL_INTERFACE"
echo "LOG_LEVEL: $LOG_LEVEL"

FILE=$RESTCOMM_HOME/bin/restcomm/restcomm.conf
#MS_FILE=$RESTCOMM_HOME/bin/restcomm/mediaserver.conf
MS_FILE=$RESTCOMM_HOME/bin/restcomm/mediaserver.conf

# VoiceRSS config
if [ -n "$VOICERSS" ]; then
Expand Down Expand Up @@ -52,6 +52,24 @@ mv $FILE.bak $FILE
sed -e "s/LOG_LEVEL_COMPONENT_RESTCOMM=.*/LOG_LEVEL_COMPONENT_RESTCOMM=$LOG_LEVEL/" $FILE > $FILE.bak
mv $FILE.bak $FILE

FILE=$RESTCOMM_HOME/bin/standalone.conf
sed -e "s/$JAVA_OPTS -Djboss.server.default.config=standalone-sip.xml/$JAVA_OPTS -Djboss.server.default.config=standalone-sip.xml -Djboss.boot.thread.stack.size=1/" $FILE > $FILE.bak
mv $FILE.bak $FILE
# FILE=$RESTCOMM_HOME/bin/standalone.conf
# sed -e "s/$JAVA_OPTS -Djboss.server.default.config=standalone-sip.xml/$JAVA_OPTS -Djboss.server.default.config=standalone-sip.xml -Djboss.boot.thread.stack.size=1/" $FILE > $FILE.bak
# mv $FILE.bak $FILE

# MEDIA SERVER
sed -e "s|BIND_ADDRESS=.*|BIND_ADDRESS=$RESTCOMM_ADDRESS|" \
-e "s|NETWORK=.*|NETWORK=$RESTCOMM_NETWORK|" \
-e "s|SUBNET=.*|SUBNET=$RESTCOMM_SUBNET|" \
-e "s|MGCP_ADDRESS=.*|MGCP_ADDRESS=$RESTCOMM_ADDRESS|" \
-e "s|EXPECTED_LOAD=.*|EXPECTED_LOAD=$SIMULTANEOUS_CALLS|" \
-e "s|AUDIO_CACHE_SIZE=.*|AUDIO_CACHE_SIZE=$MS_CACHE_SIZE|" \
-e "s|AUDIO_CACHE_ENABLED=.*|AUDIO_CACHE_ENABLED=$MS_CACHE_ENABLED|" \
-e "s|LOG_APPENDER_CONSOLE=.*|LOG_APPENDER_CONSOLE=$LOG_LEVEL|" \
-e "s|LOG_APPENDER_FILE=.*|LOG_APPENDER_FILE=$LOG_LEVEL|" \
-e "/LOG_CATEGORY_MEDIA_SERVER=.*/d" \
-e "/LOG_CATEGORY_MGCP=.*/d" \
-e "/LOG_CATEGORY_RTP=.*/d" \
-e "/LOG_CATEGORY_RTCP=.*/d" $MS_FILE > $MS_FILE.bak
mv -f $MS_FILE.bak $MS_FILE
echo "MEDIA SERVER CONFIGURATION: "
cat $MS_FILE
54 changes: 42 additions & 12 deletions load_tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,27 @@
## Authors : George Vagenas, Henrique Rosa
#

if [ $# -lt 6 ]; then
echo "No proper arguments provided: (1: $1) (2: $2) (3: $3) (4: $4) (5: $5) (6: $6) (7: $7)"
if [ $# -lt 8 ]; then
echo "No proper arguments provided: (1: $1) (2: $2) (3: $3) (4: $4) (5: $5) (6: $6) (7: $7) (8: $8)"
echo "Usage instructions: "
echo './run.sh $RESTCOMM_ADDRESS $LOCAL_ADDRESS $SIMULTANEOUS_CALLS $MAXIMUM_CALLS $CALL_RATE $TEST_NAME'
echo "Example: ./run.sh 192.168.1.11 192.168.1.12 100 10000 30 helloplay"
echo './run.sh $RESTCOMM_ADDRESS $RESTCOMM_NETWORK $RESTCOMM_SUBNET $LOCAL_ADDRESS $SIMULTANEOUS_CALLS $MAXIMUM_CALLS $CALL_RATE $TEST_NAME'
echo "Example: ./run.sh 192.168.1.11 192.168.1.0 255.255.255.0 192.168.1.12 100 10000 30 helloplay"
exit 1
fi

# echo "(1: $1) (2: $2) (3: $3) (4: $4) (5: $5) (6: $6)"
echo "(1: $1) (2: $2) (3: $3) (4: $4) (5: $5) (6: $6)"

export RESTCOMM_ADDRESS=$1
export LOCAL_ADDRESS=$2
export SIMULTANEOUS_CALLS=$3
export MAXIMUM_CALLS=$4
export CALL_RATE=$5
export TEST_NAME=$6
export RESTCOMM_NETWORK=$2
export RESTCOMM_SUBNET=$3
export LOCAL_ADDRESS=$4
export SIMULTANEOUS_CALLS=$5
export MAXIMUM_CALLS=$6
export CALL_RATE=$7
export TEST_NAME=$8

export MS_CACHE_ENABLED=false
export MS_CACHE_SIZE=100

if [[ -z $VOICERSS ]] || [ "$VOICERSS" == '' ]; then
echo "VoiceRSS TTS Service key is not set! Will exit"
Expand Down Expand Up @@ -85,6 +90,7 @@ fi
}

startRestcomm(){
echo "About to start Restcomm using $RESTCOMM_HOME/bin/restcomm/start-restcomm.sh"
$RESTCOMM_HOME/bin/restcomm/start-restcomm.sh
if [ "$COLLECT_JMAP" == "true" ] || [ "$COLLECT_JMAP" == "TRUE" ]; then
sleep 30
Expand Down Expand Up @@ -154,6 +160,30 @@ case "$TEST_NAME" in
sleep 15
$CURRENT_FOLDER/tests/hello-play-one-minute/helloplay-one-minute.sh
;;
"createcall")
echo "Testing Create Call REST API"
prepareRestcomm
#In case a previous CI job killed, Restcomm will be still running, so make sure we first stop Restcomm
$RESTCOMM_HOME/bin/restcomm/stop-restcomm.sh
sleep 5
echo "Testing Create Call REST API"
cp -aR $CURRENT_FOLDER/resources/audio/demo-prompt-one-minute.wav $RESTCOMM_HOME/standalone/deployments/restcomm.war/audio/demo-prompt.wav
rm -rf $RESTCOMM_HOME/standalone/deployments/restcomm.war/cache/AC*
startRestcomm
echo $"\n********** Restcomm started at $RESTCOMM_HOME\n"
sleep 45
echo $'\nChange default administrator password\n'
curl -X PUT http://ACae6e420f425248d6a26948c17a9e2acf:77f8c12cc7b8f8423e5c38b035249166@$RESTCOMM_ADDRESS:8080/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf -d "Password=$RESTCOMM_NEW_PASSWORD"

#Next run the client script that will initiate callls to Restcomm
echo "About to run createcall script that using CURL will create requests. Password: $RESTCOMM_NEW_PASSWORD Restcom Address: $RESTCOMM_ADDRESS SIPP client: sip:1999@$LOCAL_ADDRESS Max calls: $MAXIMUM_CALLS CPS: $CALL_RATE "
screen -dmS 'createcall' $CURRENT_FOLDER/tests/createcall/createcall.sh $RESTCOMM_NEW_PASSWORD $RESTCOMM_ADDRESS $LOCAL_ADDRESS $MAXIMUM_CALLS $CALL_RATE

#First run the server script that is the client that will listen for Restcomm calls
echo "About to start createcall server part that will listen for SIP INVITE requests"
# screen -dmS 'createcall-server' $CURRENT_FOLDER/tests/createcall/createcall-server.sh
$CURRENT_FOLDER/tests/createcall/createcall-server.sh
;;
"dialclient")
echo "Testing DialClient"
prepareRestcomm
Expand All @@ -164,7 +194,7 @@ case "$TEST_NAME" in
cp -aR $CURRENT_FOLDER/tests/dialclient/DialClientApp.xml $RESTCOMM_HOME/standalone/deployments/restcomm.war/demos/
sed -i "s/SIPP_SERVER_IP_HERE/$LOCAL_ADDRESS/g" $RESTCOMM_HOME/standalone/deployments/restcomm.war/demos/DialClientApp.xml
startRestcomm
echo $'\n********** Restcomm started\n'
echo $"\n********** Restcomm started at $RESTCOMM_HOME\n"
sleep 45
echo $'\nChange default administrator password\n'
curl -X PUT http://ACae6e420f425248d6a26948c17a9e2acf:77f8c12cc7b8f8423e5c38b035249166@$RESTCOMM_ADDRESS:8080/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf -d "Password=$RESTCOMM_NEW_PASSWORD"
Expand Down Expand Up @@ -213,5 +243,5 @@ if [ "$COLLECT_LOGS" = "true" ]; then
fi

# Stop RestComm and Media Server
#stopRestcomm
stopRestcomm
echo $'\n********** Restcomm stopped\n'
16 changes: 11 additions & 5 deletions load_tests/run_offline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ echo "ulimit -n: " `ulimit -n`
# BRANCH_NAME the branch to use, this will be used to run the load tests and build the binary
# TELSCALE whether to use Telscale Restcomm Connect or Restcomm-Connect

PERFRECORDER_VERSION=34
PERFRECORDER_VERSION=41
export LOCAL_RESTCOMM_ADDRESS='192.168.1.151'
export LOCAL_VOICERSS='5aa416d17f5d40fa990194cd9b3df41d'
RESTCOMM_NETWORK='192.168.1.0'
RESTCOMM_SUBNET='255.255.255.0'
export LOCAL_VOICERSS=''
LOCAL_INTERFACE_TMP='wlan0'



export CURRENT_DIR=`pwd`

read -p 'Restcomm branch name [master]: ' RESTCOMM_BRANCH
Expand All @@ -38,8 +42,8 @@ read -p 'Workspace folder [/tmp/workspace]: ' WORKSPACE
WORKSPACE=${WORKSPACE:-/tmp/workspace}
echo "...Workspace \"$WORKSPACE\""

read -p 'Restcomm Major Version number [8.0.0]: ' MAJOR_VERSION_NUMBER
MAJOR_VERSION_NUMBER=${MAJOR_VERSION_NUMBER:-8.0.0}
read -p 'Restcomm Major Version number [8.1.0]: ' MAJOR_VERSION_NUMBER
MAJOR_VERSION_NUMBER=${MAJOR_VERSION_NUMBER:-8.1.0}
echo "...Major version number \"$MAJOR_VERSION_NUMBER\""

read -p "Restcomm ip address [$LOCAL_RESTCOMM_ADDRESS]: " RESTCOMM_ADDRESS
Expand Down Expand Up @@ -201,6 +205,8 @@ else
rm -rf $RELEASE
unzip $WORKSPACE/Restcomm-JBoss-AS7.zip -d $RELEASE
mv $RELEASE/Restcomm-JBoss-AS7-*/ $RELEASE/TelScale-Restcomm-JBoss-AS7/
export GITHUB_RESTCOMM_HOME=$WORKSPACE/github-restcomm
export RESULTS_DIR=$GITHUB_RESTCOMM_HOME/load_tests/results
fi
export RESTCOMM_HOME=$RELEASE/TelScale-Restcomm-JBoss-AS7
#gvagenas@telestax.com VOICERSS key
Expand Down Expand Up @@ -236,7 +242,7 @@ echo "*******************************************************************"

cd $GITHUB_RESTCOMM_HOME/load_tests/
echo "Current dir: $(pwd)"
./run.sh $RESTCOMM_ADDRESS $LOCAL_ADDRESS $SIMULTANEOUS_CALLS $MAXIMUM_CALLS $CALL_RATE $TEST_NAME
./run.sh $RESTCOMM_ADDRESS $RESTCOMM_NETWORK $RESTCOMM_SUBNET $LOCAL_ADDRESS $SIMULTANEOUS_CALLS $MAXIMUM_CALLS $CALL_RATE $TEST_NAME
echo "Creating PerfCorder HTML ... "
cat $RESULTS_DIR/PerfCorderAnalysis.xml | $TOOLS_DIR/pc_html_gen.sh > $RESULTS_DIR/PerfCorderAnalysis.html 2> $RESULTS_DIR/htmlgen.log
#prepare logs to be archived
Expand Down
4 changes: 2 additions & 2 deletions load_tests/run_offline_old.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export CALL_RATE=$5

export TEST_NAME=$6

export VOICERSS=c58e134224704b0182f2e2eaef59f8d8
export VOICERSS=
#export VOICERSS=
export RESTCOMM_NEW_PASSWORD='NewPassword'

Expand All @@ -54,4 +54,4 @@ cd $CURRENT_FOLDER

$CURRENT_FOLDER/run.sh $RESTCOMM_ADDRESS $LOCAL_ADDRESS $SIMULTANEOUS_CALLS $MAXIMUM_CALLS $CALL_RATE $TEST_NAME
echo "Creating PerfCorder HTML ... "
cat $RESULTS_FOLDER/PerfCorderAnalysis.xml | $TOOLS_DIR/pc_html_gen.sh > $RESULTS_FOLDER/PerfCorderAnalysis.html 2> $RESULTS_FOLDER/htmlgen.log
cat $RESULTS_FOLDER/PerfCorderAnalysis.xml | $TOOLS_DIR/pc_html_gen.sh > $RESULTS_FOLDER/PerfCorderAnalysis.html 2> $RESULTS_FOLDER/htmlgen.log
5 changes: 5 additions & 0 deletions load_tests/tests/createcall/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Load test for Restcomm REST API Create call

The scripts here will do the following:
1. Will start a sipp thread that will listen for INVITE requests following the hello-play RCML application
2. Will use CURL to create and SEND REST API requests to Calls endpoint. Restcomm will create call to the sipp thread.
23 changes: 23 additions & 0 deletions load_tests/tests/createcall/createcall-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
##
## Descript+ion: Restcomm performance test script for Dial Client application.
## Author : George Vagenas
#

usage() {
echo 'Script usage: ./helloplay-one-minute.sh $RESTCOMM_ADDRESS $LOCAL_ADDRESS $SIMULTANEOUS_CALLS $MAXIMUM_CALLS $CALL_RATE'
echo "Example: ./helloplay-one-minute.sh 192.168.1.11 192.168.1.12 100 10000 30"
}

if [[ -z $LOCAL_ADDRESS ]]; then
LOCAL_ADDRESS=127.0.0.1
fi

DATE=$(date +%F_%H_%M)

echo "Restcomm IP Address: $RESTCOMM_ADDRESS - Local IP Address: $LOCAL_ADDRESS"

echo "About to launch rocket..."
sleep 3
$SIPP_EXECUTABLE -sf $CURRENT_FOLDER/tests/createcall/createcall-sipp-server.xml -s 1999 -i $LOCAL_ADDRESS -p 5060 -mi $LOCAL_ADDRESS -m $MAXIMUM_CALLS -recv_timeout 10000 -t un -nr -fd 1 -trace_stat -stf $RESULTS_DIR/createcall-server-$DATE.csv -trace_screen -screen_file $RESULTS_DIR/createcall-server-$DATE-screens.log
echo $?
118 changes: 118 additions & 0 deletions load_tests/tests/createcall/createcall-sipp-server.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<!-- This program is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU General Public License as -->
<!-- published by the Free Software Foundation; either version 2 of the -->
<!-- License, or (at your option) any later version. -->
<!-- -->
<!-- This program is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
<!-- GNU General Public License for more details. -->
<!-- -->
<!-- You should have received a copy of the GNU General Public License -->
<!-- along with this program; if not, write to the -->
<!-- Free Software Foundation, Inc., -->
<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<!-- -->
<!-- Sipp default 'uas' scenario. -->
<!-- -->

<scenario name="Basic UAS responder">
<!-- By adding rrs="true" (Record Route Sets), the route sets -->
<!-- are saved and used for following messages sent. Useful to test -->
<!-- against stateful SIP proxies/B2BUAs. -->
<recv request="INVITE" crlf="true">
</recv>

<!-- The '[last_*]' keyword is replaced automatically by the -->
<!-- specified header if it was present in the last message received -->
<!-- (except if it was a retransmission). If the header was not -->
<!-- present or if no message has been received, the '[last_*]' -->
<!-- keyword is discarded, and all bytes until the end of the line -->
<!-- are also discarded. -->
<!-- -->
<!-- If the specified header was present several times in the -->
<!-- message, all occurences are concatenated (CRLF seperated) -->
<!-- to be used in place of the '[last_*]' keyword. -->

<send>
<![CDATA[
SIP/2.0 180 Ringing
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>

<!-- Wait 2 seconds to simulate ringing time -->
<pause milliseconds="2000"/>

<send retrans="500">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
]]>
</send>

<recv request="ACK"
optional="false"
rtd="true"
crlf="true">
</recv>

<pause milliseconds="57000"/>

<recv request="BYE">
</recv>

<send>
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>

<!-- Keep the call open for a while in case the 200 is lost to be -->
<!-- able to retransmit it if we receive the BYE again. -->
<pause milliseconds="4000"/>

<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>

<!-- definition of the call length repartition table (unit is ms) -->
<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>

</scenario>
50 changes: 50 additions & 0 deletions load_tests/tests/createcall/createcall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

AUTHTOKEN=$1
RESTCOMM_ADDRESS=$2
LOCAL_ADDRESS=$3
MAX_CALLS=$4
CPS=$5
SIPP_CLIENT=sip:1999@$LOCAL_ADDRESS

SLEEP_TIME=$(echo "scale=10;1/$CPS" | bc)

DATE=$(date +%F_%H_%M)

echo "Running Create Call load test, will create REST API calls to get $MAX_CALLS calls to Client $SIPP_CLIENT with call rate $CPS cps" > $RESULTS_DIR/createcall-$DATE.log
echo "Authtoken: $AUTHTOKEN, RESTCOMM_ADDRESS: $RESTCOMM_ADDRESS, SIPP_CLIENT: sip:1999@$LOCAL_ADDRESS, MAX_CALLS: $MAX_CALLS, CPS: $CPS, SLEEP_TIME: $SLEEP_TIME" >> $RESULTS_DIR/createcall-$DATE.log

CURL_COMMAND="curl --connect-timeout 1 -X POST http://administrator%40company.com:$AUTHTOKEN@$RESTCOMM_ADDRESS:8080/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Calls.json -d From=15126001502 -d To=sip%3A1999%40$LOCAL_ADDRESS -d Url=http://$RESTCOMM_ADDRESS:8080/restcomm/demos/hello-play.xml"
echo "Will use CURL Command: $CURL_COMMAND" >> $RESULTS_DIR/createcall-$DATE.log
#First REST API Request will take longer than the rest because Jersey loads all endpoints
# exec $CURL_COMMAND

echo "Sleeping for 10 sec before starting the test" >> $RESULTS_DIR/createcall-$DATE.log
sleep 10
echo "About to start test" >> $RESULTS_DIR/createcall-$DATE.log

x=1
while [ $x -le $MAX_CALLS ]
do
echo "Will create $x call out of $MAX_CALLS to $SIPP_CLIENT" >> $RESULTS_DIR/createcall-$DATE.log
eval $CURL_COMMAND
x=$(( $x + 1 ))
echo "sleeping for $SLEEP_TIME seconds" >> $RESULTS_DIR/createcall-$DATE.log
sleep $SLEEP_TIME
done

SIPP_PID=$(pidof sipp)
echo
echo "Will wait for SIPP PID $SIPP_PID to finish"

while [ -e /proc/$SIPP_PID ]
do
echo "Process: $SIPP_PID is still running...."
sleep 20
done

echo "SIPP Finished. will terminate script"

echo "Everything set, will exit createcall.sh script" >> $RESULTS_DIR/createcall-$DATE.log

exit 0

0 comments on commit 735b365

Please sign in to comment.