[asterisk-dev] Play announcements

Matthew Jordan mjordan at digium.com
Wed Jun 12 21:53:37 CDT 2013


On Wed, Jun 12, 2013 at 8:29 PM, Meadows Hoa <meadows_sub at yahoo.com> wrote:

> QUESTION #1
> If Asterisk's SIP channel driver (version 1.8) receives an SIP:INVITE from
> an endpoint (calling party), is it possible to play an announcement back to
> that originating endpoint immediately after the final SIP:ACK is received
> by the SIP channel driver?
>
> Would something in the extensions.conf file like the following work?
>
> *Exten => 7000,1,Dial(SIP/7000,10)*
> *Same => n,GotoIf($[“${DIALSTATUS}” = “ANSWER”]?answer:busy)*
> *Same => n(answer),Playback(tt-monkeys)*
> *Same => n(busy),Playback(tt-somethingwrong,noanswer)*
>
>
No. Dial immediately bridges the channels. With no options specified, the
Dial application won't return until the bridge is broken, which typically
occurs when channels hangup. With no options specified, Asterisk will
typically hang up the non-hungup channel when the bridge is broken.

If you want to playback a file to the caller, you should do so before the
Dial application is called. If you want to playback a file to the called
party before bridging, you should use the A option. See documentation for
the Dial application on the Asterisk wiki for more information:

https://wiki.asterisk.org/wiki/display/AST/Application_Dial


>
> QUESTION #2:
> Also, would there be a way to send an announcement through the terminating
> channel driver if the originating channel driver hung up,. so that an
> ANNOUNCEMENT is played to the called party before the terminating channel
> driver sends a SIP:BYE to the terminating endpoint (called party)?
>
>
Asterisk is a B2BUA, so the calling party does not transmit a BYE request
to the called party, Asterisk does. As such, yes, you can generally
manipulate what is presented and when it is presented.

In this particular case, you could use the F option to transfer the called
party to a new context, extension, priority and playback a file from that
location. You can then hangup the called party.


> *QUESTION #3:
> Is there a way to have a Channel Driver 'trigger' an annoucement to play
> at different times in the call flow through that channel driver to its
> endpoint? Some kind of function to inv *
>
>
There are certain interception routines that can be fired at particular
times in the dialplan. These include pre-dial handlers, pre-bridge
handlers, and hangup handlers. Several other options allow you to
periodically playback announcements to channels, although these are
typically used in the context of warning announcements before calls are
terminated (L option in Dial/Bridge). Documentation for all of these items
can be found on the Asterisk wiki.

Breaking out of a bridge between two channels to playback audio can be
disruptive to the participants in a call. There are other applications,
such as ChanSpy, that can whisper into channels. If you needed this to
trigger at particular times, you would most likely need to use AMI to
monitor the progress of the call and initiate the action.

All of that being said, in general, configuration questions such as these
are more appropriate for the asterisk-users mailing list. The asterisk-dev
list is used for discussing implementation of features within Asterisk -
you will most likely get more and better answers on the users mailing list
than here.

Matt

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130612/748ee8bb/attachment-0001.htm>


More information about the asterisk-dev mailing list