[Asterisk-Users] Detect line is busy with Zap?

Rich Adamson radamson at routers.com
Thu Dec 16 06:16:22 MST 2004


Inline...

> I have an FXO card connected to my phone line which works in Asterisk as
> Zap/1.
> 
> Is there any way of detecting whether something else is on the line
> before picking up on this channel?

The simple answer: No. The long answer: the chipset used for the tdm fxo
modules does have the capability to sense that (along with other things),
however the driver code does not attempt to make use of such data.

> For example, I dont want to pick up and dial out on the line if someone
> is on it using another phone (which is connected directly to the line,
> rather than through Asterisk).
> 
> Also, when an incoming call comes in, i've got this:
> 
> [incoming_pstn]
>   exten => s,1,NoOp(${CALLERID} calling on Zap/1)
>   exten => s,2,Wait,15
>   exten => s,3,Answer
>   exten => s,4,Voicemail(su1)
>   exten => s,5,Hangup
> 
> I really want to wrap the Answer, Voicemail and Hangup commands in some
> kind of if statement so if Asterisk didn't detect that the call had been
> answered for any reason, it wouldn't answer the call if the line was
> busy - otherwise it would click in and play the voicemail greeting over
> the call which someone is conducting from a non-asterisk phone on the
> line.

I'm not sure I understand all the double-negatives in that statement,
but try a couple answers to see if it fits with what you're trying
do do.

I have one incoming pstn line that has both * and analog house phones
connected to the same pstn line. I use:
[inbound-home]
exten => s,1,Dial(${PHONE3}&${PHONE4},20)
exten => s,103,Hangup

where the 20 second timeout is longer then our old answering machine
uses (that my spouse loves). If she picks up the analog phone (non-*),
* detects the fact that ringing disappeared and ignores the call.
If no one answers, * still ignores the call after 20 seconds. If
you want * to answer after the 20 seconds (assuming no one picked
up the call from any source), then something like add:
[inbound-home]
exten => s,1,Dial(${PHONE3}&${PHONE4},20)
exten => s,2,Voicemail(u3000)              
exten => s,102,Voicemail(b3000) 
exten => s,103,Hangup

If one of those suggestions does not fit your requirements, then 
you'll likely have to insert * in the middle of all calls. E.g, receive
the call on a fxo port, and route that call to a fxs port, leaving
asterisk in the middle with whatever logic you want to apply. That
would require something like the tdm card with both fxo and fxs
modules, or, spa-3000 (for substantially less money for one line).






More information about the asterisk-users mailing list