Execute a command before dialing

Hello,

I have a misdn channel defined as a custom trunk.

It works ok, but after some time the line is going down. I have to execute misdn_check_l2l1 before the dial command.

Where can I put this command?

There is any place where I can continue using freepbx interface without problems? and without have to change the custom file every time I change my outbound routes?

thanks

Maybe you could add:

[outbound-allroutes-custom]

to your extensions_custom.conf and put your code under it. It would run the code each time you dialed an outside number if you did that.

It might look like:

[outbound-allroutes-custom]

exten => _X.,1,executeYourCodeHere

Once this is done executing your code it will fall to the normal outbound-allroutes