Yaroslav Panych
2012-Feb-03 16:29 UTC
[asterisk-users] [asterisk-dev] How to play audio file in background in dialplan?
Hi I have a task. While serving incoming call I should do some longtime task(consumes more than few tens of seconds). So I decided to turn on background music in order to entertain caller. `core show applications` showed me 3 potential candidates: Background, Playback and StartMusicOnHold. Unfortunately, all of them does not meet my requirements: 1. Background and Playback block execution of dialplan. 2. StartMusicOnHold I cannot say which file it should play. Only class, which is inpossible for me because of file to play is of dynamically generated content with runtime obtained name, and I cannot predict and configure all possible pairs of file-name/class-name.(And don't want to use realtime to link class-name and file-name on fly). Any ideas? regards, Yaroslav
Danny Nicholas
2012-Feb-03 16:35 UTC
[asterisk-users] [asterisk-dev] How to play audio file in background in dialplan?
Assuming your longtime task is in an AGI, you could do this: <AGI> Print STDOUT "SET MUSIC ON HOLD DEFAULT\n" .. agi logic .. .. end of agi logic .. Print STDOUT "SET MUSIC ON HOLD OFF\n" -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Yaroslav Panych Sent: Friday, February 03, 2012 10:30 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] [asterisk-dev] How to play audio file in background in dialplan? Hi I have a task. While serving incoming call I should do some longtime task(consumes more than few tens of seconds). So I decided to turn on background music in order to entertain caller. `core show applications` showed me 3 potential candidates: Background, Playback and StartMusicOnHold. Unfortunately, all of them does not meet my requirements: 1. Background and Playback block execution of dialplan. 2. StartMusicOnHold I cannot say which file it should play. Only class, which is inpossible for me because of file to play is of dynamically generated content with runtime obtained name, and I cannot predict and configure all possible pairs of file-name/class-name.(And don't want to use realtime to link class-name and file-name on fly). Any ideas? regards, Yaroslav -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Steve Edwards
2012-Feb-03 17:46 UTC
[asterisk-users] [asterisk-dev] How to play audio file in background in dialplan?
On Fri, 3 Feb 2012, Yaroslav Panych wrote:> I have a task. While serving incoming call I should do some longtime > task(consumes more than few tens of seconds). So I decided to turn on > background music in order to entertain caller.Do your processing in an AGI. Before you get into your 'longtime task' create another thread to play your file. When you finish your 'longtime task' join the background thread. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
Danny Nicholas
2012-Feb-03 21:55 UTC
[asterisk-users] How to play audio file in background in dialplan?
In my PERL AGI I use - print STDOUT "SET MUSIC ON HOLD DEFAULT\n"; - print STDOUT "SET MUSIC ON HOLD OFF\n"; Ignore the "-" - stupid outlook needs them. -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Yaroslav Panych Sent: Friday, February 03, 2012 3:53 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] How to play audio file in background in dialplan? 2012/2/3 Danny Nicholas <danny at debsinc.com>:> <start music> > Fork or shell task 1 > Fork or shell task 2 > <stop music>What exactly commands I should invoke in AGI instead of <start music> and <stop music> ? STREAM FILE returns only after file ends, this is not what I want. -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Steve Edwards
2012-Feb-03 23:45 UTC
[asterisk-users] How to play audio file in background in dialplan?
On Sat, 4 Feb 2012, Yaroslav Panych wrote:> It should be stopped only after > DO-SOME-ACTION-BASED-ON-PREVIOUS-CALL-RETURN-CODE completes. It is > actually my longtime operation.BTW, we still have NFC what DO-SOME-ACTION-BASED-ON-PREVIOUS-CALL-RETURN-CODE does. More details may yield better suggestions. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000