VIDEOCHAT  ::   FAQ  ::   Поиск  ::   Регистрация  ::   Вход

Asterisk 16 and Asterisk 13 с PJSIP. extensions.conf

Проблемы Asterisk без вэб-оболочек и их решения

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

Аватара пользователя
olegsenin
Сообщения: 91
Зарегистрирован: 30 мар 2015, 10:29

Re: Asterisk 16 and Asterisk 13 с PJSIP. extensions.conf

Сообщение olegsenin »

Нашел я таки единомышленников ))
Проблема не только у меня
https://community.asterisk.org/t/cid-ma ... 6/82744/33
Ток вот отписаться не могу там, аккаунт заблочили сразу почему то ((( :evil:
Аватара пользователя
olegsenin
Сообщения: 91
Зарегистрирован: 30 мар 2015, 10:29

Re: Asterisk 16 and Asterisk 13 с PJSIP. extensions.conf

Сообщение olegsenin »

Итого:
1. Пробовал на версии 16.0 и 16.8
2. Почему то при наличии общей строки "обезличенной", без фильтра по CID, все начинает работать
3. ...
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER: pjsip_wizard.conf
[user_defaults](!)
type = wizard
transport = ipv4
accepts_registrations = yes
sends_registrations = no
accepts_auth = yes
sends_auth = no
has_hint = yes
hint_context = DLPN_DialPlan1
hint_application = Gosub(stdexten,${EXTEN},1(${HINT}))
endpoint/context = DLPN_DialPlan1
endpoint/allow_subscribe = yes
endpoint/allow = !all,alaw
endpoint/direct_media = yes
endpoint/force_rport = yes
endpoint/disable_direct_media_on_nat = yes
endpoint/direct_media_method = invite
endpoint/ice_support = yes
endpoint/moh_suggest = default
endpoint/send_rpid = yes
endpoint/rewrite_contact = yes
endpoint/send_pai = yes
endpoint/allow_transfer = yes
endpoint/trust_id_inbound = yes
endpoint/device_state_busy_at = 1
endpoint/trust_id_outbound = yes
endpoint/send_diversion = yes
aor/qualify_frequency = 30
aor/authenticate_qualify = no
aor/max_contacts = 1
aor/remove_existing = yes
aor/minimum_expiration = 30
aor/support_path = yes

[bob](user_defaults)
hint_exten = 1000
inbound_auth/username = bob
inbound_auth/password = bobspassword

[alice](user_defaults)
hint_exten = 1001
endpoint/callerid = Alice <1001>
endpoint/allow = !all,ulaw
inbound_auth/username = alice
inbound_auth/password = alicespassword
has_phoneprov = yes
phoneprov/MAC = deadbeef4dad
При наличии строки

Код: Выделить всё

exten => _8[89]XXXXXXXXX,1,NoOp(${CALLERID(all)} arg1 ${ARG1} arg2 ${ARG2} arg3 ${ARG3})
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER: extensions.conf
[DLPN_DialPlan1]
exten => _8[89]XXXXXXXXX/_2[3-5]XX,1,GoSub(sub-dial-out,${EXTEN},1(484848${CALLERID(num)}))
exten => _8[89]XXXXXXXXX/bob,1,NoOp(${CALLERID(all)} arg1 ${ARG1} arg2 ${ARG2} arg3 ${ARG3})
same => n,NoOp(Dialing out from ${CALLERID(all)} to (${EXTEN}))
same => n,Dial(PJSIP/${EXTEN}@smg-rostelecom)
same => n,Goto(dial-status,${DIALSTATUS},1)
exten => _8[89]XXXXXXXXX/1000,1,NoOp(${CALLERID(all)} arg1 ${ARG1} arg2 ${ARG2} arg3 ${ARG3})
same => n,NoOp(Dialing out from ${CALLERID(all)} to (${EXTEN}))
same => n,Dial(PJSIP/${EXTEN}@smg-rostelecom)
same => n,Goto(dial-status,${DIALSTATUS},1)
exten => _8[89]XXXXXXXXX/2685,1,GoSub(sub-dial-out,${EXTEN},1(484848${CALLERID(num)},4848484848))
exten => _8[89]XXXXXXXXX,1,NoOp(${CALLERID(all)} arg1 ${ARG1} arg2 ${ARG2} arg3 ${ARG3})

[dial-status]
exten => BUSY,1,NoCDR()
same => n,Playback(ru/number)
same => n,Playback(ru/vm-isonphone)
same => n,Playback(ru/pls-try-call-later)
same => n,Hangup
exten => NOANSWER,1,NoCDR()
same => n,Playback(ru/number-not-answering)
same => n,Hangup
exten => CANCEL,1,NoCDR()
same => n,,Playback(vympel/call-cancelled)
same => n,Hangup
exten => CONGESTION,1,NoCDR()
same => n,Playback(ru/something-terribly-wrong)
same => n,Playback(ru/check-number-dial-again)
same => n,Hangup
exten => CHANUNAVAIL,1,NoCDR()
same => n,Playback(ru/number)
same => n,Playback(ru/vm-isonphone)
same => n,Playback(ru/pls-try-call-later)
same => n,Hangup
exten => DONTCALL,1,NoCDR()
same => n,Playback(vympel/call-cancelled)
same => n,Hangup
exten => TORTURE,1,NoCDR()
same => n,Playback(vympel/call-cancelled)
same => n,Hangup
exten => INVALIDARGS,1,Playback(ru/cancelled)
same => n,Hangup
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER: Выхлоп такой
== Setting global variable 'SIPDOMAIN' to '10.40.8.162'
-- Executing [89051333333@DLPN_DialPlan1:1]NoOp("PJSIP/bob-00000001", ""bob" <bob> arg1 arg2 arg3 ") in new stack
-- Executing [89051333333@DLPN_DialPlan1:2] NoOp("PJSIP/bob-00000001", "Dialing out from "bob" <bob> to (89051333333)") in new stack
-- Executing [89051333333@DLPN_DialPlan1:3] Dial("PJSIP/bob-00000001", "PJSIP/89051333333@smg-rostelecom") in new stack
[Mar 3 13:45:58] ERROR[42656]: chan_pjsip.c:2486 request: Unable to create PJSIP channel - endpoint 'smg-rostelecom' was not found
[Mar 3 13:45:58] WARNING[42962][C-00000002]: app_dial.c:2516 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [89051333333@DLPN_DialPlan1:4] Goto("PJSIP/bob-00000001", "dial-status,CHANUNAVAIL,1") in new stack
-- Goto (dial-status,CHANUNAVAIL,1)
-- Executing [CHANUNAVAIL@dial-status:1] NoCDR("PJSIP/bob-00000001", "") in new stack
-- Executing [CHANUNAVAIL@dial-status:2] Playback("PJSIP/bob-00000001", "ru/number") in new stack
> 0x7f0540039e00 -- Strict RTP learning after remote address set to: 10.40.4.223:62778
> 0x7f0540039e00 -- Strict RTP switching to RTP target address 10.40.4.223:62778 as source
-- <PJSIP/bob-00000001> Playing 'ru/number.alaw' (language 'en')
-- Executing [CHANUNAVAIL@dial-status:3] Playback("PJSIP/bob-00000001", "ru/vm-isonphone") in new stack
-- <PJSIP/bob-00000001> Playing 'ru/vm-isonphone.alaw' (language 'en')
-- Executing [CHANUNAVAIL@dial-status:4] Playback("PJSIP/bob-00000001", "ru/pls-try-call-later") in new stack
-- <PJSIP/bob-00000001> Playing 'ru/pls-try-call-later.alaw' (language 'en')
-- Executing [CHANUNAVAIL@dial-status:5] Hangup("PJSIP/bob-00000001", "") in new stack
== Spawn extension (dial-status, CHANUNAVAIL, 5) exited non-zero on 'PJSIP/bob-00000001']
При закомментированной строке exten => _8[89]XXXXXXXXX,1,NoOp(${CALLERID(all)} arg1 ${ARG1} arg2 ${ARG2} arg3 ${ARG3})
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER: extensions.conf
[DLPN_DialPlan1]
exten => _8[89]XXXXXXXXX/_2[3-5]XX,1,GoSub(sub-dial-out,${EXTEN},1(484848${CALLERID(num)}))
exten => _8[89]XXXXXXXXX/bob,1,NoOp(${CALLERID(all)} arg1 ${ARG1} arg2 ${ARG2} arg3 ${ARG3})
same => n,NoOp(Dialing out from ${CALLERID(all)} to (${EXTEN}))
same => n,Dial(PJSIP/${EXTEN}@smg-rostelecom)
same => n,Goto(dial-status,${DIALSTATUS},1)
exten => _8[89]XXXXXXXXX/1000,1,NoOp(${CALLERID(all)} arg1 ${ARG1} arg2 ${ARG2} arg3 ${ARG3})
same => n,NoOp(Dialing out from ${CALLERID(all)} to (${EXTEN}))
same => n,Dial(PJSIP/${EXTEN}@smg-rostelecom)
same => n,Goto(dial-status,${DIALSTATUS},1)
exten => _8[89]XXXXXXXXX/2685,1,GoSub(sub-dial-out,${EXTEN},1(484848${CALLERID(num)},4848484848))
; exten => _8[89]XXXXXXXXX,1,NoOp(${CALLERID(all)} arg1 ${ARG1} arg2 ${ARG2} arg3 ${ARG3})

[dial-status]
exten => BUSY,1,NoCDR()
same => n,Playback(ru/number)
same => n,Playback(ru/vm-isonphone)
same => n,Playback(ru/pls-try-call-later)
same => n,Hangup
exten => NOANSWER,1,NoCDR()
same => n,Playback(ru/number-not-answering)
same => n,Hangup
exten => CANCEL,1,NoCDR()
same => n,,Playback(vympel/call-cancelled)
same => n,Hangup
exten => CONGESTION,1,NoCDR()
same => n,Playback(ru/something-terribly-wrong)
same => n,Playback(ru/check-number-dial-again)
same => n,Hangup
exten => CHANUNAVAIL,1,NoCDR()
same => n,Playback(ru/number)
same => n,Playback(ru/vm-isonphone)
same => n,Playback(ru/pls-try-call-later)
same => n,Hangup
exten => DONTCALL,1,NoCDR()
same => n,Playback(vympel/call-cancelled)
same => n,Hangup
exten => TORTURE,1,NoCDR()
same => n,Playback(vympel/call-cancelled)
same => n,Hangup
exten => INVALIDARGS,1,Playback(ru/cancelled)
same => n,Hangup
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER: Выхлоп такой
[Mar 3 13:46:24] NOTICE[42656]: res_pjsip_session.c:2963 new_invite: Call from 'bob' (UDP:10.40.4.223:51873) to extension '89051333333' rejected because extension not found in context 'DLPN_DialPlan1'.
Аватара пользователя
Zavr2008
Сообщения: 2211
Зарегистрирован: 27 янв 2011, 00:35
Контактная информация:

Re: Asterisk 16 and Asterisk 13 с PJSIP. extensions.conf

Сообщение Zavr2008 »

Код: Выделить всё

-- Executing [89051333333@DLPN_DialPlan1:3] Dial("PJSIP/bob-00000001", "PJSIP/89051333333@smg-rostelecom") in new stack
[Mar 3 13:45:58] ERROR[42656]: chan_pjsip.c:2486 request: Unable to create PJSIP channel - endpoint 'smg-rostelecom' was not found
[Mar 3 13:45:58] WARNING[42962][C-00000002]: app_dial.c:2516 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
Перевести на русский?
Российские E1 шлюзы Alvis. Модернизация УПАТС с E1,Подключение к ИС "Антифрод" E1 PRI/SS#7 УВР Телестор, Грифин и др..
Аватара пользователя
olegsenin
Сообщения: 91
Зарегистрирован: 30 мар 2015, 10:29

Re: Asterisk 16 and Asterisk 13 с PJSIP. extensions.conf

Сообщение olegsenin »

Zavr2008, это тестовый сервер и транк там заведомо не рабочий.
Проблема в другом, в том что шаблон вида _Z./ZXXX с драйвером PJSIP работает только тогда когда есть в этом же контексте строка без фильтра, т.е. просто _Z.
ded
Сообщения: 15619
Зарегистрирован: 26 авг 2010, 19:00

Re: Asterisk 16 and Asterisk 13 с PJSIP. extensions.conf

Сообщение ded »

Правильный синтаксис - залог успеха.
exten => _Z./_ZXXX,1,далее куда надо
Аватара пользователя
Zavr2008
Сообщения: 2211
Зарегистрирован: 27 янв 2011, 00:35
Контактная информация:

Re: Asterisk 16 and Asterisk 13 с PJSIP. extensions.conf

Сообщение Zavr2008 »

это тестовый сервер и транк там заведомо не рабочий
Павлины говорите)
Нужно правильные тесты ставить. Да еще и книжку почитать, чтобы не орать "Asterisk - глючит".
Российские E1 шлюзы Alvis. Модернизация УПАТС с E1,Подключение к ИС "Антифрод" E1 PRI/SS#7 УВР Телестор, Грифин и др..
Аватара пользователя
olegsenin
Сообщения: 91
Зарегистрирован: 30 мар 2015, 10:29

Re: Asterisk 16 and Asterisk 13 с PJSIP. extensions.conf

Сообщение olegsenin »

Да пожалуйста:
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER:
[DLPN_DialPlan1]
exten => _8[89]XXXXXXXXX/_2000,1,Answer()
same => n,Verbose(111111111111111111 CID ${CALLERID(num)})
same => n,Dumpchan()
same => n,Wait(1)
same => n,Hangup
exten => _8[89]XXXXXXXXX/2000,1,Answer()
same => n,Verbose(44444444444 CID ${CALLERID(num)})
same => n,Dumpchan()
same => n,Wait(1)
same => n,Hangup
exten => _8[89]XXXXXXXXX,1,Answer()
same => n,Verbose(!!!!!!!!!!!! CID ${CALLERID(num)})
same => n,Dumpchan()
same => n,Wait(1)
same => n,Hangup
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER: Выхлоп
Setting global variable 'SIPDOMAIN' to '10.40.8.162'
-- Executing [89051333333@DLPN_DialPlan1:1] Answer("PJSIP/2000-00000004", "") in new stack
> 0x7f262405f0d0 -- Strict RTP learning after remote address set to: 10.40.4.223:50836
> 0x7f262405f0d0 -- Strict RTP switching to RTP target address 10.40.4.223:50836 as source
-- Executing [89051333333@DLPN_DialPlan1:2] Verbose("PJSIP/2000-00000004", "44444444444 CID 2000") in new stack
44444444444 CID 2000
-- Executing [89051333333@DLPN_DialPlan1:3] DumpChan("PJSIP/2000-00000004", "") in new stack

Dumping Info For Channel: PJSIP/2000-00000004:
================================================================================
Info:
Name= PJSIP/2000-00000004
Type= PJSIP
UniqueID= 1583394430.6
LinkedID= 1583394430.6
CallerIDNum= 2000
CallerIDName= Ananas
ConnectedLineIDNum= (N/A)
ConnectedLineIDName=(N/A)
DNIDDigits= 89051333333
RDNIS= (N/A)
Parkinglot=
Language= en
State= Up (6)
Rings= 1
NativeFormat= (alaw)
WriteFormat= alaw
ReadFormat= alaw
RawWriteFormat= alaw
RawReadFormat= alaw
WriteTranscode= No
ReadTranscode= No
1stFileDescriptor= -1
Framesin= 15
Framesout= 0
TimetoHangup= 0
ElapsedTime= 0h0m0s
BridgeID= (Not bridged)
Context= DLPN_DialPlan1
Extension= 89051333333
Priority= 3
CallGroup=
PickupGroup=
Application= DumpChan
Data= (Empty)
Blocking_in= (Not Blocking)

Variables:
================================================================================
-- Executing [89051333333@DLPN_DialPlan1:4] Wait("PJSIP/2000-00000004", "1") in new stack
-- Executing [89051333333@DLPN_DialPlan1:5] Hangup("PJSIP/2000-00000004", "") in new stack
== Spawn extension (DLPN_DialPlan1, 89051333333, 5) exited non-zero on 'PJSIP/2000-00000004'
Убираем нижнюю строку
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER:
[DLPN_DialPlan1]
exten => _8[89]XXXXXXXXX/_2000,1,Answer()
same => n,Verbose(111111111111111111 CID ${CALLERID(num)})
same => n,Dumpchan()
same => n,Wait(1)
same => n,Hangup
exten => _8[89]XXXXXXXXX/2000,1,Answer()
same => n,Verbose(44444444444 CID ${CALLERID(num)})
same => n,Dumpchan()
same => n,Wait(1)
same => n,Hangup
; exten => _8[89]XXXXXXXXX,1,Answer()
; same => n,Verbose(!!!!!!!!!!!! CID ${CALLERID(num)})
; same => n,Dumpchan()
; same => n,Wait(1)
; same => n,Hangup
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER: Выхлоп
[Mar 5 10:53:05] NOTICE[2216]: res_pjsip_session.c:3078 new_invite: Call from '2000' (UDP:10.40.4.223:54005) to extension '89051333333' rejected because extension not found in context 'DLPN_DialPlan1'.
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER: pjsip_wizard
[user_defaults](!)
type = wizard
transport = ipv4
accepts_registrations = yes
sends_registrations = no
accepts_auth = yes
sends_auth = no
has_hint = yes
hint_context = DLPN_DialPlan1
hint_application = Gosub(stdexten,${EXTEN},1(${HINT}))
endpoint/context = DLPN_DialPlan1
endpoint/allow_subscribe = yes
endpoint/allow = !all,alaw
endpoint/direct_media = yes
endpoint/force_rport = yes
endpoint/disable_direct_media_on_nat = yes
endpoint/direct_media_method = invite
endpoint/ice_support = yes
endpoint/moh_suggest = default
endpoint/send_rpid = yes
endpoint/rewrite_contact = yes
endpoint/send_pai = yes
endpoint/allow_transfer = yes
endpoint/trust_id_inbound = yes
endpoint/device_state_busy_at = 1
endpoint/trust_id_outbound = yes
endpoint/send_diversion = yes
aor/qualify_frequency = 30
aor/authenticate_qualify = no
aor/max_contacts = 1
aor/remove_existing = yes
aor/minimum_expiration = 30
aor/support_path = yes

[bob](user_defaults)
hint_exten = 1000
inbound_auth/username = bob
inbound_auth/password = bobspassword

[alice](user_defaults)
hint_exten = 1001
endpoint/callerid = Alice <1001>
inbound_auth/username = alice
inbound_auth/password = alicespassword

[2000](user_defaults)
hint_exten = 2000
endpoint/callerid = Ananas <2000>
inbound_auth/username = 2000
inbound_auth/password = Ananas2000
ded
Сообщения: 15619
Зарегистрирован: 26 авг 2010, 19:00

Re: Asterisk 16 and Asterisk 13 с PJSIP. extensions.conf

Сообщение ded »

Просто проверяйте синтаксис командой
CLI> dialplan show [89051333333@DLPN_DialPlan1

По возможности не надо результаты экспериментов вываливать на всеобщий разбор, это же вы из любопытства там играетесь? Это не есть проблема.
Аватара пользователя
olegsenin
Сообщения: 91
Зарегистрирован: 30 мар 2015, 10:29

Re: Asterisk 16 and Asterisk 13 с PJSIP. extensions.conf

Сообщение olegsenin »

ded, не очень понял что ты имеешь ввиду по поводу всеобщего обзора.
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER: dialplan show
aster16*CLI> dialplan show 89051333333@DLPN_DialPlan1
[ Context 'DLPN_DialPlan1' created by 'res_pjsip_config_wizard' ]
'_8[89]XXXXXXXXX' (CID match '2000') => 1. Answer() [extensions.conf:7]
2. Verbose(44444444444 CID ${CALLERID(num)}) [extensions.conf:8]
3. Dumpchan() [extensions.conf:9]
4. Wait(1) [extensions.conf:10]
5. Hangup() [extensions.conf:11]
'_8[89]XXXXXXXXX' (CID match '_2000') => 1. Answer() [extensions.conf:2]
2. Verbose(111111111111111111 CID ${CALLERID(num)}) [extensions.conf:3]
3. Dumpchan() [extensions.conf:4]
4. Wait(1) [extensions.conf:5]
5. Hangup() [extensions.conf:6]

-= 2 extensions (10 priorities) in 1 context. =-
aster16*CLI> dialplan show DLPN_DialPlan1
[ Context 'DLPN_DialPlan1' created by 'res_pjsip_config_wizard' ]
'1000' => hint: PJSIP/bob [res_pjsip_config_wizard]
1. Gosub(stdexten,${EXTEN},1(${HINT})) [res_pjsip_config_wizard]
'1001' => hint: PJSIP/2000 [res_pjsip_config_wizard]
1. Gosub(stdexten,${EXTEN},1(${HINT})) [res_pjsip_config_wizard]
'2000' => hint: PJSIP/2000 [res_pjsip_config_wizard]
1. Gosub(stdexten,${EXTEN},1(${HINT})) [res_pjsip_config_wizard]
'_8[89]XXXXXXXXX' (CID match '2000') => 1. Answer() [extensions.conf:7]
2. Verbose(44444444444 CID ${CALLERID(num)}) [extensions.conf:8]
3. Dumpchan() [extensions.conf:9]
4. Wait(1) [extensions.conf:10]
5. Hangup() [extensions.conf:11]
'_8[89]XXXXXXXXX' (CID match '_2000') => 1. Answer() [extensions.conf:2]
2. Verbose(111111111111111111 CID ${CALLERID(num)}) [extensions.conf:3]
3. Dumpchan() [extensions.conf:4]
4. Wait(1) [extensions.conf:5]
5. Hangup() [extensions.conf:6]

-= 5 extensions (16 priorities) in 1 context. =-
[Mar 5 11:23:58] NOTICE[2216]: res_pjsip_session.c:3078 new_invite: Call from '2000' (UDP:10.40.4.223:54005) to extension '89051333333' rejected because extension not found in context 'DLPN_DialPlan1'.
Вложения
3333.jpg
ded
Сообщения: 15619
Зарегистрирован: 26 авг 2010, 19:00

Re: Asterisk 16 and Asterisk 13 с PJSIP. extensions.conf

Сообщение ded »

olegseninвот вижу, что просто играетесь:
olegsenin писал(а):Объективных причин нет. но думаю надо ж попробовать, не зря ж наверное программисты пилят pjsip?
При этом нет понимания в синтаксисе и терминах.
Знак подчёркивания, который говорит, что будет шаблон. А не нижняя строка! Нижняя строка вот тут -
7894г5щепшутозкыпщшозкуе89гь-9ц 45хк9ще4ц5ен9 ц4569ншц4950 6ене90 огцх4590 енпьами

И когда указываете _2000 то это не шаблон, а твёрдый CID такой для Астериска. Он и ищет его при звонке. Шаблон включает в себя буквы Z, N, X.
Вы в одном месте указываете так, в другом - эдак.
Занимайтесь этим не выгружая всё это сюда, ибо - зачем?
Ответить
© 2008 — 2024 Asterisk.ru
Digium, Asterisk and AsteriskNOW are registered trademarks of Digium, Inc.
Design and development by PostMet-Netzwerk GmbH