Skip to content

Commit

Permalink
Fix issue #85
Browse files Browse the repository at this point in the history
  • Loading branch information
leftyb authored and leftyb committed Jul 20, 2016
1 parent 7d69a52 commit 280d4ec
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions scripts/restcomm_conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,25 @@ if [ -n "$RESTCOMM_TRACE_LOG" ]; then
http=$((http + $PORT_OFFSET))
fi

nohup xargs bash -c "tcpdump -pni any -t -n -s 0 \"portrange ${sipLPort}-${sipHPort} or (udp and portrange ${MEDIASERVER_LOWEST_PORT}-${MEDIASERVER_HIGHEST_PORT}) or port ${http} or port ${https} or port ${mgcpL} or port ${mgcpR} \" -G 3500 -w $LOGS_TRACE/$RESTCOMM_TRACE_LOG/restcomm_trace_%Y-%m-%d_%H:%M:%S-%Z.pcap -z gzip" &

#Used to start TCPDUMP when restarting container
TCPFILE="/etc/my_init.d/restcommtrace.sh"
#Add additional connectors to the TCPDUMP.
grep "ADDITIONAL_CONNECTOR_" /etc/container_environment.sh | cut -d " " -f2 | cut -d: -f2 > myports
while read line; do
if [ -n "$PORT_OFFSET" ]; then
line=$((line + $PORT_OFFSET))
fi
fport+="port ${line} or " ;
done < myports
echo $fport;
rm myports

nohup xargs bash -c "tcpdump -pni any -t -n -s 0 \" ${fport} portrange ${sipLPort}-${sipHPort} or (udp and portrange ${MEDIASERVER_LOWEST_PORT}-${MEDIASERVER_HIGHEST_PORT}) or port ${http} or port ${https} or port ${mgcpL} or port ${mgcpR} \" -G 3500 -w $LOGS_TRACE/$RESTCOMM_TRACE_LOG/restcomm_trace_%Y-%m-%d_%H:%M:%S-%Z.pcap -z gzip" &

#Used to start TCPDUMP when restarting container
TCPFILE="/etc/my_init.d/restcommtrace.sh"
cat <<EOT >> $TCPFILE
#!/bin/bash
nohup xargs bash -c "tcpdump -pni any -t -n -s 0 \"portrange $sipLPort-$sipHPort or (udp and portrange $MEDIASERVER_LOWEST_PORT-$MEDIASERVER_HIGHEST_PORT) or port $http or port $https or port $mgcpL or port $mgcpR\" -G 3500 -w $LOGS_TRACE/$RESTCOMM_TRACE_LOG/restcomm_trace_%Y-%m-%d_%H:%M:%S-%Z.pcap -z gzip" &
nohup xargs bash -c "tcpdump -pni any -t -n -s 0 \"$fport portrange $sipLPort-$sipHPort or (udp and portrange $MEDIASERVER_LOWEST_PORT-$MEDIASERVER_HIGHEST_PORT) or port $http or port $https or port $mgcpL or port $mgcpR\" -G 3500 -w $LOGS_TRACE/$RESTCOMM_TRACE_LOG/restcomm_trace_%Y-%m-%d_%H:%M:%S-%Z.pcap -z gzip" &
EOT
chmod 777 $TCPFILE
fi
Expand Down

0 comments on commit 280d4ec

Please sign in to comment.