Last active
February 1, 2019 09:28
-
-
Save areski/49e2aaf64233f7d5feb2f1790d3060bd to your computer and use it in GitHub Desktop.
Run SIPP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Newfies-Dialer - Stress testing stack | |
# Copyright (C) <2019> <Belaid Arezqui> | |
# | |
# | |
# Install and run SIPP | |
# | |
# Usage: | |
# bash run-sipp.sh install | |
# | |
# or | |
# bash run-sipp.sh | |
# | |
echo "!!!!!" | |
echo "Dont't forget to open the firewall!" | |
echo "" | |
echo "Press Enter to continue or CTRL-C to exit" | |
read TEMP | |
IFCONFIG=`which ifconfig 2>/dev/null||echo /sbin/ifconfig` | |
IPADDR=`$IFCONFIG eth0|gawk '/inet addr/{print $2}'|gawk -F: '{print $2}'` | |
if [ -z "$IPADDR" ]; then | |
#the following work on Docker container | |
# ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/' | |
IPADDR=`ip -4 -o addr show eth0 | cut -d ' ' -f 7 | cut -d '/' -f 1 | head -n 1` | |
if [ -z "$IPADDR" ]; then | |
clear | |
echo "we have not detected your IP address automatically!" | |
echo "Please enter your IP address manually:" | |
read IPADDR | |
echo "" | |
fi | |
fi | |
if [ $@ = "install" ]; then | |
echo "-- install sipp --" | |
apt-get update | |
apt-get -y install gcc autoconf automake devscripts gawk g++ git-core 'libjpeg-dev|libjpeg62-turbo-dev' libncurses5-dev 'libtool-bin|libtool' make python-dev gawk pkg-config libtiff5-dev libperl-dev libgdbm-dev libdb-dev gettext libssl-dev libcurl4-openssl-dev libpcre3-dev libspeex-dev libspeexdsp-dev libsqlite3-dev libedit-dev libldns-dev libpq-dev libmp3lame-dev | |
apt-get -y install libpcap-dev | |
cd /usr/src | |
wget https://github.com/SIPp/sipp/releases/download/v3.5.1/sipp-3.5.1.tar.gz | |
tar -xvzf sipp-3.5.1.tar.gz | |
cd sipp-3.5.1 | |
./build.sh --with-pcap --with-openssl | |
make ; make install | |
else | |
echo "-- run sipp --" | |
echo "" | |
echo "sipp --rtp_echo -sn uas $IPADDR:5060" | |
echo "" | |
sipp --rtp_echo -sn uas $IPADDR:5060 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment