Is it possible to read message from terminal command to run other script ? What i am doing is i need to know where the asterisk server is connected to pstn line or not. if it is not connected,some other script is run to notify me. It is possible to know the connection between asterisk and pstn line by simply running
[root@localhost] # isdahdi
terminal comment in asterisk server. If the pstn line is not connected it return
.###Span 1: OPVXA1200/12 "OpenVox A1200P/A800P Board 13" (MASTER)
1 FXO FXSKS (In use) (EC: OSLEC - INACTIVE) RED
2 FXO FXSKS (In use) (EC: OSLEC - INACTIVE) RED
3 FXO FXSKS (In use) (EC: OSLEC - INACTIVE) RED
4 FXO FXSKS (In use) (EC: OSLEC - INACTIVE) RED
"RED" means no pstn line connected to this port. Can i read this message "RED" to run other ?