[HELP] Putting down a span on TE410P

I have PRI span from telco plugged into TE410P port. Calls come from telco to * and then out over SIP provider. I need telco to take another route (not through my *) if I can’t call out via SIP, i.e. my internet connection goes down.
The only way to do it is to put the span down. Is there any way to disable one of the spans on Digium card programmaticaly (for example, from cron script)?

Possibly call the system command in the dialplan if a Sip call fails which shuts down Asterisk. Also would be a good idea to add “yellow” to your span definition in zaptel.conf