[Asterisk-Users] Not answering inbound a line used for outboun

Rich Adamson radamson at routers.com
Sun Jun 12 20:25:21 MST 2005


> >
> > > exten => s,1,Wait(1)
> > > exten => s,2,GoTo(s,1)
> > >
> > > If I'm on the console when a call comes in, it loops through this bit of
> > > code a bunch of times. I'm guessing I could lengthen the "Wait(1)" time,
> > > but is there any other way to do this?
> >
> > Sure there is, but without knowing what type of pstn interface your
> > using, can't suggest an exact coding method. For me (with a TDM-fxo card),
> > the zapata.conf entry for that channel has a context=nowhere kind of
> > statement. Since the "nowhere" context doesn't exist, nothing in asterisk
> > will answer that pstn line.
> 
> Sorry about the lack of info; I should have mentioned it's an FXO card.
> 
> Your "nowhere" suggestion seems to fit the bill. Would it be possible to
> create blank [nowhere] context, so that things are complete, and would
> that still achieve the same effect?

I use to do the same thing (having an analog fax machine bridged on
the same pstn line that also connects to asterisk). You can include
the [nowhere] context in extensions.conf, but I did not; its just not
needed as the context name is very clear.

> > You can also use one of the fax detect mechanisms (including spandsp) to
> > sense incoming calls, and if its an incoming fax call send it to a
> 
> That's an intersting use that I hadn't thought of; but the FXO card is
> sharing a line with an FXO device, so it shouldn't answer.

After having played around with many fax alternatives, the approach
I like the best is to outsource the inbound fax to one of the companies
the specialize in this (I use TrustFax), and leave the fax machine
bridged onto the line (like you have it), but turn off the auto-
answer. The fax machine is then used for outbound only, and all
inbound faxes appear in my email as a pdf. Very nice, quick, no fax
maintenance, no dicking around with asterisk code, no toner, no
paper to disburse, etc.
 
> But, on those lines, I have been reading a bit about Asterisk and Fax,
> and it's a bit confusing, to say the least. To just answer and recieve
> a fax, do I need to compile/link against anything else, or will a reasonably
> current build of Asterisk do this out of the box? (I found a "fax" extension
> refrence when doing my search for the no answer question, but it is
> unclear if this is a stub or if all of the functionality is there)

I believe you will find that in order to use any of the fax detection
mechanisms within asterisk, you won't be able to have an external
fax machine bridged on that pstn line. That's one of the reasons 
that I went with an outsourced fax company. But, if you want to play
around to learn more, look at 
 /usr/src/asterisk/configs/zapata.conf.sample
and search for "faxtect=" parameter. However, all of the fax detect
mechanisms require the call be "answered" by asterisk, which then defeats
the external fax machine. If you try to forward an incoming fax call
within asterisk to a fax machine attached to a ata186 (or whatever),
you likely find the reliability is very poor due to issues with the
digium fxo cards (both TDM and X100P).
 
> > > Now, two other related questions:
> > > Can Asterisk recognize that something other then a Zap card has a line
> > > offhook? (ie there is a fax transmission in progress)
> >
> > You'll have to clearify the above better. If you're asking about another
> > bridged phone on the same analog pstn line, no asterisk doesn't currently
> > have code in it that would recognize speech on the line, lack of a dial
> > tone, or any other parameter that would suggest the line is in use. (The
> > TDM card's chipset can detect it, but the code isn't in asterisk to take
> > advantage of it.)
> 
> Ok, I'm not sure what you mean by "another bridged phone".
> 
> I used to have an old-fangled analog phone, and when someone picked up
> another extension on the same PSTN line, it had an LED that came on, even
> onhook. So, I'm assuming there is a way to "sense" the line is offhook
> somewhere. I've read about the dialtone issue, but I think that trying
> to recognize dialtone/speech is further down the line, once you've gone
> offhook, but I could be mistaken.

I said "phone" when I should have said "fax machine" in the above.

The digium x100p and TDM-fxo cards use chip sets that have the capability
to recognize whether an external phone or fax machine is in use. When
either an external phone or fax machine is using the line, the line 
voltage drops to something like 5 volts (instead of 48 volts). So, yes
the card can detect it, but there is no code in asterisk right now to
use that information from the card. Therefore, asterisk cannot detect
whether your external fax machine is in use.
 
> > > Can I do something interesting with CallerID? (for example, create a log
> > > of all faxes that called us, or answer certain numbers inside of
> asterisk)

Sort of, but you're kind of pushing it. To do that, you're going to 
have to have a valid extensions.conf context (not [nowhere]), and
in that context set a variable x=${CALLERID}, and do something with
it. But, understand that CallerID arrives between ring 1 and 2 (in
the US) and by the time asterisk has it, the fax machine will likely
have already answered the inbound call. Kind of depends on how
quick your fax machine answers the call.

Now, if that extensions.conf fax context does not include anything
like 'answer', asterisk will _not_ answer that inbound call. For
example, if the context included a Dial statement, asterisk will
_not_ answer the call until the sip phone noted in the Dial statement
actually picks up the call. So, handling the ${CALLERID} variable
might be doable, but will likely be dependent on your fax machine
timing in terms of when it answers the inbound call.

> > Sure you can. Take a look at the various README files in:
> >  /usr/src/asterisk/doc
> > and particularily the README.variables file.
> 
> Well, I checked out Asterisk from CVS, so the path is different, but the
> files are in there. I briefly looked through this when I installed, but
> this list and the Wiki have been good refs as of late.
> 
> Thanks for the reminder though; I had definately forgotten about that dir.
> 
> To record interesting things through the dialplan though, I'd need some
> actual context with at least the start extension, correct? (In which case,
> Could I have it do it's thing and then ignore the incoming call if it
> doesn't like it?)

Yes. Something like:
 [inbound-fax]
 exten => s,1,NoOp,${CALLERID}
will display the callerid on the CLI, but not answer the call. 
 
> > However, be careful with CallerID assumptions. Telemarketing and junk fax
> > generators typically disable sending any CallerID info, so it won't be
> > all that useful.
> 
> Yes, I understand that. I'm looking rather at letting paticular people
> call the fax ine and pick up with asterisk, before the fax machine kicks
> in. For the accounting stuff, I'm more interested in getting an idea of
> line utilization (how many incoming faxes, and from where), rather then
> being able to pinpoint someone sending junkfaxes.

Sure, then:
 [inbound-fax]
 exten => s,1,NoOp,${CALLERID}
 exten => s,2,If Callerid = xxxx goto 6666
where 6666 is a valid extension defined in externsions.conf; obviously
the above syntax is no where near right.

When you get all done messing around with the above, I think you'll
find things much easier to handle for small businesses by just
outsourcing the inbound fax stuff. It certainly will be more reliable.





More information about the asterisk-users mailing list