T
T
torr20092014-10-22 07:13:43
Asterisk
torr2009, 2014-10-22 07:13:43

How to correctly configure Asterisk to enumerate outgoing SIP trunks when dialing?

There are several providers
SIP/provider1 - 1 line (cal-limit=1)
SIP/provider2 - 4 lines
SIP/provider3 - 10 lines
and there is Asterisk 11.
How to organize the following functionality correctly?
When calling to an external line, an attempt is made to connect through provider1, if the line is busy (the line, not the remote subscriber!), then through provider2. And only if provider1 & provider2 are busy, the call is made through provider3.
Thanks in advance. If possible, please provide solutions in the usual extension.conf syntax and in the AEL syntax.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
b_aalexx, 2014-11-05
@b_aalexx

If relevant, I'll unsubscribe with a DIALSTATUS check. Everything works. It also takes the statuses of providers from the AstDb database - sometimes I turn it off myself sometimes

V
Vladimir, 2014-10-22
@rostel

exten => _X.,1,Set(GROUP()=provider1)
    same => n,GotoIF($[${GROUP_COUNT(provider1)} > 1]?prov2)
    same => n,Dial(SIP/provider1/${EXTEN},60)
    same => n(prov2),Set(GROUP()=provider2)
    same => n,GotoIF($[${GROUP_COUNT(provider2)} > 4]?prov3)
    same => n,Dial(SIP/provider2/${EXTEN},60)
    same => n(prov3),Set(GROUP()=provider3)
    same => n,GotoIF($[${GROUP_COUNT(provider3)} > 10]?stop)
    same => n,Dial(SIP/provider3/${EXTEN},60)
    same => n(stop),Hangup()

on AEL and checking DIALSTATUS yourself

E
easystandard1, 2015-10-28
@easystandard1

Actual, you can show the version with DIALSTATUS check

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question