asterisk cmd answer

Answer

Synopsis

Answer a channel if ringing

Description

Answer([delay])

If the channel is ringing, answer it, otherwise do nothing. If a delay is specified, Asterisk will wait this number of milliseconds AFTER answering the call. If you want to add a delay prior answering, use Wait.


Details

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@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.


[Syntax]
Answer([delay][,nocdr])


[Arguments]
delay
    Asterisk will wait this number of milliseconds before returning to
    the dialplan after answering the call.
nocdr
    Asterisk will send an answer signal to the calling phone, but will
    not set the disposition or answer time in the CDR for this call.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值