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

realtime и pjsip

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

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

realtime и pjsip

Сообщение Cramac » 23 июл 2021, 18:33

Всем привет. Хочу настроить pjsip в реалтайм.

Настроил, итог таков, не видит:
[Показать] Спойлер:
user*CLI> odbc show

ODBC DSN Settings
-----------------

Name: general
DSN: asterisk
Number of active connections: 1 (out of 1)

user*CLI> pjsip show endpoints
No objects found.


конфиги:
res_odbc.conf:
[Показать] Спойлер:
[general]
enabled => yes
dsn => asterisk
username => root
password => password
pre-connect => yes


extconfig.conf
[Показать] Спойлер:
[settings]
ps_endpoints => odbc,asterisk
ps_auths => odbc,asterisk
ps_aors => odbc,asterisk
;ps_domain_aliases => odbc,asterisk
ps_endpoint_id_ips => odbc,asterisk
;ps_contacts => odbc,asterisk


sorcery.conf
[Показать] Спойлер:
; Sample configuration file for Sorcery Data Access Layer

;
; Wizards
;
; Wizards are the persistence mechanism for objects. They are loaded as Asterisk modules and register
; themselves with the sorcery core. All implementation specific details of how objects are persisted is isolated
; within wizards.
;

;
; Caching
;
; A wizard can optionally be marked as an object cache by adding "/cache" to the object type within the mapping.
; If an object is returned from a non-object cache it is immediately given to the cache to be created. Multiple
; object caches can be configured for a single object type.
;

;
; Object Type Mappings
;
; To allow configuration of where and how an object is persisted object mappings can be defined within this file
; on a per-module basis. The mapping consists of the object type, options, wizard name, and wizard configuration
; data. This has the following format:
;
; object type [/options] = wizard name, wizard configuration data
;
; For example to configure an in-memory wizard for the 'bob' object type:
;
; bob = memory
;
; Or to configure the object type 'joe' from a configuration file:
;
; joe = config,joe.conf
;
; Note that an object type can have multiple mappings defined. Each mapping will be consulted in the order in which
; it appears within the configuration file. This means that if you are configuring a wizard as a cache it should
; appear as the first mapping so the cache is consulted before all other mappings.
;

;
; The following object mappings are used by the unit test to test certain functionality of sorcery.
;
[test_sorcery_section]
test=memory

[test_sorcery_cache]
test/cache=test
test=memory

;
; The following object mapping is the default mapping of external MWI mailbox
; objects to give persistence to the message counts.
;
;[res_mwi_external]
;mailboxes=astdb,mwi_external

;
; The following object mappings set PJSIP objects to use realtime database mappings from extconfig
; with the table names used when automatically generating configuration from the alembic script.
;
[res_pjsip]
endpoint=realtime,ps_endpoints
auth=realtime,ps_auths
aor=realtime,ps_aors
;domain_alias=realtime,ps_domain_aliases
;contact=realtime,ps_contacts

[res_pjsip_endpoint_identifier_ip]
identify=realtime,ps_endpoint_id_ips

;[res_pjsip_outbound_publish]
;outbound-publish=realtime,ps_outbound_publishes

;[res_pjsip_pubsub]
;inbound-publication=realtime,ps_inbound_publications

;[res_pjsip_publish_asterisk]
;asterisk-publication=realtime,ps_asterisk_publications


База есть, таблицы созданы, добавлено 2 пользователя в таблицах:
ps_aors
ps_endpoints
ps_auths
[Показать] Спойлер:
-- Дамп данных таблицы asterisk.ps_aors: ~0 rows (приблизительно)
/*!40000 ALTER TABLE `ps_aors` DISABLE KEYS */;
REPLACE INTO `ps_aors` (`id`, `contact`, `default_expiration`, `mailboxes`, `max_contacts`, `minimum_expiration`, `remove_existing`, `qualify_frequency`, `authenticate_qualify`, `maximum_expiration`, `outbound_proxy`, `support_path`, `qualify_timeout`, `voicemail_extension`) VALUES
('200018', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('200027', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/*!40000 ALTER TABLE `ps_aors` ENABLE KEYS */;

-- Дамп данных таблицы asterisk.ps_auths: ~0 rows (приблизительно)
/*!40000 ALTER TABLE `ps_auths` DISABLE KEYS */;
REPLACE INTO `ps_auths` (`id`, `auth_type`, `nonce_lifetime`, `md5_cred`, `password`, `realm`, `username`) VALUES
('200018', 'userpass', NULL, NULL, '4b5b36c58adf1b29fbfc0a45f13fcfe9', NULL, '200018'),
('200027', 'userpass', NULL, NULL, 'f4819351999037d6552986f9dc6284ed', NULL, '200027');
/*!40000 ALTER TABLE `ps_auths` ENABLE KEYS */;

-- Дамп данных таблицы asterisk.ps_endpoints: ~0 rows (приблизительно)
/*!40000 ALTER TABLE `ps_endpoints` DISABLE KEYS */;
REPLACE INTO `ps_endpoints` (`id`, `transport`, `aors`, `auth`, `context`, `disallow`, `allow`, `direct_media`, `connected_line_method`, `direct_media_method`, `direct_media_glare_mitigation`, `disable_direct_media_on_nat`, `dtmf_mode`, `external_media_address`, `force_rport`, `ice_support`, `identify_by`, `mailboxes`, `moh_suggest`, `outbound_auth`, `outbound_proxy`, `rewrite_contact`, `rtp_ipv6`, `rtp_symmetric`, `send_diversion`, `send_pai`, `send_rpid`, `timers_min_se`, `timers`, `timers_sess_expires`, `callerid`, `callerid_privacy`, `callerid_tag`, `100rel`, `aggregate_mwi`, `trust_id_inbound`, `trust_id_outbound`, `use_ptime`, `use_avpf`, `media_encryption`, `inband_progress`, `call_group`, `pickup_group`, `named_call_group`, `named_pickup_group`, `device_state_busy_at`, `fax_detect`, `t38_udptl`, `t38_udptl_ec`, `t38_udptl_maxdatagram`, `t38_udptl_nat`, `t38_udptl_ipv6`, `tone_zone`, `language`, `one_touch_recording`, `record_on_feature`, `record_off_feature`, `rtp_engine`, `allow_transfer`, `allow_subscribe`, `sdp_owner`, `sdp_session`, `tos_audio`, `tos_video`, `sub_min_expiry`, `from_domain`, `from_user`, `mwi_from_user`, `dtls_verify`, `dtls_rekey`, `dtls_cert_file`, `dtls_private_key`, `dtls_cipher`, `dtls_ca_file`, `dtls_ca_path`, `dtls_setup`, `srtp_tag_32`, `media_address`, `redirect_method`, `set_var`, `cos_audio`, `cos_video`, `message_context`, `force_avp`, `media_use_received_transport`, `accountcode`, `user_eq_phone`, `moh_passthrough`, `media_encryption_optimistic`, `rpid_immediate`, `g726_non_standard`, `rtp_keepalive`, `rtp_timeout`, `rtp_timeout_hold`, `bind_rtp_to_media_address`, `voicemail_extension`, `mwi_subscribe_replaces_unsolicited`, `deny`, `permit`, `acl`, `contact_deny`, `contact_permit`, `contact_acl`, `subscribe_context`, `fax_detect_timeout`, `contact_user`, `preferred_codec_only`, `asymmetric_rtp_codec`, `rtcp_mux`, `allow_overlap`, `refer_blind_progress`, `notify_early_inuse_ringing`, `max_audio_streams`, `max_video_streams`, `webrtc`, `dtls_fingerprint`, `incoming_mwi_mailbox`, `bundle`, `dtls_auto_generate_cert`, `follow_early_media_fork`, `accept_multiple_sdp_answers`, `suppress_q850_reason_headers`, `trust_connected_line`, `send_connected_line`) VALUES
('200018', 'transport-udp', '200018', '200018', 'from-internal', NULL, 'all', 'no', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('200027', 'transport-udp', '200027', '200027', 'from-internal', NULL, 'all', 'no', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
/*!40000 ALTER TABLE `ps_endpoints` ENABLE KEYS */;


Asterisk 16.2.1~dfsg-2ubuntu1
Cramac
 
Сообщений: 21
Зарегистрирован: 02 дек 2014, 11:46

Re: realtime и pjsip

Сообщение sasa » 23 июл 2021, 21:34

Включить лог дебаг и смотреть что куда доходит или нет.
Вот кстати вокслинк зашарил очередные видео с 2020 астериск конф на ютубе.
Там про отладку вербоус дебаг чуть чуть даже было.
sasa
 
Сообщений: 119
Зарегистрирован: 22 янв 2019, 15:41

Re: realtime и pjsip

Сообщение Cramac » 23 июл 2021, 23:13

весь дебаг сводится к ошибкам типо not found
предполагаю что проблема в настройке реалтайм. Не видит данные в базе

[Показать] Спойлер:
[Jul 23 22:14:12] DEBUG[726]: res_pjsip/pjsip_distributor.c:392 find_dialog: Could not find matching transaction for Request msg REGISTER/cseq=28436 (rdata0x7f5cd81abeb8)
[Jul 23 22:14:12] DEBUG[726]: res_pjsip/pjsip_distributor.c:470 ast_sip_get_distributor_serializer: Calculated serializer pjsip/distributor-00000024 to use for Request msg REGISTER/cseq=28436 (rdata0x7f5cd81abeb8)
[Jul 23 22:14:12] DEBUG[20897]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting '94.253.34.32' into...
[Jul 23 22:14:12] DEBUG[20897]: netsock2.c:224 ast_sockaddr_split_hostport: ...host '94.253.34.32' and port ''.
[Jul 23 22:14:12] DEBUG[20897]: res_pjsip_endpoint_identifier_ip.c:260 common_identify: No identify sections to match against
[Jul 23 22:14:12] DEBUG[20897]: res_pjsip_endpoint_identifier_user.c:148 username_identify: Attempting identify by From username '200018' domain 'voip.site.ru'
[Jul 23 22:14:12] DEBUG[20897]: res_pjsip_endpoint_identifier_user.c:152 username_identify: Endpoint not found for From username '200018' domain 'voip.site.ru'
[Jul 23 22:14:12] DEBUG[20897]: res_pjsip_endpoint_identifier_user.c:173 auth_username_identify: Attempting identify by Authorization username '200018' realm 'asterisk'
[Jul 23 22:14:12] DEBUG[20897]: res_pjsip_endpoint_identifier_user.c:178 auth_username_identify: Endpoint not found for Authentication username '200018' realm 'asterisk'
[Jul 23 22:14:12] DEBUG[20897]: res_pjsip_endpoint_identifier_ip.c:260 common_identify: No identify sections to match against
[Jul 23 22:14:12] NOTICE[20897]: res_pjsip/pjsip_distributor.c:672 log_failed_request: Request 'REGISTER' from '"Test" <sip:200018@voip.site.ru>' failed for '94.253.34.32:54301' (callid: YrVbmHjv9A6a5-37zDZCabioeVDrRYfT) - No matching endpoint found
Cramac
 
Сообщений: 21
Зарегистрирован: 02 дек 2014, 11:46

Re: realtime и pjsip

Сообщение sasa » 23 июл 2021, 23:56

Логгирование не ограничено одним pjsip
У вас ограниченно
Не видно даже как оно в базу сходило
Копайте дальше
sasa
 
Сообщений: 119
Зарегистрирован: 22 янв 2019, 15:41

Re: realtime и pjsip

Сообщение Cramac » 25 июл 2021, 14:07

как включить лог работы с базой? нет ничего про коннект или запросы в базу.
Cramac
 
Сообщений: 21
Зарегистрирован: 02 дек 2014, 11:46

Re: realtime и pjsip

Сообщение Cramac » 25 июл 2021, 15:36

при перезагрузке, в логе есть такое:

Код: выделить все
  -- Reloading module 'res_odbc.so' (ODBC resource)
[Jul 25 14:35:09] NOTICE[13167]: res_odbc.c:706 load_odbc_config: Registered ODBC class 'asterisk' dsn->[asterisk]
    -- Reloading module 'extconfig' (Configuration)
  == Binding ps_endpoints to odbc/asterisk/ps_endpoints
  == Binding ps_auths to odbc/asterisk/ps_auths
  == Binding ps_aors to odbc/asterisk/ps_aors
    -- Reloading module 'res_config_odbc.so' (Realtime ODBC configuration)
    -- Reloading module 'logger' (Logger)


вроде как все по инструкции, все работает, но в базу не лезет.
Cramac
 
Сообщений: 21
Зарегистрирован: 02 дек 2014, 11:46

Re: realtime и pjsip

Сообщение Cramac » 25 июл 2021, 16:37

все, вопрос закрыт. дело было в заполнении базы.
в таблице aors я заполнил поля id и contact
а надо было id и max_contacts (contact очистил)
и все пошло.
Cramac
 
Сообщений: 21
Зарегистрирован: 02 дек 2014, 11:46


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

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

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

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