N
N
Nikita Reshetnyak2019-03-07 12:15:52
Asterisk
Nikita Reshetnyak, 2019-03-07 12:15:52

How to properly configure ASTERISK inbound routing?

Good day!
There is such an entry
exten => _X.,1, GotoIfTime(8:00-20:00,mon-fri,*,*?ivr-main,s,1)
exten => _X.,n, GotoIfTime(8:00 -17:00,sat,*,*?ivr-main,s,1)
exten => _X.,n, GotoIfTime(10:00-15:00,sun,*,*?ivr-main,s,1 )
exten => _X.,n, Playback(nonworkinghours)
exten => _X.,n,Goto(autoanswer,s,1)
exten => _X.,n, HangUp()
Until a certain time it was fine, but a ringostat appeared, and I had to add the following lines
exten => sip_login2,1, GotoIfTime(8:00-20:00,mon-fri,*,*?ivr-main,s,1)
exten => sip_login2,n, GotoIfTime(8:00 -17:00,sat,*,*?ivr-main,s,1)
exten => sip_login2,n, GotoIfTime(10:00-15:00,sun,*,*?ivr-main,s,1)
The question is whether it is possible to somehow simplify so that everything is the same in 6 lines, or will it be necessary to add routing for each input with a non-digital number.
Thank you in advance

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2019-03-07
@trjflash

exten => _X.,1,Goto(incoming,s,1)

exten => sip_login2,1,Goto(incoming,s,1)

[incoming]
exten => s,1,GotoIfTime(8:00-20:00,mon-fri,*,*?ivr-main,s,1)
same => n,GotoIfTime(8:00-17:00,sat,*,*?ivr-main,s,1)
same => n,GotoIfTime(10:00-15:00,sun,*,*?ivr-main,s,1)
same => n,Playback(nonworkinghours)
same => n,Goto(autoanswer,s,1)

Hangup is not needed, because it is impossible to get on it.

S
Soslan Aldatov, 2019-03-07
@sptm

I think s extension will help you .
It will look something like this:

exten => s,1, GotoIfTime(8:00-20:00,mon-fri,*,*?ivr-main,s,1)
exten => s,n, GotoIfTime(8:00-17:00,sat,*,*?ivr-main,s,1)
exten => s,n, GotoIfTime(10:00-15:00,sun,*,*?ivr-main,s,1)
exten => s,n, Playback(nonworkinghours)
exten => s,n,Goto(autoanswer,s,1)
exten => s,n, HangUp()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question