Matthew B Marlowe
2004-Feb-04 20:59 UTC
[Asterisk-Users] Music on hold inside of an agi script while processing programs in background
Im the first to admit I am not a programmer. Im trying to learn peal to accomplish one small script for my company. I've got most of the script accomplished and I simply want to play music on hold while the script processes some programs which take on average anywhere from 3-10 seconds. Is there any way to tell asterisk to start music on hold, and in the background execute my functions and when those functions are done then stop the music on hold? Right now, if I execute $AGI->exec(MusicOnHold); the entire script stops and doesn't process anything past that point. Thanks in advance
Brian West
2004-Feb-04 21:04 UTC
[Asterisk-Users] Music on hold inside of an agi script while processing programs in background
I do this: print "SET MUSIC ON default\n"; :P On Wed, 4 Feb 2004, Matthew B Marlowe wrote:> Im the first to admit I am not a programmer. Im trying to learn peal to > accomplish one small script for my company. > > I've got most of the script accomplished and I simply want to play music > on hold while the script processes some programs which take on average > anywhere from 3-10 seconds. > > Is there any way to tell asterisk to start music on hold, and in the > background execute my functions and when those functions are done then > stop the music on hold? > > Right now, if I execute $AGI->exec(MusicOnHold); the entire script stops > and doesn't process anything past that point. > > Thanks in advance > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
Matthew B Marlowe
2004-Feb-04 21:12 UTC
[Asterisk-Users] Music on hold inside of an agi script while processing programs in background
I'm sorry, unless I'm missing something here? Wont a print "SET MUSIC ON default\n"; just print that text? Don't I need to execute it somehow with $AGI->....? -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Brian West Sent: Wednesday, February 04, 2004 11:04 PM To: asterisk-users@lists.digium.com Subject: Re: [Asterisk-Users] Music on hold inside of an agi script while processing programs in background I do this: print "SET MUSIC ON default\n"; :P On Wed, 4 Feb 2004, Matthew B Marlowe wrote:> Im the first to admit I am not a programmer. Im trying to learn pealto> accomplish one small script for my company. > > I've got most of the script accomplished and I simply want to playmusic> on hold while the script processes some programs which take on average > anywhere from 3-10 seconds. > > Is there any way to tell asterisk to start music on hold, and in the > background execute my functions and when those functions are done then > stop the music on hold? > > Right now, if I execute $AGI->exec(MusicOnHold); the entire scriptstops> and doesn't process anything past that point. > > Thanks in advance > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >_______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Matthew B Marlowe
2004-Feb-04 21:16 UTC
[Asterisk-Users] Music on hold inside of an agi script while processing programs in background
Ok, that worked. I obviously have no clue to have the functions I can do with AGI. I couldn't find the print " SET MUSIC ON default..." method in any documentation. Is it anywhere? I'd like to read up on AGI as much as I could. -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Brian West Sent: Wednesday, February 04, 2004 11:04 PM To: asterisk-users@lists.digium.com Subject: Re: [Asterisk-Users] Music on hold inside of an agi script while processing programs in background I do this: print "SET MUSIC ON default\n"; :P On Wed, 4 Feb 2004, Matthew B Marlowe wrote:> Im the first to admit I am not a programmer. Im trying to learn pealto> accomplish one small script for my company. > > I've got most of the script accomplished and I simply want to playmusic> on hold while the script processes some programs which take on average > anywhere from 3-10 seconds. > > Is there any way to tell asterisk to start music on hold, and in the > background execute my functions and when those functions are done then > stop the music on hold? > > Right now, if I execute $AGI->exec(MusicOnHold); the entire scriptstops> and doesn't process anything past that point. > > Thanks in advance > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >_______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Matthew B Marlowe
2004-Feb-04 21:49 UTC
[Asterisk-Users] Music on hold inside of an agi script while processing programs in background
Ok, thanks. I'll add that at the top. Although without adding that it seemed to work fine and then when my next sound file came in it automatically turned the music on hold off although I assume I should probably initiate a set music off before starting with the next voice file. Thanks for your help. I can now continue work with my script. :) -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Brian West Sent: Wednesday, February 04, 2004 11:23 PM To: asterisk-users@lists.digium.com Subject: RE: [Asterisk-Users] Music on hold inside of an agi script while processing programs in background You can do it like that or you can just print it.. OH one thing.. Add this at the top: $| = 1; That keeps the buffer flused.. otherwise the command won't get printed till its too late and then it serves no purpose. bkw On Wed, 4 Feb 2004, Matthew B Marlowe wrote:> I'm sorry, unless I'm missing something here? Wont a print "SET MUSICON> default\n"; just print that text? > > Don't I need to execute it somehow with $AGI->....? > > > > -----Original Message----- > From: asterisk-users-admin@lists.digium.com > [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Brian West > Sent: Wednesday, February 04, 2004 11:04 PM > To: asterisk-users@lists.digium.com > Subject: Re: [Asterisk-Users] Music on hold inside of an agi script > while processing programs in background > > I do this: > > print "SET MUSIC ON default\n"; > > :P > > On Wed, 4 Feb 2004, Matthew B Marlowe wrote: > > > Im the first to admit I am not a programmer. Im trying to learnpeal> to > > accomplish one small script for my company. > > > > I've got most of the script accomplished and I simply want to play > music > > on hold while the script processes some programs which take onaverage> > anywhere from 3-10 seconds. > > > > Is there any way to tell asterisk to start music on hold, and in the > > background execute my functions and when those functions are donethen> > stop the music on hold? > > > > Right now, if I execute $AGI->exec(MusicOnHold); the entire script > stops > > and doesn't process anything past that point. > > > > Thanks in advance > > > > _______________________________________________ > > Asterisk-Users mailing list > > Asterisk-Users@lists.digium.com > > http://lists.digium.com/mailman/listinfo/asterisk-users > > To UNSUBSCRIBE or update options visit: > > http://lists.digium.com/mailman/listinfo/asterisk-users > > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >_______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users