How to run command on call start and call finish

I am interested in using VoIP at home with asterisk. I have the system fully functional, but there is one problem, network congestion.

There is usually at least one peice of p2p software running here and the link is often badly lagged resulting in maybe a 2 second lag in call audio.

I’ve tried giving IAX2 more priority but it doesn’t work as I would like.

My plan is to run a command on a call start (incoming or outgoing) to cease all p2p traffic and allocate at least 64kbit for asterisk. I’d then like this to be taken out of effect when the call terminates, either successfully at the end of the call or when not answered.

I know I can run a command when a call comes through the PBX by putting it in the dial plan, but how can I act on the call released event?



If your router supports QoS you should be able to bypass this problem entirely. You might want to look at alternative firmware, such as OpenWRT.

You can run a script at the beginning of a call using the System() command. To continue call processing after a call is hung up, you will need to utilize the ‘h’ extension.


Watch for our new website coming soon to