Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] day night service toggle


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
support at controloye.com
Guest





PostPosted: Thu Nov 27, 2014 4:48 pm    Post subject: [asterisk-users] day night service toggle Reply with quote

Hi, I need dialplan to set INCOMING call forwarding during lunch break to my secretary. I want that I can set call forwarding by dialing an extension number to turn it ON or OFF. I am using asterisk 11. Thanks Abdullah Faheem
Back to top
jb_soft at trink.co.uk
Guest





PostPosted: Fri Nov 28, 2014 6:53 am    Post subject: [asterisk-users] day night service toggle Reply with quote

Hello Control,

On Thursday, November 27, 2014, 9:48:30 PM, you wrote:

Quote:
I need dialplan to set INCOMING call forwarding during lunch break to my secretary.

I want that I can set call forwarding by dialing an extension number to turn it ON or OFF.

There are probably lots of ways to do this, and it would be worth
checking to see whether your handset can be programmed to do the
forwarding, which is simpler than setting up a dialplan to handle it.

I pass incoming calls to a mobile phone based on a toggle. There are
three parts to this:

[1] I have a Global Variable (MDIVERT) that holds the current Divert status.
[2] I have an extension (*70) that toggles the value of the Global variable
[3] I have a GotoIf in my incoming call handler that selects different
dial strings depending on whether the is set or not.

I added a two voice prompts to announce the status of MDIVERT.
Dialling *70 the first time sets the variable and dialling *70 again
unsets it.

[1] Create the Global Variable

[globals]
MDIVERT=0

[2] Toggle the variable.

exten => *70,1,Set(GLOBAL(MDIVERT)=${IF($[ ${MDIVERT} = 1]?0:1)})
exten => *70,n,GotoIf($[ $[ "${MDIVERT}" = "0" ] ]?notset)
exten => *70,n,playback(divertactive)
exten => *70,n,Hangup()
exten => *70,n(notset),playback(divertinactive)
exten => *70,n,Hangup()

[3] GotoIf in call handler

exten => 100,1,GotoIf($["${MDIVERT}" = "1"]?divert) ; check variable
exten => 100,n,Dial(SIP/ManagerPhone,30,ctkx) ;Call your phone
exten => 100,n,Hangup()
exten => 100,n(divert),Dial(SecretaryPhone,30,ctkx) ; call Secretary
exten => 100,n,Hangup()

I have cut out a lot from the dialplan to give you an idea, but I am
sure that others will chip in with their ideas and point out the
failings in my approach Smile

J


--
Best regards,
Julian mailto:jb_soft@trink.co.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
Back to top
asterisk_list at earth...
Guest





PostPosted: Fri Nov 28, 2014 7:40 am    Post subject: [asterisk-users] day night service toggle Reply with quote

On Thursday 27 Nov 2014, Control Oye wrote:
Quote:
Hi,

I need dialplan to set INCOMING call forwarding during lunch break to my
secretary.

I want that I can set call forwarding by dialing an extension number to
turn it ON or OFF.

I am using asterisk 11.

What you need to do is, set a global variable from within your dialplan, to
indicate whether you are at your desk (meaning calls to your number should go
to your phone) or on lunch (meaning calls to your number should go somewhere
else).

And note that this really should be done by dialling separate numbers for "in"
and "out", because toggle actions are annoying as hell in practice -- it's
easier to remember two different numbers, than to remember what state you are
currently in.


If 101 is you and 102 is the person who fields your calls while you are on
lunch, you need something like this;

; extension 101
exten => 101,1,GotoIf($[${ON_LUNCH}] ? on_lunch : at_desk)
exten => 101,n(at_desk),Dial(SIP/101)
exten => 101,n,Hangup()
exten => 101,n(on_lunch),Dial(SIP/102)
exten => 101,n,Hangup()



; These extensions should be in some context which is only callable from 101

; extension 771 sets "on lunch"
exten => 771,1,Set(GLOBAL(ON_LUNCH)=1)
exten => 771,n,Playback(ajs-set_on_lunch)
exten => 771,n,Hangup()

; extension 770 sets "at desk"
exten => 770,1,Set(GLOBAL(ON_LUNCH)=)
exten => 770,n,Playback(ajs-set_at_desk)
exten => 770,n,Hangup()

--
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
Back to top
asterisk.org at sedwar...
Guest





PostPosted: Fri Nov 28, 2014 11:41 am    Post subject: [asterisk-users] day night service toggle Reply with quote

On Fri, 28 Nov 2014, A J Stiles wrote:

Quote:
And note that this really should be done by dialling separate numbers
for "in" and "out", because toggle actions are annoying as hell in
practice -- it's easier to remember two different numbers, than to
remember what state you are currently in.

According to NANPA's 'Vertical Service Codes, Code Definitions'
(http://www.nanpa.com/number_resource_info/vsc_definitions.html), *72 and
*73 are for call forwarding activation and deactivation (respectively).

Of course, the OP could use execiftime() instead and just make sure to go
to lunch and return at the exact same time every day. The dialplan coding
is easier and no pesky codes to remember.

--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards sedwards@sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000

--
_____________________________________________________________________
-- 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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services