Prevent Outgoing calls after working Hours

General discussions about Asterisk.

Moderators: Moderator, Support

Prevent Outgoing calls after working Hours

Postby vijaymuddu » Wed Nov 04, 2015 8:48 am

Hi

How can i block outgoing calls after working hours

Thanks,
Vijay
vijaymuddu
Newsterisk
 
Posts: 11
Joined: Fri Mar 07, 2014 11:48 pm

Re: Prevent Outgoing calls after working Hours

Postby vijaymuddu » Wed Nov 04, 2015 9:26 am

Sample dial plan found
[time-rules]
exten => _XXXX.,1,GotoIfTime(8:30-18:45|sun-thu|*|*?from-internal,${EXTEN},1)
exten => _XXXX.,n,Playback(prepaid-auth-fail)


My current dial plan
exten => _880010.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _880010.,2,Dial(dahdi/g0/0${EXTEN:-10},60,tTo)
exten => _880010.,3,Hangup

Can any body guide me to implement timing in my outgoing dial plan

Thanks
Vijay Muddu
vijaymuddu
Newsterisk
 
Posts: 11
Joined: Fri Mar 07, 2014 11:48 pm

Re: Prevent Outgoing calls after working Hours

Postby ambiorixg12 » Wed Nov 04, 2015 5:59 pm

Use GotoIfTime() before Dial()

If you are stuck on how to use it, here there is a guide.

http://www.asteriskdocs.org/en/2nd_Edit ... -B-91.html
ambiorixg12
Astmaster
 
Posts: 967
Joined: Sun Mar 04, 2007 9:32 pm
Location: Dominican Republic

Re: Prevent Outgoing calls after working Hours

Postby vijaymuddu » Wed Nov 04, 2015 8:54 pm

Hi Ambi,

Thanks for your response

I am confused on the dial plan can you please correct by below dial plan
working hours are from 10.am to 8.30 pm


My current dial plan

exten => _880010.,1,GotoIfTime(10:00-20:30,mon-sat,*,*?open,s,1)
exten => _880010.,2,AGI(agi://127.0.0.1:4577/call_log)
exten => _880010.,3,Dial(dahdi/g0/0${EXTEN:-10},60,tTo)
exten => _880010.,4,Hangup


Thanks,
Vijay
vijaymuddu
Newsterisk
 
Posts: 11
Joined: Fri Mar 07, 2014 11:48 pm

Re: Prevent Outgoing calls after working Hours

Postby ambiorixg12 » Wed Nov 04, 2015 9:52 pm

Use labels.


GotoIfTime(<time range>,<days of week>,<days of month>,<months>?[labeliftrue][:labeliffalse])

a working example

exten => _880010.,1,GotoIfTime(10:00-20:30,mon-sat,*,*?allow:disallow)
same=>n(allow),AGI(agi://127.0.0.1:4577/call_log)
same=>n,Dial(dahdi/g0/0${EXTEN:-10},60,tTo)
same=>n,Hangup()
same=>n(disallow),Playback(im-sorry)
same=>n,hangup()
ambiorixg12
Astmaster
 
Posts: 967
Joined: Sun Mar 04, 2007 9:32 pm
Location: Dominican Republic


Return to Asterisk General

Who is online

Users browsing this forum: No registered users and 1 guest