Where LINES is a global variable and defined as:
LINES => Zap/3&Zap/4
Currently if Zap/3 is being used then it will dial using zap/4. If there is no line connected to zap/3 it still attempts to use it. The problem is that I do not know if there will be a line connected to zap/3. How do I have asterisk determine if the line is useable?
Easy fix, in your zaptel.conf add group=0 and then dial ZAP/g0 instead of Zap/3. Basically your telling it to use one of the channels in group 0. Asterisk will find the open channel and use it.