regex - Create 2 external lines with the same regexps and priorities in Asterisk -


i'm running asterisk 11.4.0 , need make feature: when i'm calling number matching specific mask, 1 of 2 (or 3) external lines can used, line each such call must chose randomly.

for example, i've got lines , b, , i've number mask _xxxx. means, when call number, matching mask, must use randomly or b line.

i can create rule in dialplan:

exten => _xxxx,1,dial(sip/${exten}@a,30,r) 

asterisk denies creation of line:

exten => _xxxx,1,dial(sip/${exten}@b,30,r) 

how can code feature?

you can't use same extension , same priority.

usually external lines(fxo, e1) put in 1 group , can call group in dialplan.

but can follow dialplan using rand function:

exten => _xxxx,1,goto(${rand(2,3)}) exten => _xxxx,2,dial(sip/${exten}@a,30,r) exten => _xxxx,3,dial(sip/${exten}@b,30,r) 

the rand function chose randomly priority 2 or 3


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -