On Wed, 2011-02-09 at 14:37 -0800, Ernie Dunbar wrote: > > On Wed, 9 Feb 2011, Ernie Dunbar wrote: > > > >>> We have a customer who wants to forward an extension to their cell > >>> phone, if and only if that extension is "unavailable", or when the > >>> Dial() command times out. However, should the Dial() command return > >>> "busy" it should go to voicemail instead. > > > > On Wed, 9 Feb 2011, Danny Nicholas wrote: > > > >>> Perhaps your "googling" skills need some management - look for S-BUSY, > >>> S-NOANSWER. > > > >>> Here's a snippet that might do what they want > >>> - exten => s,1,Dial(DAHDI/1/5551212,30) > >>> - exten => s,n-BUSY,voicemail(blah) > >>> - exten => s,n-UNAVAILABLE,Dial(DAHDI/1/5552323,30) > >>> - exten => t,1,Dial(DAHDI/1/5552323,30) Cell > > > > On Wed, 9 Feb 2011, Ernie Dunbar wrote: > > > >> It's nice to know that you've tried this and are presenting me with a > >> proven solution. > >> > >> FYI, this doesn't work. Neither do any of the following variations: > > > > Off the top of his head, Danny put you into the 'ballpark,' a little bit > > more googling on your part would have brought you home. > > No, actually I got lots of examples of very, very complicated dialplans > that were about as clear as mud. But your example was much more helpful, > if incomplete. > > The final answer (should someone else try to Google this problem) was a > dialplan like this: > > > exten => 27,1,Dial(SIP/foo,10) > exten => 27,n,Goto(ernie,s-${DIALSTATUS},1) > exten => 27,n,Hangup() > > Which would require a separate context like this: > > [ernie] > > exten => s-BUSY,1,Voicemail(27,u) > exten => s-NOANSWER,1,Dial(DAHDI/g1/5551234) > > ;; End of context > > Of course, each person who wants to do this kind of thing would require a > whole new context just for their forwarding. All of the previous Google > results I found were for far more generic uses of the s-BUSY and > s-NOANSWER extensions, like operator messages for such results. > You do not need a separate context for each extension but you will need to keep the forward number somewhere like the internal asterisk database so you can do a lookup. Or you could use the Asterisk followme functionality for this. To simplify your example:
exten => 27,1,Dial(SIP/foo,10) exten => 27,n,Goto(${DIALSTATUS}) exten => 27,n,Hangup() exten => 27,n(BUSY),Voicemail(${EXTEN},u) exten => 27,n,Hangup() exten => 27,n(NOANSWER),Followme(${EXTEN}) exten => 27,n,Hangup() -- Telecomunicaciones Abiertas de México S.A. de C.V. Carlos Chávez Prats Director de Tecnología +52-55-91169161 ext 2001
signature.asc
Description: This is a digitally signed message part
-- _____________________________________________________________________ -- 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