Hi, 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? 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. My zapata.conf looks like this: [channels] context=incoming_pstn signalling=fxs_ks usecallerid=yes echocancel=yes echocancelwhenbridged=yes echotraining=yes rxgain=1.0 txgain=0.0 channel => 1 Thanks! --ian
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).
Ian Chilton <mailinglist@ichilton.co.uk> wrote: [...]> Is there any way of detecting whether something else is on the line > before picking up on this channel?No, but you could insert a privacy adaptor device to prevent the FX100P from attempting to dial out. -- My mother protected me from the world and my father threatened me with it. - Quentin Crisp
> 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?I had this problem too when first testing asterisk while we had normal phones connected to both lines. You know, the period in development where you are using rmmod, make, and modprobe every 5 minutes or so? There is AFAIK absolutely no solution. What I did though was to inhibit any action by asterisk when certain manually set flags were found. This allowed me to tell * to answer only my line (or no lines if an important call was expected) while not dealing with the company main line. When a call was detected, the flag was checked (a "do nothing" flag) and if set, sent the dialplan to [do-nothing] which from memory looked like this: [do-nothing] exten => s,1, Wait(15) (probably could just as well contain a single NoOp) I gave up on trying to deal with lines connected also to phones.