On Thu, Dec 4, 2008 at 3:30 AM, Sebastian <[EMAIL PROTECTED]> wrote: > Do you thik theres no chance to do it directly from dialplan like if I use > PlayTones, and the call will follow to the next line on the dialplan? > I think that the best solution would be make a play musiconhold but not wait > indefinitely, something like StartMOHAsync and StopMOHAsync. > What do you think?
Yeah, it would be best, but i'm really not aware of anything like that. Perhaps app_jack in 1.6 could do something (but don't ask me how, i've just heard rumors of it). The hold/background stuff is not my field, i just spitted out ideas of "how i would solve it". I looked at available commands, and if you say MusicOnHold doesn't stop, you have to terminate it somehow. Regards, Atis > > Thanks for your solution. > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Atis Lezdins > Sent: miƩrcoles, 03 de diciembre de 2008 10:31 p.m. > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [asterisk-users] Parking calls > > On Thu, Dec 4, 2008 at 1:25 AM, Sebastian <[EMAIL PROTECTED]> wrote: >> I don't understand how can I solve my situation with this > > Ok, a simplified sample (i used PHP because i use it daily, but any > language is good): > > context incoming { > _X. => { > Answer(); > System(channel-waiting.php ${CHANNEL}); > MusicOnHold(); > } > } > > context continue { > _X. => { > // you reached your condition > Playback(tt-monkeys); > Dial(SIP/something); > } > } > > then a channel-waiting.php would store ${CHANNEL} name somewhere in > database. > > Then, assuming you can execute some code WHEN you change the database > value you wanted to monitor in loop, you launch a script that sends > AMI Redirect action. > > For example: > > <? > > $channel = 'SIP/123-abc'; // retrieved from DB where set by > channel-waiting.php > > require "phpagi-asmanager.php"; > $as = new AGI_AsteriskManager(); > > $res=$as->connect("localhost","username","password"); > if($res==FALSE) { > echo "Connection failed.\n"; > } > > $res=$as->send_request("Redirect", > array( > "Channel"=>$channel, > "Context"=>"continue", > "Exten"=>"123", > "Priority"=>"1" > ) > ); > > if($as->resp_is_success($res)){ > echo "it worked!"; > } > ?> > >> >> >> -----Original Message----- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf Of Atis Lezdins >> Sent: miƩrcoles, 03 de diciembre de 2008 03:48 p.m. >> To: Asterisk Users Mailing List - Non-Commercial Discussion >> Subject: Re: [asterisk-users] Parking calls >> >> On Wed, Dec 3, 2008 at 7:27 PM, Sebastian <[EMAIL PROTECTED]> wrote: >>> The thing is I have to wait checking a database value to change the > state, >>> that duration is not long, but on any case I don't know when will be > ready >>> to go on. >>> If I use MusicOnHold app the dialplan get stuck there and there's no >> further >>> movement on my dialplan lines. >>> I will have a while loop checking for a database value to change, if it >>> changes the call will go on through the dialplan depending on the result, >>> but I can't make the call wait without any sound (I thought PlayTones >> could >>> be a possibility but I prefere MOH). >>> For these reasons I can't use a shell script launched in background. >>> Is there any way to launch in background some app like Background but >> follow >>> with the next dialplan line while it plays the sound?? >>> (Just like Ringing does on my solution), I know making a local channel is >>> not the best solution, but at this moment I can't think on a different > one >>> that not involves agi. >>> >>> Any idea?? >>> >>> >> >> AMI action Redirect - >> http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+Redirect >> >> Of course you would need some script to send this action, but as long >> as you control writes to database it shouldn't be a problem. All you >> need is to store ${CHANNEL} name of current channel before entering >> MusicOnHold(). >> >> Also you could take a look at GROUP_COUNT function, perhaps it in some >> way can help you :) >> >> Regards, >> Atis >> >> >> >> >> >> >> -- >> Atis Lezdins, >> VoIP Project Manager / Developer, >> IQ Labs Inc, >> [EMAIL PROTECTED] >> Skype: atis.lezdins >> Cell Phone: +371 28806004 >> Cell Phone: +1 800 7300689 >> Work phone: +1 800 7502835 >> >> _______________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users >> >> __________ Information from ESET Smart Security, version of virus > signature >> database 3660 (20081203) __________ >> >> The message was checked by ESET Smart Security. >> >> http://www.eset.com >> >> >> >> >> __________ Information from ESET Smart Security, version of virus > signature >> database 3662 (20081203) __________ >> >> The message was checked by ESET Smart Security. >> >> http://www.eset.com >> >> >> >> _______________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users >> > > > > -- > Atis Lezdins, > VoIP Project Manager / Developer, > IQ Labs Inc, > [EMAIL PROTECTED] > Skype: atis.lezdins > Cell Phone: +371 28806004 > Cell Phone: +1 800 7300689 > Work phone: +1 800 7502835 > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > > __________ Information from ESET Smart Security, version of virus signature > database 3662 (20081203) __________ > > The message was checked by ESET Smart Security. > > http://www.eset.com > > > > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > -- Atis Lezdins, VoIP Project Manager / Developer, IQ Labs Inc, [EMAIL PROTECTED] Skype: atis.lezdins Cell Phone: +371 28806004 Cell Phone: +1 800 7300689 Work phone: +1 800 7502835 _______________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
