diff --git a/bin/check.sh b/bin/check.sh index 5b3ecae9..e3a01d24 100755 --- a/bin/check.sh +++ b/bin/check.sh @@ -35,6 +35,10 @@ CDR=false ERR_FLAG=0 RETRANS_SIZE=2 +rtpengine_ctl_ip=$(grep 'listen-cli' /etc/rtpengine/rtpengine.conf|\ + awk '{print $3}') +RTPENGINE_CTL="rtpengine-ctl -ip ${rtpengine_ctl_ip}" + # $1 kamailio msg parsed to yml # $2 destination png filename graph() { @@ -399,6 +403,7 @@ error_helper() { find "${SCEN_CHECK_DIR}/" -type f -name 'sipp_scenario*errors.log' \ -exec mv {} "${LOG_DIR}" \; stop_capture + check_rtp exit "$2" } @@ -429,6 +434,20 @@ stop_capture() { fi } +check_rtp() { + local uuid + + uuid=$(awk '/^test_uuid:/ { print $2 }' "${SCEN_CHECK_DIR}/scenario.yml") + mapfile -t callids < <(${RTPENGINE_CTL} list sessions all|awk '{print $2}') + for callid in "${callids[@]}" ; do + if [[ "${callid}" =~ NGCP%${uuid}%/// ]]; then + echo "$(date) - Terminate RTP sessions for ${callid}" + ${RTPENGINE_CTL} terminate "${callid}" + ERR_FLAG=1 + fi + done +} + # $1 port to check check_port() { local status=0 @@ -919,10 +938,12 @@ if ! "$SKIP_RUNSIPP" ; then ((a++)) done fi - echo "$(date) - Done" fi + echo "$(date) - check RTP sessions, wait 5 secs first" + sleep 5 + check_rtp fi diff --git a/bin/config_debug.pl b/bin/config_debug.pl index af78e8ff..73deaea5 100755 --- a/bin/config_debug.pl +++ b/bin/config_debug.pl @@ -118,7 +118,7 @@ else $yaml->{witnessd}{gather}{sip_responsiveness} = 'no'; $yaml->{security}->{ngcp_panel}->{scripts}->{restapi}->{sslverify} = 'no'; $yaml->{mediator}{interval} = '1'; # Necessary to speedup the creation of the CDRs - $yaml->{rtpproxy}{delete_delay} = '5'; # Necessary to speedup the deletetion of the used ports in rtpengine + $yaml->{rtpproxy}{delete_delay} = '2'; # Necessary to speedup the deletetion of the used ports in rtpengine $yaml->{rtpproxy}{log_level} = '7'; $net_yaml = LoadFile($file_net_yaml);