Posts Tagged ‘timeout’

Asterisk: skip some action within timeout after a call

Tuesday, April 29th, 2025

Let’s skip playing an annoying greeting for the caller, if he already called us withing the last 10 minutes.

Create a macro:

And use this macro in your dialplan:

Linux: run a command with a time limit

Thursday, May 18th, 2017

Need to run tcpdump at night writing to a pcap file? Not a problem with a crond.
Need to stop it after 10 minutes? One more crond task initiating something like ‘ps aux | grep [t]cpd’, parsing it PID and killing it? No!

timeout 10m tcpdump -v -pnni eth0 udp src port 5060 and dst port 5060 and host 10.11.7.1 -w pbx_`date +%F_%H-%M`.pcap

timeout – a nice GNU coreutil.