Jui
2005-Feb-11 10:48 UTC
[Asterisk-Users] Setting a "Forward" to an external number on your phone
Hi! Maybe I have just been looking on the wrong pages but there is a question that is very important for me. I already studied some Demo-Dialplans and made some basic experiences with Asterisk. But what I need to find out is how I can handle this. I am leaving my office and I want to tell asterisk to forward calls now to my mobile phone by just hitting a key (on my IP-Phone) or by using a special key-sequence. How can this be handled because I need to change the dialplan based on some information coming from a device attached to a channel. When back in my office I hit the key again and the calls are now routed to my IP-Phone (or ISDN-Phone on zap-channel) again. With IP-Phones I can imagine just unregistering the phone and having a dialplan with a fallback-option or something like that. But what if I want to tell asterisk to forward calls from now on to a number I want to manually add just for today (hitting a key, entering the new target number and that's it). where can I find some information on how to make this feature available. Jui
Shaun Ewing
2005-Feb-11 15:05 UTC
[Asterisk-Users] Setting a "Forward" to an external number on your phone
On Fri, 11 Feb 2005 18:48:14 +0100, Jui <jui.nntp@gmx.info> wrote:> Hi!<snip>> I am leaving my office and I want to tell asterisk to forward calls now > to my mobile phone by just hitting a key (on my IP-Phone) or by using a > special key-sequence. >What type phones are you using? I know that with the Cisco 7940 and 7960 phones that we use, one can just hit the "CFwdAll' softkey, enter a number (eg: mobile, or another extension) and press accept. To cancel call forwarding, just press CFwdAll again. Pretty simple. Caveat: This method will occupy two lines whenever a call is forwarded. If you use an analogue interface, it's also possible that the lines will be tied up "forever" because if they don't know the caller has hung up. The latter isn't an issue with ISDN though (which we use). -Shaun
Rich Adamson
2005-Feb-11 16:23 UTC
[Asterisk-Users] Setting a "Forward" to an external number on your phone
> Maybe I have just been looking on the wrong pages but there is a > question that is very important for me. I already studied some > Demo-Dialplans and made some basic experiences with Asterisk. But what I > need to find out is how I can handle this. > > I am leaving my office and I want to tell asterisk to forward calls now > to my mobile phone by just hitting a key (on my IP-Phone) or by using a > special key-sequence. > > How can this be handled because I need to change the dialplan based on > some information coming from a device attached to a channel. > When back in my office I hit the key again and the calls are now routed > to my IP-Phone (or ISDN-Phone on zap-channel) again. > > With IP-Phones I can imagine just unregistering the phone and having a > dialplan with a fallback-option or something like that. But what if I > want to tell asterisk to forward calls from now on to a number I want to > manually add just for today (hitting a key, entering the new target > number and that's it). where can I find some information on how to make > this feature available.Here's one way to do that... (the example below was being used to activate/deact the ivr on our system): ; toggle the ivr by dialing this extension exten => 3950,1,DBget(ISIVRON=FEAT/ivron) ; if success, step 2, else 102 exten => 3950,2,GotoIf(${ISIVRON} == yes?3:102) exten => 3950,3,DBdel(FEAT/ivron) exten => 3950,4,Background(npi-ivroff) exten => 3950,5,Hangup exten => 3950,102,DBput(FEAT/ivron=yes) exten => 3950,103,Background(npi-ivron) exten => 3950,104,Hangup On whatever sip phone your using, program a key to autodial 3950. First time activates it, the second call deacts it. If you can't program a key, then just dial 3950. (I have a softkey on my Cisco 7960 defined to do that.) Then in your the dialplan entry for your exten, just insert the necessary DBget and check its value. If 'yes', send the call to your cell phone. If no, ring your extension. If you forget to start the call forwarding before leaving the office, then use whatever pstn facility you have to dial x3950 to activate it remotely. Rich
Star User
2005-Feb-12 19:49 UTC
[Asterisk-Users] Setting a "Forward" to an external number on your phone
If you want to set up call forwarding in a device independent way, see http://lists.digium.com/pipermail/asterisk-users/2003-July/016872.html Unfortunately, if you get Asterisk to do the forwarding, there is no way to tell just by looking at the phone that your calls are forwarded. If you use an IP phone like Cisco, Polycom or Snom, you can use the phone's built-in Call Forwarding button, and you can tell by looking at the phone whether the calls are forwarded or not. Rana Dutt
Jim Van Meggelen
2005-Feb-15 09:16 UTC
[Asterisk-Users] Setting a "Forward" to an external number on yourphone
asterisk-users-bounces@lists.digium.com wrote:> Hi! > > Maybe I have just been looking on the wrong pages but there is a > question that is very important for me. I already studied some > Demo-Dialplans and made some basic experiences with Asterisk. > But what I > need to find out is how I can handle this. > > I am leaving my office and I want to tell asterisk to forward > calls now > to my mobile phone by just hitting a key (on my IP-Phone) or > by using a > special key-sequence. > > How can this be handled because I need to change the dialplan > based on > some information coming from a device attached to a channel. > When back in my office I hit the key again and the calls are > now routed > to my IP-Phone (or ISDN-Phone on zap-channel) again. > > With IP-Phones I can imagine just unregistering the phone and > having a > dialplan with a fallback-option or something like that. But what if I > want to tell asterisk to forward calls from now on to a > number I want to > manually add just for today (hitting a key, entering the new target > number and that's it). where can I find some information on > how to make > this feature available.There's probably a whole lot of ways this could be achieved. It's kind of a cookbook type thing: more than one recipe. What I've been working on is a way to change where "zero-out" or main menu timeouts. I want to be able to do this while on the road or in the office, so I built it into the dial plan. All the authentication issues aside, I need to set a variable that defines where I want calls to go. Additionally, I want the state of this variable to survive a restart. What I've been messing with is using a file-based semaphores to do this. Perhaps it's kludgy, but it works. Also, there's no database work required: it all happens in the dialplan. There's a lot more work needed here - I just hacked this together. Works pretty well though, it's just not very friendly. I wouldn't intall this at a customer without some more work, but mostly because I'd want it a bit more friendly. Anyhow, I have not tested this exact one, but it's similar to what I've got so far. Enjoy: [global] MyCell=18005551212 Reception = SIP/YourPhone ; These are your semaphores. Because they are files they will survive a restart #include /var/lib/asterisk/remote_context #include /var/lib/asterisk/remote_exten [incoming] ; somewhere you'll need to put the exten that sends you to [presence] ; Make sure this is secure, but you'll probably want to be able to ; access it extenally exten => 4321,1,Goto(presence,s,1) [local_sets] exten => 1000,1,Macro(exec_set,${EXTEN},${Reception}) [remote_sets] exten => 2000,1,Macro(cell_user,${MyCell}) [presence] ;just record a basic prompt so you know what's up exten => s,1,SayDigits(${ATDT_EXTEN}) ; raw, but it'll tell you where it's going exten => s,2,Background(prompt_for_choice) ;;;;this sets calls to go to one place ; first we write the semaphore exten => 1,1,System(echo ATDT_CONTEXT=remote_sets > /var/lib/remote_context) ;then we set the value of the variable exten => 1,2,SetGlobalVar(ATDT_CONTEXT=remote_sets) exten => 1,3,System(echo ATDT_EXTEN=2000 > /var/lib/remote_exten) exten => 1,4,SetGlobalVar(ATDT_EXTEN=2000) exten => 1,5,Goto(presence,s,1) ;;;;this sets calls to go to somewhere else exten => 2,1,System(echo ATDT_CONTEXT=local_sets > /var/lib/remote_context) exten => 2,2,SetGlobalVar(ATDT_CONTEXT=local_sets) exten => 2,3,System(echo ATDT_EXTEN=1000 > /var/lib/remote_exten) exten => 2,4,SetGlobalVar(ATDT_EXTEN=1000) exten => 2,5,Goto(presence,s,1) ;;;;you can have as many of these as you need exten => 3,1,System(echo ATDT_CONTEXT=[some_context] > /var/lib/remote_context) exten => 3,2,SetGlobalVar(ATDT_CONTEXT=[some_context]) exten => 3,3,System(echo ATDT_EXTEN=[some_exten] > /var/lib/remote_exten) exten => 3,4,SetGlobalVar(ATDT_EXTEN=[some_exten]) exten => 3,5,Goto(presence,s,1) [cleanup] ; hang up the call and whatever else exten => s,1,Playback(goodbye) exten => s,2,Hangup() ;;; MACROS ;;; [macro-exec_set] exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER) exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain [macro-cell_user] ; This will only work if your external line supports link transfer exten => s,1,Playback(transfer) exten => s,2,Flash() exten => s,3,SendDTMF(${ARG1}) exten => s,4,Hangup() -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 14/02/2005