ВидеоКонф(ВКС)  ::   FAQ  ::   Поиск  ::   Регистрация  ::   Вход

и снова резервирование :)

Проблемы и их решения Asterisk как такового

Модераторы: april22, Zavr2008

и снова резервирование :)

Сообщение anvista » 16 фев 2023, 12:29

Коллеги, день добрый.
Сижу вот туплю что-то.
Два SIP-транка связывают нас с вышестоящим внешним миром. Звонки бегают и туда, и туда в зависимости от приятности цены.
Звонки на мобильные бегали только через один транк, т.к. второй их просто не предоставлял, а теперь вот тоже предоставляет.
И вот сижу и думаю, будет ли работать простая конструкция диалплана вида
exten => _[7-8]9XXXXXXXXX,1,Dial(SIP/operator1/7${EXTEN:1},50)
same => n, Dial(SIP/operator2/7${EXTEN:1},50)
same => n,Hangup()
в случае, если на первом транке прилетит 503 ответ или 480, например?
В последнее время у них на мобильном сегменте частенько проблемы возникать стали.
Транк-то в принципе рабочий при этом, звонки отваливаются только в каком-нибудь направлении.
anvista
 
Сообщений: 22
Зарегистрирован: 04 авг 2011, 12:06

Re: и снова резервирование :)

Сообщение ded » 16 фев 2023, 12:47

1) А проверить? Смоделировать ситуацию и промониторить поведение?

2) Можно и не проверять, а написать конструкцию чуть сложнее: Dial second trunk based on Return codes

exten => _[7-8]9XXXXXXXXX,1,Dial(SIP/operator1/7${EXTEN:1},50)
same => n,NoOp(Dial status is ${DIALSTATUS})
same => n,ExecIf(${DIALSTATUS}=NOANSWER)?Dial(SIP/operator2/7${EXTEN:1},50)

Dial sets DIALSTATUS to indicate its success or failure. However, under some circumstances, execution will jump to priority n+101 in the current context. This happens when:

All channels dialed were busy
There is exists something at n+101 in the current context
You are running asterisk 1.0.x, priorityjumping=yes is set in extensions.conf, or the j option is specified in the dial command

If the g option is specified, and the called party hangs up before the calling party, then Dial continues execution at priority n+1.

Do Progress() before calling Dial() if you want asterisk to go in-band (in order to use playtones configured in indications.conf etc.). In some cases you may have to use Answer(), but that is to be avoided because it “charges”, prevents auto-redial, etc.

Note: The bristuff patches change the dial behaviour slightly and jump to n+201 if the dialed destination isn’t connected (e.g. a SIP softphone is not up and running, or hasn’t registered).

DIALSTATUS – For more details see Asterisk variable DIALSTATUS

${DIALSTATUS} will be one of:

CHANUNAVAIL : Channel unavailable (for example in sip.conf, when using qualify=, the SIP chan is unavailable)
BUSY : Returned busy
NOANSWER : No Answer (i.e SIP 480 or 604 response)
ANSWER : Call was answered
CANCEL : Call attempt cancelled (i.e user hung up before the call connected)
DONTCALL : Privacy manager don’t call
TORTURE : Privacy manager torture menu
CONGESTION : Means Congestion, or anything else (some other error setting up the call)

https://www.voip-info.org/asterisk-cmd-dial/
ded
 
Сообщений: 15803
Зарегистрирован: 26 авг 2010, 19:00

Re: и снова резервирование :)

Сообщение anvista » 17 фев 2023, 18:03

Спасибо. буду пробовать :)
anvista
 
Сообщений: 22
Зарегистрирован: 04 авг 2011, 12:06


Вернуться в Конфигурация и настройка Asterisk

Кто сейчас на форуме

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 27

© 2008 — 2024 Asterisk.ru
Digium, Asterisk and AsteriskNOW are registered trademarks of Digium, Inc.
Design and development by PostMet-Netzwerk GmbH