Posted: Fri May 22, 2009 9:02 pm Post subject: [asterisk-users] How to stop a background music
You could make the background file into a MOH file in a separate class and use the MOH commands to start and stop it. Easier than coding C and recompiling.
From:asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Noel R. Morais
Sent: Friday, May 22, 2009 4:45 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] How to stop a background music
But I need a way to actively stop it. Without waiting for user hit a DTMF or the background timeout.
Like "StopMusicOnHold()", is there something like "StopBackground()"?
Thanks
On Fri, May 22, 2009 at 6:35 PM, Danny Nicholas <danny@debsinc.com (danny@debsinc.com)> wrote:
Background(file,m) will stop when user hits a DTMF digit that is an active extension in your dialplan.
Posted: Fri May 22, 2009 9:25 pm Post subject: [asterisk-users] How to stop a background music
Noel R. Morais wrote:
Quote:
But I need a way to actively stop it. Without waiting for user hit a
DTMF or the background timeout.
Like "StopMusicOnHold()", is there something like "StopBackground()"?
No, because the dialplan does not continue running until Background
either times out or the user presses DTMF that matches an extension in
the context Background was called from. There is no dialplan code
executing while Background is running, so where do you want to be able
to issue this 'StopBackground' command from?
--
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kpfleming@digium.com
Check us out at www.digium.com & www.asterisk.org
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
Posted: Mon May 25, 2009 2:32 pm Post subject: [asterisk-users] How to stop a background music
I'm planning to play a background music, make some background process and after that I will play another music or "transfer" the call to another end point.
I'm gonna see how difficult is to write a function like "StopBackground" to do that. Any hints?
> But I need a way to actively stop it. Without waiting for user hit a DTMF or
> the background timeout.
What event would trigger your desire to stop the background()?
Thanks in advance,
------------------------------------------------------------------------
Steve Edwards    sedwards@sedwards.com (sedwards@sedwards.com)    Voice: +1-760-468-3867 PST
Newline                       Fax: +1-760-731-3000
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
Posted: Mon May 25, 2009 4:52 pm Post subject: [asterisk-users] How to stop a background music
Un-top-posting...
Quote:
On Fri, May 22, 2009 at 7:37 PM, Steve Edwards
<asterisk.org@sedwards.com>wrote:
> On Fri, 22 May 2009, Noel R. Morais wrote:
>
>> But I need a way to actively stop it. Without waiting for user hit a
>> DTMF or the background timeout.
>
> What event would trigger your desire to stop the background()?
On Mon, 25 May 2009, Noel R. Morais wrote:
Quote:
I'm planning to play a background music, make some background process
and after that I will play another music or "transfer" the call to
another end point.
I'm gonna see how difficult is to write a function like "StopBackground"
to do that. Any hints?
I think you are "barking up the wrong tree."
The purpose of background() is to play a file until a key is pressed or
until the file is finished playing.
You will not execute the next step in your dialplan until the file is
finished* so how will you create a background process?
What you described sounds more like an AGI, "music on hold," "parking," or
dumping the caller into a conference and then transferring to the other
end point.
Based on what you have described, I would write an AGI that played the
file while waiting for whatever your triggering event is, set a channel
variable (the name of the end point?) and returned to the dialplan -- but
I tend to see AGIs as the solution to most non-trivial dial plan problems
:)
*or the exten is entered or a timeout.
Thanks in advance,
------------------------------------------------------------------------
Steve Edwards sedwards@sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum