Answer the question
In order to leave comments, you need to log in
How to forward a call if one of the two subscribers is busy?
Good afternoon!
For several days now I can not solve the problem of how to forward a call if one of the two subscribers is busy.
There is a call: It is exten => s,1,Dial(DAHDI/g1/100&DAHDI/g1/101)
necessary to make it so that if at least one of these numbers is busy, the call goes to another context / extension.
I don't know how to solve. Please help!
Answer the question
In order to leave comments, you need to log in
Follow me - no?
And it didn’t take long to turn everything with handles for standard procedures, why not use the web muzzle, since you get into a stupor on such trifles?
Try like this:
exten => s,1,NoOp(IF Busy (100 OR 101) Goto)
same => n,NoOp(STATE 100: ${DEVICE_STATE(DAHDI/g1/100)})
same => n,GotoIf($[ ${REGEX("INUSE|BUSY|RINGING|RINGINUSE|ONHOLD" ${DEVICE_STATE(DAHDI/g1/100)})} ]?context,extension,1)
same => n,NoOp(STATE 101: ${DEVICE_STATE(DAHDI/g1/101)})
same => n,GotoIf($[ ${REGEX("INUSE|BUSY|RINGING|RINGINUSE|ONHOLD" ${DEVICE_STATE(DAHDI/g1/101)})} ]?context,extension,1)
same => n,Dial(DAHDI/g1/100&DAHDI/g1/101)
same => n,Hangup
exten => 100,1,Dial(SIP/100,25,tr); Call arrives at 100, wait 25 seconds.
exten => 100,2,Dial(SIP/101);If not answered within 25 seconds or unavailable, transfer the call to number 101.
exten => 101,1,Dial(SIP/101,25,tr);Call comes on 101, wait 25 seconds.
exten => 101,2,Dial(SIP/100);If there is no answer in 25 seconds or due to unavailability, we transfer the call to number 100.
;i.e. when calling to number 100 or 101, in case of unavailability, there will be a redirect immediately, if the number is available, then we wait 25 seconds for an answer, and if there is no answer, then we redirect.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question