[asterisk-users] Switching between Music on Hold streams. [13.8.2]
I'd like multiple people to be able to dial in and listen to various live radio streams. I was told that the correct resource-friendly way would be to setup a MoH class, and then select that from the dialplan. This works well, but how do I switch between streams? Someone correct me if I'm wrong, but from previous similar questions a few years ago it seems like once you've entered a MoH class, there is no exit. But might there be some trick involved merged or bridged calls, or chan_spy or something, so that callers could quickly switch between 3 streams with a keypress? Thank you! -- _ -- 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
Re: [asterisk-users] Switching between Music on Hold streams. [13.8.2]
Michael, What you do is you dial another context and then use the G option in the dial string. So something like this. [radio-main] Exten => s,1,answer Exten => s,2,Background(play-menu) Exten => s,3,waitexten Exten => S,4,Goto(s,2) Exten => 1,1,Dial(Local/CNN@play-radio) Exten => 1,2,Goto(s,2) Exten => 2,1,Dial(Local/NPR@play-radio) Exten => 2,2,Goro(s,2) [play-radio] Exten => _[A-Z].,1,Answer Exten => _[A-Z].,2,Musiconhold(${EXTEN}) Regards, Dovid -Original Message- From: Jonathan H Sender: asterisk-users-bounces@lists.digium.comDate: Sun, 8 May 2016 11:36:42 To: Asterisk Users Mailing List - Non-Commercial Discussion Reply-To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Switching between Music on Hold streams. [13.8.2] I'd like multiple people to be able to dial in and listen to various live radio streams. I was told that the correct resource-friendly way would be to setup a MoH class, and then select that from the dialplan. This works well, but how do I switch between streams? Someone correct me if I'm wrong, but from previous similar questions a few years ago it seems like once you've entered a MoH class, there is no exit. But might there be some trick involved merged or bridged calls, or chan_spy or something, so that callers could quickly switch between 3 streams with a keypress? Thank you! -- _ -- 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 -- _ -- 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
Re: [asterisk-users] Switching between Music on Hold streams. [13.8.2]
Hi there; I didn't see any "G" option in the example above, and the usage for the option parameters is entirely undocumented at https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Dial The G options are as below G - If the call is answered, transfer the calling party to the specified priority and the called party to the specified priority plus one. context exten priority I think I have something almost there now, with the following: [streamdemo] exten => s,1,Answer exten => s,2,BackGround(menu) exten => s,3,WaitExten exten => s,4,Goto(s,2) exten => _[2,3,4,5],1,Dial(Local/${EXTEN}@play-radio,,G(play-radio^${EXTEN}^2)) exten => _[2,3,4,5],2,Goto(s,2) [play-radio] Exten => _[2,3,4,5],1,Answer exten => _[2,3,4,5],2,MusicOnHold(${CALLERID(name)}${EXTEN}) exten => _[2,3,4,5],3,Set(CHANNEL(language)=en_GB) exten => _[2,3,4,5],4,BackGround(menu) exten => _[2,3,4,5],5,WaitExten exten => _[X,t,i],1,Goto(streamdemo,s,2) However, it's like the play-radio channel can't "hear" the dtmf. Here's the output - once that MoH starts playing, no amount of button pushing works. All I'm left with is a channel which isn't closed properly when the phone is hung up. By the way, it looks like that "G" option IS working because the MoH starts, then the "called party" plays back an example piece of "menu" audio while the MoH is playing, but seems to ignore the keypresses. -- Executing [s@streamdemo:1] Answer("Local/s@root-0002;2", "") in new stack -- Local/s@root-0002;1 answered PJSIP/voipfone-201-0002 -- Channel Local/s@root-0002;1 joined 'simple_bridge' basic-bridge <3ac0c9be-2817-48e7-bcd8-4318eb1f9c2b> -- Channel PJSIP/voipfone-201-0002 joined 'simple_bridge' basic-bridge <3ac0c9be-2817-48e7-bcd8-4318eb1f9c2b> -- Executing [s@streamdemo:2] BackGround("Local/s@root-0002;2", "menu") in new stack -- Playing 'menu.alaw' (language 'en_GB') -- Executing [s@streamdemo:3] WaitExten("Local/s@root-0002;2", "") in new stack -- Executing [2@streamdemo:1] Dial("Local/s@root-0002;2", "Local/2@play-radio,,G(play-radio^2^2)") in new stack -- Called Local/2@play-radio -- Executing [2@play-radio:1] Answer("Local/2@play-radio-0003;2", "") in new stack -- Local/2@play-radio-0003;1 answered Local/s@root-0002;2 -- Executing [2@play-radio:2] MusicOnHold("Local/s@root-0002;2", "streamdemo2") in new stack -- Started music on hold, class 'streamdemo2', on channel 'Local/s@root-0002;2' -- Executing [2@play-radio:3] Set("Local/2@play-radio-0003;1", "CHANNEL(language)=en_GB") in new stack -- Executing [2@play-radio:4] BackGround("Local/2@play-radio-0003;1", "menu") in new stack -- Executing [2@play-radio:2] MusicOnHold("Local/2@play-radio-0003;2", "streamdemo2") in new stack -- Started music on hold, class 'streamdemo2', on channel 'Local/2@play-radio-0003;2' -- Playing 'menu.alaw' (language 'en_GB') -- Executing [2@play-radio:5] WaitExten("Local/2@play-radio-0003;1", "") in new stack -- Timeout on Local/2@play-radio-0003;1, going to 't' -- Executing [t@play-radio:1] Goto("Local/2@play-radio-0003;1", "streamdemo,s,2") in new stack -- Goto (streamdemo,s,2) -- Executing [s@streamdemo:2] BackGround("Local/2@play-radio-0003;1", "menu") in new stack -- Playing 'menu.alaw' (language 'en_GB') -- Executing [s@streamdemo:3] WaitExten("Local/2@play-radio-0003;1", "") in new stack -- Timeout on Local/2@play-radio-0003;1, continuing... On 8 May 2016 at 14:56, Dovid Bender wrote: > Michael, > > What you do is you dial another context and then use the G option in the dial > string. So something like this. > > [radio-main] > Exten => s,1,answer > Exten => s,2,Background(play-menu) > Exten => s,3,waitexten > Exten => S,4,Goto(s,2) > > Exten => 1,1,Dial(Local/CNN@play-radio) > Exten => 1,2,Goto(s,2) > > Exten => 2,1,Dial(Local/NPR@play-radio) > Exten => 2,2,Goro(s,2) > > [play-radio] > Exten => _[A-Z].,1,Answer > Exten => _[A-Z].,2,Musiconhold(${EXTEN}) > > > Regards, > > Dovid > > -Original Message- > From: Jonathan H > Sender: asterisk-users-bounces@lists.digium.comDate: Sun, 8 May 2016 11:36:42 > To: Asterisk Users Mailing List - Non-Commercial > Discussion > Reply-To: Asterisk Users Mailing List - Non-C
Re: [asterisk-users] Switching between Music on Hold streams. [13.8.2]
Jonathan H wrote: I'd like multiple people to be able to dial in and listen to various live radio streams. I was told that the correct resource-friendly way would be to setup a MoH class, and then select that from the dialplan. This works well, but how do I switch between streams? Someone correct me if I'm wrong, but from previous similar questions a few years ago it seems like once you've entered a MoH class, there is no exit. You can configure music classes with a DTMF digit that when pressed when listening to music on hold will cause the channel to switch to the new music class. From the musiconhold.conf sample file: ;digit=#; If this option is set for a class, then when callers ; ; are ; ; listening to music on hold, they can press this ; ; digit, and ; ; they will switch to listening to this music class. Cheers, -- Joshua Colp Digium, Inc. | Senior Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - US Check us out at: www.digium.com & www.asterisk.org -- _ -- 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
Re: [asterisk-users] Switching between Music on Hold streams. [13.8.2]
Josh, As he is playing different streams I think he wants to give the users the option to select another stream. On Mon, May 9, 2016 at 9:58 AM, Joshua Colp wrote: > Jonathan H wrote: > >> I'd like multiple people to be able to dial in and listen to various >> live radio streams. >> >> I was told that the correct resource-friendly way would be to setup a >> MoH class, and then select that from the dialplan. >> >> This works well, but how do I switch between streams? >> >> Someone correct me if I'm wrong, but from previous similar questions a >> few years ago it seems like once you've entered a MoH class, there is >> no exit. >> > > You can configure music classes with a DTMF digit that when pressed when > listening to music on hold will cause the channel to switch to the new > music class. > > From the musiconhold.conf sample file: > > ;digit=#; If this option is set for a class, then when callers ; > ; are > ; ; listening to music on hold, they can press this > ; ; digit, and > ; ; they will switch to listening to this music class. > > Cheers, > > -- > Joshua Colp > Digium, Inc. | Senior Software Developer > 445 Jan Davis Drive NW - Huntsville, AL 35806 - US > Check us out at: www.digium.com & www.asterisk.org > > > -- > _ > -- 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 > -- _ -- 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
Re: [asterisk-users] Switching between Music on Hold streams. [13.8.2]
u dial another context and then use the G option in the > dial string. So something like this. > > > > [radio-main] > > Exten => s,1,answer > > Exten => s,2,Background(play-menu) > > Exten => s,3,waitexten > > Exten => S,4,Goto(s,2) > > > > Exten => 1,1,Dial(Local/CNN@play-radio) > > Exten => 1,2,Goto(s,2) > > > > Exten => 2,1,Dial(Local/NPR@play-radio) > > Exten => 2,2,Goro(s,2) > > > > [play-radio] > > Exten => _[A-Z].,1,Answer > > Exten => _[A-Z].,2,Musiconhold(${EXTEN}) > > > > > > Regards, > > > > Dovid > > > > -Original Message- > > From: Jonathan H > > Sender: asterisk-users-bounces@lists.digium.comDate: Sun, 8 May 2016 > 11:36:42 > > To: Asterisk Users Mailing List - Non-Commercial Discussion< > asterisk-users@lists.digium.com> > > Reply-To: Asterisk Users Mailing List - Non-Commercial Discussion > > > > Subject: [asterisk-users] Switching between Music on Hold streams. > [13.8.2] > > > > I'd like multiple people to be able to dial in and listen to various > > live radio streams. > > > > I was told that the correct resource-friendly way would be to setup a > > MoH class, and then select that from the dialplan. > > > > This works well, but how do I switch between streams? > > > > Someone correct me if I'm wrong, but from previous similar questions a > > few years ago it seems like once you've entered a MoH class, there is > > no exit. > > > > But might there be some trick involved merged or bridged calls, or > > chan_spy or something, so that callers could quickly switch between 3 > > streams with a keypress? > > > > Thank you! > > > > -- > > _ > > -- 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 > > -- > > _ > > -- 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 > -- _ -- 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
Re: [asterisk-users] Switching between Music on Hold streams. [13.8.2]
Josh, He mentioned that he is building something for radio stations for people to listen into. They want to be able to select what they hear. I recently built a system where people could call and listen to rail road traffic. Using the g option in the dial string + # was the only way to let them select. On Mon, May 9, 2016 at 10:45 AM, Joshua Colp wrote: > Dovid Bender wrote: > >> Josh, >> >> As he is playing different streams I think he wants to give the users >> the option to select another stream. >> > > Each stream should be a separate music class, so switching between using > the DTMF feature would still work - unless I'm misunderstanding what is > trying to be achieved here. > > > -- > Joshua Colp > Digium, Inc. | Senior Software Developer > 445 Jan Davis Drive NW - Huntsville, AL 35806 - US > Check us out at: www.digium.com & www.asterisk.org > > -- > _ > -- 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 > -- _ -- 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
Re: [asterisk-users] Switching between Music on Hold streams. [13.8.2]
Dovid Bender wrote: Josh, He mentioned that he is building something for radio stations for people to listen into. They want to be able to select what they hear. I recently built a system where people could call and listen to rail road traffic. Using the g option in the dial string + # was the only way to let them select. Right, and since the subject of this thread is "Music on Hold streams" I assumed he was doing that through a music class for each stream. -- Joshua Colp Digium, Inc. | Senior Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - US Check us out at: www.digium.com & www.asterisk.org -- _ -- 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
Re: [asterisk-users] Switching between Music on Hold streams. [13.8.2]
Dovid Bender wrote: Josh, As he is playing different streams I think he wants to give the users the option to select another stream. Each stream should be a separate music class, so switching between using the DTMF feature would still work - unless I'm misunderstanding what is trying to be achieved here. -- Joshua Colp Digium, Inc. | Senior Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - US Check us out at: www.digium.com & www.asterisk.org -- _ -- 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
Re: [asterisk-users] Switching between Music on Hold streams. [13.8.2]
On Monday 09 May 2016, Jonathan H wrote: > . {stuff deleted} . > [streamdemo] > exten => s,1,Answer > exten => s,2,BackGround(menu) > exten => s,3,WaitExten > exten => s,4,Goto(s,2) > exten => > _[2,3,4,5],1,Dial(Local/${EXTEN}@play-radio,,G(play-radio^${EXTEN}^2)) > exten => _[2,3,4,5],2,Goto(s,2) You have an error in your dialplan! The pattern _[2,3,4,5] will match any of 2, a comma, 3, a comma (again), 4, a comma or 5. I think you might mean _[2345] which will match any of 2, 3, 4 or 5 (but not a comma), and contains no tautologies. -- AJS Note: Originating address only accepts e-mail from list! If replying off- list, change address to asterisk1list at earthshod dot co dot uk . -- _ -- 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
Re: [asterisk-users] Switching between Music on Hold streams. [13.8.2]
Thanks Joshua and everyone, Joshua's solution seems a lot simpler and works well. Only one thing now - The reason I named the classes as I did, was so that I could select the class based on callerID plus extension. Unless I've misread it, I'm limited to 9 switchable classes via the "digit=#" option, is that correct? Or is there a clever hack around this? extensions.conf [streamdemo] exten => s,1,Answer exten => s,2,BackGround(menu) exten => s,3,WaitExten exten => _[2,3,4,5],1,MusicOnHold(${CALLERID(name)}${EXTEN}) ;exten => s,5,Goto(s,2) exten => _[X,t,i],1,Goto(streamdemo,s,2) and in musiconhold.conf (4 is commented out as it's AAC and I've not figured that one out yet - bonus points to someone who can point the way!) [streamdemo2] mode=custom digit=2 application=/usr/bin/mpg123 -q -r 8000 -f 32768 --mono -s http://185.14.85.162:8020 [streamdemo3] mode=custom digit=3 application=/usr/bin/mpg123 -q -r 8000 -f 32768 --mono -s http://stream.acbradio.org:8000/mainstream.mp3 ;[streamdemo4] ;mode=custom ;digit=4 ;application=/usr/bin/mpg123 -q -r 8000 -f 32768 --mono -s http://199.180.75.27:80/ ;http://www.mushroomfm.com/media/listen.pls [streamdemo5] digit=5 mode=custom application=/usr/bin/mpg123 -q -r 8000 -f 32768 --mono -s http://206.225.87.121:8000/ On 9 May 2016 at 18:00, A J Stiles wrote: > On Monday 09 May 2016, Jonathan H wrote: >> . {stuff deleted} . >> [streamdemo] >> exten => s,1,Answer >> exten => s,2,BackGround(menu) >> exten => s,3,WaitExten >> exten => s,4,Goto(s,2) >> exten => >> _[2,3,4,5],1,Dial(Local/${EXTEN}@play-radio,,G(play-radio^${EXTEN}^2)) >> exten => _[2,3,4,5],2,Goto(s,2) > > You have an error in your dialplan! The pattern _[2,3,4,5] will match any of > 2, a comma, 3, a comma (again), 4, a comma or 5. > > I think you might mean _[2345] which will match any of 2, 3, 4 or 5 (but > not a comma), and contains no tautologies. > > > -- > AJS > > Note: Originating address only accepts e-mail from list! If replying off- > list, change address to asterisk1list at earthshod dot co dot uk . > > -- > _ > -- 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 -- _ -- 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
Re: [asterisk-users] Switching between Music on Hold streams. [13.8.2]
Jonathan H wrote: Thanks Joshua and everyone, Joshua's solution seems a lot simpler and works well. Only one thing now - The reason I named the classes as I did, was so that I could select the class based on callerID plus extension. Unless I've misread it, I'm limited to 9 switchable classes via the "digit=#" option, is that correct? That's correct I'm afraid. If you need even more, then without modifying the code that option won't work for you. Cheers, -- Joshua Colp Digium, Inc. | Senior Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - US Check us out at: www.digium.com & www.asterisk.org -- _ -- 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
Re: [asterisk-users] Switching between Music on Hold streams. [13.8.2]
Thanks Joshua, I realise mine is a bit of a niche case, so I certainly don't expect to be catered for "out of the box" as it were, but is there some way Dovid's solution could be wrangled into doing what I require then? Dovid mentions this (lower case!) g option, but call me thick, but I'm not sure how it's supposed to work. I'm not being lazy here, but I really just can't figure it out! I've tried a few other things, but it really doesn't seem like the second channel can "hear" or respond to the DTMF tones. It doesn't have to be an elegant solution, any fudge will do! It did just occur to me that I could use this option I just noticed: "H - Allow the calling party to hang up by sending the DTMF sequence defined for disconnect in features.conf." Will that hang up the whole call, or just the extension which was dialled by the Dial(PJSIP/...) application? Does that make sense? (It's getting late here!). Thanks! On 9 May 2016 at 18:22, Joshua Colp wrote: > Jonathan H wrote: >> >> Thanks Joshua and everyone, >> >> Joshua's solution seems a lot simpler and works well. Only one thing >> now - The reason I named the classes as I did, was so that I could >> select the class based on callerID plus extension. >> >> Unless I've misread it, I'm limited to 9 switchable classes via the >> "digit=#" option, is that correct? > > > That's correct I'm afraid. If you need even more, then without modifying the > code that option won't work for you. > > Cheers, > > -- > Joshua Colp > Digium, Inc. | Senior Software Developer > 445 Jan Davis Drive NW - Huntsville, AL 35806 - US > Check us out at: www.digium.com & www.asterisk.org > > -- > _ > -- 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 -- _ -- 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
Re: [asterisk-users] Switching between Music on Hold streams. [13.8.2]
Jonathan H wrote: Thanks Joshua, I realise mine is a bit of a niche case, so I certainly don't expect to be catered for "out of the box" as it were, but is there some way Dovid's solution could be wrangled into doing what I require then? Dovid mentions this (lower case!) g option, but call me thick, but I'm not sure how it's supposed to work. I'm not being lazy here, but I really just can't figure it out! I've tried a few other things, but it really doesn't seem like the second channel can "hear" or respond to the DTMF tones. It doesn't have to be an elegant solution, any fudge will do! It did just occur to me that I could use this option I just noticed: "H - Allow the calling party to hang up by sending the DTMF sequence defined for disconnect in features.conf." Will that hang up the whole call, or just the extension which was dialled by the Dial(PJSIP/...) application? Does that make sense? (It's getting late here!). You could try using H and g together as you've mentioned... I'm not sure if it would actually hang up the calling party or not... Otherwise I don't have any ideas, stuff wasn't written or designed for this use case even when fudged together. -- Joshua Colp Digium, Inc. | Senior Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - US Check us out at: www.digium.com & www.asterisk.org -- _ -- 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
Re: [asterisk-users] Switching between Music on Hold streams. [13.8.2]
On Mon, 9 May 2016, Jonathan H wrote: I realise mine is a bit of a niche case... Have you looked at the externalivr() application? -- Thanks in advance, - Steve Edwards sedwa...@sedwards.com Voice: +1-760-468-3867 PST https://www.linkedin.com/in/steve-edwards-4244281 -- _ -- 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
Re: [asterisk-users] Switching between Music on Hold streams. [13.8.2]
If you ever figure out AAC in Asterisk for MOH let me know. The ones that I have working is MP3 and MMS. On Mon, May 9, 2016 at 1:18 PM, Jonathan H wrote: > Thanks Joshua and everyone, > > Joshua's solution seems a lot simpler and works well. Only one thing > now - The reason I named the classes as I did, was so that I could > select the class based on callerID plus extension. > > Unless I've misread it, I'm limited to 9 switchable classes via the > "digit=#" option, is that correct? > > Or is there a clever hack around this? > > extensions.conf > > [streamdemo] > exten => s,1,Answer > exten => s,2,BackGround(menu) > exten => s,3,WaitExten > exten => _[2,3,4,5],1,MusicOnHold(${CALLERID(name)}${EXTEN}) > ;exten => s,5,Goto(s,2) > exten => _[X,t,i],1,Goto(streamdemo,s,2) > > and in musiconhold.conf (4 is commented out as it's AAC and I've not > figured that one out yet - bonus points to someone who can point the > way!) > > [streamdemo2] > mode=custom > digit=2 > application=/usr/bin/mpg123 -q -r 8000 -f 32768 --mono -s > http://185.14.85.162:8020 > > [streamdemo3] > mode=custom > digit=3 > application=/usr/bin/mpg123 -q -r 8000 -f 32768 --mono -s > http://stream.acbradio.org:8000/mainstream.mp3 > > ;[streamdemo4] > ;mode=custom > ;digit=4 > ;application=/usr/bin/mpg123 -q -r 8000 -f 32768 --mono -s > http://199.180.75.27:80/ > ;http://www.mushroomfm.com/media/listen.pls > > [streamdemo5] > digit=5 > mode=custom > application=/usr/bin/mpg123 -q -r 8000 -f 32768 --mono -s > http://206.225.87.121:8000/ > > On 9 May 2016 at 18:00, A J Stiles wrote: > > On Monday 09 May 2016, Jonathan H wrote: > >> . {stuff deleted} . > >> [streamdemo] > >> exten => s,1,Answer > >> exten => s,2,BackGround(menu) > >> exten => s,3,WaitExten > >> exten => s,4,Goto(s,2) > >> exten => > >> _[2,3,4,5],1,Dial(Local/${EXTEN}@play-radio,,G(play-radio^${EXTEN}^2)) > >> exten => _[2,3,4,5],2,Goto(s,2) > > > > You have an error in your dialplan! The pattern _[2,3,4,5] will match > any of > > 2, a comma, 3, a comma (again), 4, a comma or 5. > > > > I think you might mean _[2345] which will match any of 2, 3, 4 or 5 > (but > > not a comma), and contains no tautologies. > > > > > > -- > > AJS > > > > Note: Originating address only accepts e-mail from list! If replying > off- > > list, change address to asterisk1list at earthshod dot co dot uk . > > > > -- > > _ > > -- 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 > > -- > _ > -- 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 > -- _ -- 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
Re: [asterisk-users] Switching between Music on Hold streams. [13.8.2]
Hello! I thought having finally "cracked it", I might as well post what I've done. https://github.com/lardconcepts/asterisk-digitalocean-voipfone-config/blob/master/moh-switching.md Can someone please take a quick look and see if there's anything I could have done better or more efficiently, or if anything stands out as particularly horrific? Basically, it uses an app called crudini to add sections to musiconhold.conf, then does an moh reload. When the user has finished listening and presses * then the remote extension is dropped and the caller returns to the current menu. The nice thing about this is that even if two callers call and listen to the same moh stream, when one hangs up, even though it deletes the config and reloads moh, Asterisk is nice to the other caller and they keep listening. The end result is what I wanted, which is to not have any extra CPU load or network usage when no-one is listening. And if more than one person is listening, it's still only "using" one remote stream, as I've uncommented the cachertclasses value. [general] cachertclasses=yes ; use 1 instance of moh class for all users who are using it As a little bonus, I've put what I think is a clever little "menu maker" in, which grabs and caches short audio files using the free plan from voicerss.org. If anyone wants to try it in practice, call UK +44 20 36 37 60 70 - this number is working as of the 12th of August and I'll leave it up at least over the weekend, but if you're reading this in a few weeks, don't expect it to work! (I'm allowed to use these streams before anyone panics!). On 11 May 2016 at 11:09, Dovid Bender wrote: > If you ever figure out AAC in Asterisk for MOH let me know. The ones that > I have working is MP3 and MMS. > > On Mon, May 9, 2016 at 1:18 PM, Jonathan H wrote: > >> Thanks Joshua and everyone, >> >> Joshua's solution seems a lot simpler and works well. Only one thing >> now - The reason I named the classes as I did, was so that I could >> select the class based on callerID plus extension. >> >> Unless I've misread it, I'm limited to 9 switchable classes via the >> "digit=#" option, is that correct? >> >> Or is there a clever hack around this? >> >> extensions.conf >> >> [streamdemo] >> exten => s,1,Answer >> exten => s,2,BackGround(menu) >> exten => s,3,WaitExten >> exten => _[2,3,4,5],1,MusicOnHold(${CALLERID(name)}${EXTEN}) >> ;exten => s,5,Goto(s,2) >> exten => _[X,t,i],1,Goto(streamdemo,s,2) >> >> and in musiconhold.conf (4 is commented out as it's AAC and I've not >> figured that one out yet - bonus points to someone who can point the >> way!) >> >> [streamdemo2] >> mode=custom >> digit=2 >> application=/usr/bin/mpg123 -q -r 8000 -f 32768 --mono -s >> http://185.14.85.162:8020 >> >> [streamdemo3] >> mode=custom >> digit=3 >> application=/usr/bin/mpg123 -q -r 8000 -f 32768 --mono -s >> http://stream.acbradio.org:8000/mainstream.mp3 >> >> ;[streamdemo4] >> ;mode=custom >> ;digit=4 >> ;application=/usr/bin/mpg123 -q -r 8000 -f 32768 --mono -s >> http://199.180.75.27:80/ >> ;http://www.mushroomfm.com/media/listen.pls >> >> [streamdemo5] >> digit=5 >> mode=custom >> application=/usr/bin/mpg123 -q -r 8000 -f 32768 --mono -s >> http://206.225.87.121:8000/ >> >> On 9 May 2016 at 18:00, A J Stiles wrote: >> > On Monday 09 May 2016, Jonathan H wrote: >> >> . {stuff deleted} . >> >> [streamdemo] >> >> exten => s,1,Answer >> >> exten => s,2,BackGround(menu) >> >> exten => s,3,WaitExten >> >> exten => s,4,Goto(s,2) >> >> exten => >> >> _[2,3,4,5],1,Dial(Local/${EXTEN}@play-radio,,G(play-radio^${EXTEN}^2)) >> >> exten => _[2,3,4,5],2,Goto(s,2) >> > >> > You have an error in your dialplan! The pattern _[2,3,4,5] will match >> any of >> > 2, a comma, 3, a comma (again), 4, a comma or 5. >> > >> > I think you might mean _[2345] which will match any of 2, 3, 4 or 5 >> (but >> > not a comma), and contains no tautologies. >> > >> > >> > -- >> > AJS >> > >> > Note: Originating address only accepts e-mail from list! If replying >> off- >> > list, change address to asterisk1list at earthshod dot co dot uk . >> > >> > -- >> > _ >> > -- 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 >> >> -- >> _ >> -- 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 >> > > > -- >