[asterisk-users] Is answer() necessary ?

Ishfaq Malik ish at pack-net.co.uk
Mon Mar 1 05:01:24 CST 2010


jonas kellens wrote:
> Hello list,
>
> is it necessary to properly answer() an incoming call ?
>
> I don't want to answer a call because the caller has to pay even if 
> the attached SIP-phones do not answer the phone call. Because I 
> answer() the incoming call, the caller has to pay for 60 seconds of 
> 'ringtone'.
>
> On the other hand, sometimes an incoming call is send to a macro where 
> the caller is given the opportunity to leave a voicemail message. It's 
> to late to answer() the call in the macro, but I guess the 
> voicemail()-application automatically anwers the call ??
>
> How about an IVR-prompt and a queue ? Do I need to answer the incoming 
> call before playing a voiceprompt and before sending it into a queue ??
>
> Greetingz,
> Jonas. 
Hi

I was having similar problems to you and stoped using Answer at the 
start of my incoming dial plans with no problems. I'm finding that 
applications such as VoiceMail implicitly answer the channel so that is 
not a problem.

Here's a more in depth response I received when asking the same question 
on this list

_______________________________________________________________________________________

Recall that in regards to SIP implementation, Asterisk is a
back-to-back user agent (B2BUA).  This means that one logical call leg
comes in, and another logical call leg is generated out, and the two
are cross-connected.  If SIP is not the signaling technology used on
one or both channels, the effect is analogical where applicable.
However, I will use SIP to illustrate the point;  you can extrapolate
from there similar effects on other channel types.

The function that Answer() has on a signaling level is to effect an
"pickup" on the incoming call leg.  In SIP, this is a 200 OK message.
  If you then proceed to Dial() out on another channel, any ringback
generated out the first channel will be in-band;  that is to say, it
will be inside the acoustic bearer.  A far-end pickup (200 OK) is
necessary to exchange audio bidirectionally.

Some dial plan functions - mostly those that conceivably entail a
two-way communication path - imply Answer() and will execute it for
you if you have not already done so.  Others do not.  For example, it
is possible to generate in-band ringback via "early media," e.g. by
sending a 183 Session in Progress message with an SDP payload to the
sender.  So, for example, if you were to do this:

    exten => s,1,MusicOnHold

without doing an Answer() first, the MOH would be played via early
media without pickup.

By the same token, if you Dial() out before Answer()ing, the ringback
generated will also be via early media (or, if applicable,
out-of-band, depending on other settings):

    exten => s,1,Dial(SIP/otherplace at other_peer)

This will not result in a 200 OK received on the far end of the
incoming channel until there is a 200 OK received on the near end of
the outgoing channel.

That is the function that Answer() serves.  The option to remove it is
contingent upon refraining from use of dial plan applications that
implicitly invoke it.

Alex

____________________________________________________________________________________

Hope all this helps

Ish
-- 
Ishfaq Malik
Software Developer
PackNet Ltd

Office:   0161 660 3062



More information about the asterisk-users mailing list