[asterisk-dev] New AGI manager command: PlaySound

Nir Simionovich nir.simionovich at gmail.com
Sat Jan 24 14:05:47 CST 2009


   I think it is very dependent on the implementation. For example, a 
nice way to implement such an AMI action would be to send something like

Action: PlaySound
Channel: SIP/xx.xx.xx.xx-12EDQW12
File: testing_dir/sound_filename_without_extension

   For example, the above can be used to inject an audio file into an 
existing channel handler. While on the subject, I think that another
Action also needs to be implemented, which is "ReadDTMF". This will
enable similar functionality as the dialplan Read application, only
to a specific channel overlay.

   Coming to think about, I think the better way to do it would be to a
ChannelHook action, which will enable us to hook a new channel into an
existing channel or an existing channel bridge. Something for example
like this:

Action: ChannelHook
Channel: SIP/xx.xx.xx.xx-12EDQW12
Context: Context_Name
Exten:   Extension_in_context
Prioroty: Priority_in_extension_or_label

   The above can be used to hook a specific dialplan context into an 
existing channel or bridged channels, thus, allowing the control to be
passed from the dialplan.

   Apart from saying that I like the idea - I have no idea where to 
start working on this. I believe it will involved a fair portion of 
Media processing and working with chan_local or something of the sort. 
In addition, this will need to take into account situations where the 
Media may not traverse the Asterisk box due to SIP re-invites or IAX2 
transfers, where the call simply disappears from the box.

nik600 wrote:
> sorry, i was talking about AMI, not AGI.
> Ok, so it's more harder that what i think, but it's not impossible, do
> you think that this functionality will be useful?
> If i decide to try to write this, can i ask you a point of view before
> to coding that?
> Thanks
> On Sat, Jan 24, 2009 at 8:25 PM, Russell Bryant <russell at digium.com> wrote:
>> On Jan 24, 2009, at 1:00 PM, nik600 wrote:
>>> If i'm wrong, please correct me but i think that it doesn't exists an
>>> AGI manager command to play a sound (or an audio file) on a specific
>>> channel.
>> First, are you talking abotu AGI or the manager interface (AMI) ?
>> They are too different beasts.
>> In AGI, you certainly already have this capability through STREAM FILE
>> or with EXEC Playback.
>> In AMI, you would be correct in saying that there is not a straight
>> forward way to do this today.  However, it's not as trivial to
>> implement as you might think.  You can not model it after app_playback
>> or something similar.  The big reason is that the handling of a
>> manager action happens in another thread, not in the channel thread
>> like the Playback application code.
>> --
>> Russell Bryant
>> Digium, Inc. | Senior Software Engineer, Open Source Team Lead
>> 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
>> Check us out at: www.digium.com & www.asterisk.org
>> _______________________________________________
>> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>> asterisk-dev mailing list
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-dev

Kind Regards,
   Nir Simionovich
   Asterisk Community Founder and Maintainer - Israel

   (e) nir.simionovich at gmail.com
   (w) http://www.simionovich.com

More information about the asterisk-dev mailing list