Time conditions

From Gerardo Barajas, 1 Year ago, written in Plain Text, viewed 58 times.
URL https://pastebin.freepbx.org/view/6e421ddf Embed
Download Paste or View Raw
  1. [timeconditions]
  2. include => timeconditions-custom
  3. exten => 1,1,Set(DB(TC/1/INUSESTATE)=INUSE)
  4. exten => 1,n,Set(DB(TC/1/NOT_INUSESTATE)=NOT_INUSE)
  5. exten => 1,n,GotoIfTime(*,*,23-24,nov,America/Chicago?truestate)
  6. exten => 1,n,GotoIfTime(*,*,25,dec,America/Chicago?truestate)
  7. exten => 1,n,GotoIfTime(*,*,27-29,may,America/Chicago?truestate)
  8. exten => 1,n,GotoIfTime(*,*,2,jan,America/Chicago?truestate)
  9. exten => 1,n,GotoIfTime(*,*,4,jul,America/Chicago?truestate)
  10. exten => 1,n,GotoIfTime(*,*,4,sep,America/Chicago?truestate)
  11. exten => 1,n,GotoIfTime(17:00-00:00,*,24-28,feb,America/Chicago?truestate)
  12. exten => 1,n,GotoIfTime(*,*,14,apr,America/Chicago?truestate)
  13. exten => 1,n(falsestate),GotoIf($["${DB(TC/1):0:4}" = "true"]?truegoto)
  14. exten => 1,n,ExecIf($["${DB(TC/1)}" = "false"]?Set(DB(TC/1)=))
  15. exten => 1,n(falsegoto),Set(DEVICE_STATE(Custom:TC1)=INUSE)
  16. exten => 1,n,ExecIf($["${DB(TC/1)}" = "false_sticky"]?Set(DEVICE_STATE(Custom:TCSTICKY${ARG1})=INUSE))
  17. exten => 1,n,GotoIf($["${TCRETURN}"!="RETURN"]?timeconditions,2,1)
  18. exten => 1,n,Set(TCSTATE=false)
  19. exten => 1,n,Set(TCOVERRIDE=${IF($["${DB(TC/1):0:5}" = "false"]?true:false)})
  20. exten => 1,n,Return()
  21. exten => 1,n(truestate),GotoIf($["${DB(TC/1):0:5}" = "false"]?falsegoto)
  22. exten => 1,n,ExecIf($["${DB(TC/1)}" = "true"]?Set(DB(TC/1)=))
  23. exten => 1,n(truegoto),Set(DEVICE_STATE(Custom:TC1)=NOT_INUSE)
  24. exten => 1,n,ExecIf($["${DB(TC/1)}" = "true_sticky"]?Set(DEVICE_STATE(Custom:TCSTICKY${ARG1})=INUSE))
  25. exten => 1,n,GotoIf($["${TCRETURN}"!="RETURN"]?ext-group,600,1)
  26. exten => 1,n,Set(TCSTATE=true)
  27. exten => 1,n,Set(TCOVERRIDE=${IF($["${DB(TC/1):0:4}" = "true"]?true:false)})
  28. exten => 1,n,Return()
  29.  
  30. exten => 2,1,Set(DB(TC/2/INUSESTATE)=INUSE)
  31. exten => 2,n,Set(DB(TC/2/NOT_INUSESTATE)=NOT_INUSE)
  32. exten => 2,n,GotoIfTime(08:05-17:00,mon-fri,*,*,America/Chicago?truestate)
  33. exten => 2,n(falsestate),GotoIf($["${DB(TC/2):0:4}" = "true"]?truegoto)
  34. exten => 2,n,ExecIf($["${DB(TC/2)}" = "false"]?Set(DB(TC/2)=))
  35. exten => 2,n(falsegoto),Set(DEVICE_STATE(Custom:TC2)=INUSE)
  36. exten => 2,n,ExecIf($["${DB(TC/2)}" = "false_sticky"]?Set(DEVICE_STATE(Custom:TCSTICKY${ARG1})=INUSE))
  37. exten => 2,n,GotoIf($["${TCRETURN}"!="RETURN"]?ext-group,600,1)
  38. exten => 2,n,Set(TCSTATE=false)
  39. exten => 2,n,Set(TCOVERRIDE=${IF($["${DB(TC/2):0:5}" = "false"]?true:false)})
  40. exten => 2,n,Return()
  41. exten => 2,n(truestate),GotoIf($["${DB(TC/2):0:5}" = "false"]?falsegoto)
  42. exten => 2,n,ExecIf($["${DB(TC/2)}" = "true"]?Set(DB(TC/2)=))
  43. exten => 2,n(truegoto),Set(DEVICE_STATE(Custom:TC2)=NOT_INUSE)
  44. exten => 2,n,ExecIf($["${DB(TC/2)}" = "true_sticky"]?Set(DEVICE_STATE(Custom:TCSTICKY${ARG1})=INUSE))
  45. exten => 2,n,GotoIf($["${TCRETURN}"!="RETURN"]?ivr-5,s,1)
  46. exten => 2,n,Set(TCSTATE=true)
  47. exten => 2,n,Set(TCOVERRIDE=${IF($["${DB(TC/2):0:4}" = "true"]?true:false)})
  48. exten => 2,n,Return()
  49.  
  50. ;--== end of [timeconditions] ==--;
  51.  

Reply to "Time conditions"

Here you can reply to the paste above