Задать вопрос
  • Как сделать так, чтобы django проект запускался на встроенном тестовом сервере автоматически при загрузке?

    @Grigorev90 Автор вопроса
    Юрий, pfg21, если запустить тестовый сервер вручную - запускается. После остановки порт освобождаеся. Если запускать через команды для .service - порт занят.

    Даже если сделать sudo fuser -k 8000/tcp, для запуска в systemd это не работает (нет, не ложится на диван), порт все равно занят.

    Как расширить права для запуска через systemd? Или в чем еще может быть причина?

    Юрий, отдельная благодраность за помощь.
    Написано
  • Как сделать так, чтобы django проект запускался на встроенном тестовом сервере автоматически при загрузке?

    @Grigorev90 Автор вопроса
    Юрий, Everything_is_bad,

    спасибо, да, вероятно, user group не правильно указал. Изменил на верные значения, процесс стал запускаться.

    Однако, можете подсказать почему возникает другая ошибка:

    systemd[1]: Started some orders.
    python3[23279]: Watching for file changes with StatReloader
    python3[23279]: System check identified 1 issue (0 silenced).
    python3[23279]: Error: That port is already in use.
    systemd[1]: djop.service: Main process exited, code=exited, status=1/FAILURE
    systemd[1]: djop.service: Failed with result 'exit-code'.

    попробовал назначить разные значения 8000, 8080, 8090 в файле .service. какой порт не возьму, он становится занят и такая ошибка.

    Изначально запустилось и с 8000, после перезагрузки появилась такая ошибка с портом 8000.
    Написано
  • Как сделать так, чтобы django проект запускался на встроенном тестовом сервере автоматически при загрузке?

    @Grigorev90 Автор вопроса
    Everything_is_bad,

    ChatGPT не дает обяъснения, которое могло бы мне помочь. Полагаю, что ИИ изначально предлагает неподходящие параметры.

    Вот что произошло при вводе указанных команд:
    мой компьютер с linuxmint:~$ sudo systemctl daemon-reload
    [sudo] password for мой компьютер с linuxmint:
    мой компьютер с linuxmint:~$ sudo systemctl enable django_project
    мой компьютер с linuxmint:~$ sudo systemctl start django_project
    мой компьютер с linuxmint:~$

    т.е., формально, никаких ошибок сразу не объявлено. при перезагрузке и переходе на указанный ip ответ:

    Не удается получить доступ к сайту
    Сайт 192.168.1.104:8000 недоступен.
    ERR_ADDRESS_UNREACHABLE

    Т.е. приложение не запущено.
    Написано
  • Настройка asterisk для внутренней телефонии при наличии только фрагментарных знаний. Реально?

    @Grigorev90 Автор вопроса
    SunTechnik, Valentin Barbolin, спасибо за помощь, я постарался крайне внимательно пройти все шаги установки, высматривая и устанавливая все возможные зависимости, которые требовались. Прошелся по разным инструкциям, включая официальную, несколько раз перечитывая, потом долго боролся с установкой pjproject, который больше не хотел устанавливаться. Пришлось установить его отдельно, т.е. использовать не встроенный. Почему так случилось пока не понял.

    Внутрення телефония работает. Это и требовалось.
    Написано
  • Настройка asterisk для внутренней телефонии при наличии только фрагментарных знаний. Реально?

    @Grigorev90 Автор вопроса
    SunTechnik,

    файл messages.1:
    Jun  8 23:23:29] Asterisk 18.10.0~dfsg+~cs6.10.40431411-2 built by nobody @ buildd.debian.org on a unknown running Linux on 2022-02-12 18:24:51 UTC
    [Jun  8 23:23:29] NOTICE[757] loader.c: 353 modules will be loaded.
    [Jun  8 23:23:30] NOTICE[757] res_config_ldap.c: No directory user found, anonymous binding as default.
    [Jun  8 23:23:30] ERROR[757] res_config_ldap.c: No directory URL or host found.
    [Jun  8 23:23:30] ERROR[757] res_config_ldap.c: Cannot load LDAP RealTime driver.
    [Jun  8 23:23:30] NOTICE[757] cdr.c: CDR simple logging enabled.
    [Jun  8 23:23:30] WARNING[757] res_phoneprov.c: Unable to find a valid server address or name.
    [Jun  8 23:23:30] NOTICE[757] res_smdi.c: No SMDI interfaces are available to listen on, not starting SMDI listener.
    [Jun  8 23:23:30] NOTICE[757] chan_mgcp.c: Unable to load config mgcp.conf, MGCP disabled
    [Jun  8 23:23:30] NOTICE[757] chan_skinny.c: Configuring skinny from skinny.conf
    [Jun  8 23:23:30] NOTICE[757] chan_skinny.c: Unable to load config skinny.conf, Skinny disabled.
    [Jun  8 23:23:30] WARNING[757] db.c: Couldn't execute stmt: SQL logic error
    [Jun  8 23:23:30] ERROR[757] ari/config.c: No configured users for ARI
    [Jun  8 23:23:30] NOTICE[757] confbridge/conf_config_parser.c: Adding default_menu menu to app_confbridge
    [Jun  8 23:23:30] NOTICE[757] cel_radius.c: Cannot load radiusclient-ng configuration file /etc/radiusclient-ng/radiusclient.conf.
    [Jun  8 23:23:30] NOTICE[757] cdr_pgsql.c: cdr_pgsql configuration contains no global section, skipping module load.
    [Jun  8 23:23:30] NOTICE[757] cdr_radius.c: Cannot load radiusclient-ng configuration file /etc/radiusclient-ng/radiusclient.conf.
    [Jun  8 23:23:30] WARNING[757] cel_pgsql.c: CEL pgsql config file missing global section.
    [Jun  8 23:23:30] NOTICE[757] cel_tds.c: cel_tds has no global category, nothing to configure.
    [Jun  8 23:23:30] WARNING[757] cel_tds.c: cel_tds module had config problems; declining load
    [Jun  8 23:23:30] NOTICE[757] cel_custom.c: No mappings found in cel_custom.conf. Not logging CEL to custom CSVs.
    [Jun  8 23:23:30] ERROR[757] app_voicemail_imap.c: Couldn't find mailbox 1234 in context default
    [Jun  8 23:23:30] ERROR[757] app_voicemail_imap.c: Couldn't find mailbox 1234 in context devices@myaliases
    [Jun  8 23:23:30] ERROR[757] app_voicemail_imap.c: Couldn't find mailbox 1234 in context other
    [Jun  8 23:23:30] WARNING[757] pbx_app.c: Already have an application 'VoiceMail'
    [Jun  8 23:23:30] WARNING[757] pbx_app.c: Already have an application 'VoiceMailMain'
    [Jun  8 23:23:30] WARNING[757] pbx_app.c: Already have an application 'VMAuthenticate'
    [Jun  8 23:23:30] WARNING[757] pbx_app.c: Already have an application 'VoiceMailPlayMsg'
    [Jun  8 23:23:30] WARNING[757] pbx_app.c: Already have an application 'VMSayName'
    [Jun  8 23:23:30] ERROR[757] pbx_functions.c: Function VM_INFO already registered.
    [Jun  8 23:23:30] WARNING[757] manager.c: Manager: Action 'VoicemailUsersList' already registered
    [Jun  8 23:23:30] WARNING[757] manager.c: Manager: Action 'VoicemailUserStatus' already registered
    [Jun  8 23:23:30] WARNING[757] manager.c: Manager: Action 'VoicemailRefresh' already registered
    [Jun  8 23:23:30] ERROR[757] app_voicemail_imap.c: Failure registering applications, functions or tests
    [Jun  8 23:23:30] ERROR[757] chan_unistim.c: Unable to load config unistim.conf
    [Jun  8 23:23:30] WARNING[757] app_voicemail_odbc.c: Failed to obtain database object for 'asterisk'!
    [Jun  8 23:23:30] WARNING[757] app_voicemail_odbc.c: Failed to obtain database object for 'asterisk'!
    [Jun  8 23:23:30] WARNING[757] app_voicemail_odbc.c: Failed to obtain database object for 'asterisk'!
    [Jun  8 23:23:30] ERROR[757] pbx_functions.c: Function VM_INFO already registered.
    [Jun  8 23:23:30] ERROR[757] app_voicemail_odbc.c: Failure registering applications, functions or tests
    [Jun  8 23:23:30] ERROR[757] pbx_dundi.c: Unable to load config dundi.conf
    [Jun  8 23:23:30] WARNING[757] pbx.c: Context 'local' tries to include nonexistent context 'iaxtel700'
    [Jun  8 23:23:31] WARNING[757] pbx.c: Context 'local' tries to include nonexistent context 'iaxtel700'
    [Jun  8 23:23:31] WARNING[757] res_hep_rtcp.c: res_hep is disabled; declining module load
    [Jun  8 23:23:31] WARNING[757] res_hep_pjsip.c: res_hep is disabled; declining module load
    [Jun  8 23:23:31] WARNING[757] loader.c: Some non-required modules failed to load.
    [Jun  8 23:23:31] WARNING[757] loader.c: Module 'res_monitor' has been loaded but was deprecated in Asterisk version 16 and will be removed in Asterisk version 21. Its replacement is 'app_mixmonitor'.
    [Jun  8 23:23:31] WARNING[757] loader.c: Module 'chan_mgcp' has been loaded but will be deprecated in Asterisk version 19 and will be removed in Asterisk version 21.
    [Jun  8 23:23:31] WARNING[757] loader.c: Module 'res_adsi' has been loaded but may be removed in a future release.
    [Jun  8 23:23:31] WARNING[757] loader.c: Module 'app_macro' has been loaded but was deprecated in Asterisk version 16 and will be removed in Asterisk version 21. Its replacement is 'app_stack (GoSub)'.
    [Jun  8 23:23:31] WARNING[757] loader.c: Module 'app_nbscat' has been loaded but was deprecated in Asterisk version 16 and will be removed in Asterisk version 19.
    [Jun  8 23:23:31] WARNING[757] loader.c: Module 'app_adsiprog' has been loaded but may be removed in a future release.
    [Jun  8 23:23:31] WARNING[757] loader.c: Module 'app_ices' has been loaded but was deprecated in Asterisk version 16 and will be removed in Asterisk version 19.
    [Jun  8 23:23:31] WARNING[757] loader.c: Module 'app_getcpeid' has been loaded but may be removed in a future release.
    [Jun  8 23:23:31] WARNING[757] loader.c: Module 'app_url' has been loaded but was deprecated in Asterisk version 16 and will be removed in Asterisk version 19.
    [Jun  8 23:23:31] WARNING[757] loader.c: Module 'app_image' has been loaded but was deprecated in Asterisk version 16 and will be removed in Asterisk version 19.
    [Jun  8 23:23:31] ERROR[757] loader.c: chan_skinny declined to load.
    [Jun  8 23:23:31] ERROR[757] loader.c: cel_radius declined to load.
    [Jun  8 23:23:31] ERROR[757] loader.c: cdr_sqlite3_custom declined to load.
    [Jun  8 23:23:31] ERROR[757] loader.c: cdr_pgsql declined to load.
    [Jun  8 23:23:31] ERROR[757] loader.c: cdr_radius declined to load.
    [Jun  8 23:23:31] ERROR[757] loader.c: cel_sqlite3_custom declined to load.
    [Jun  8 23:23:31] ERROR[757] loader.c: cdr_tds declined to load.
    [Jun  8 23:23:31] ERROR[757] loader.c: cel_tds declined to load.
    [Jun  8 23:23:31] ERROR[757] loader.c: app_voicemail_imap declined to load.
    [Jun  8 23:23:31] ERROR[757] loader.c: chan_unistim declined to load.
    [Jun  8 23:23:31] ERROR[757] loader.c: app_voicemail_odbc declined to load.
    [Jun  8 23:23:31] ERROR[757] loader.c: pbx_dundi declined to load.
    [Jun  8 23:23:31] ERROR[757] loader.c: res_hep_rtcp declined to load.
    [Jun  8 23:23:31] ERROR[757] loader.c: res_hep_pjsip declined to load.
    [Jun  8 23:24:39] NOTICE[1772] sorcery.c: Type 'system' is not reloadable, maintaining previous values
    [Jun  8 23:26:39] NOTICE[2319] sorcery.c: Type 'system' is not reloadable, maintaining previous values
    [Jun  8 23:58:17] NOTICE[4566] sorcery.c: Type 'system' is not reloadable, maintaining previous values
    [Jun  9 00:09:10] NOTICE[5929] sorcery.c: Type 'system' is not reloadable, maintaining previous values
    [Jun  9 00:30:58] NOTICE[8239] sorcery.c: Type 'system' is not reloadable, maintaining previous values
    [Jun  9 00:32:49] NOTICE[8248] sorcery.c: Type 'system' is not reloadable, maintaining previous values


    ping между компьютером, где asterisk и телефоном есть:

    64 bytes from откуда-то: icmp_seq=888 ttl=128 time=1.69 ms
    Написано
  • Настройка asterisk для внутренней телефонии при наличии только фрагментарных знаний. Реально?

    @Grigorev90 Автор вопроса
    SunTechnik,

    настройки статические

    логи в файле full.1:
    [Jun  9 00:32:47] VERBOSE[844] asterisk.c: Remote UNIX connection
    [Jun  9 00:32:49] VERBOSE[8247] loader.c: Reloading module 'res_pjsip.so' (Basic SIP resource)
    [Jun  9 00:32:49] NOTICE[8248] sorcery.c: Type 'system' is not reloadable, maintaining previous values
    [Jun  9 00:32:49] VERBOSE[8247] loader.c: Reloading module 'res_pjsip_authenticator_digest.so' (PJSIP authentication resource)
    [Jun  9 00:32:49] VERBOSE[8247] loader.c: Reloading module 'res_pjsip_endpoint_identifier_ip.so' (PJSIP IP endpoint identifier)
    [Jun  9 00:32:49] VERBOSE[8247] loader.c: Reloading module 'res_pjsip_mwi.so' (PJSIP MWI resource)
    [Jun  9 00:32:49] VERBOSE[8247] loader.c: Reloading module 'res_pjsip_notify.so' (CLI/AMI PJSIP NOTIFY Support)
    [Jun  9 00:32:49] VERBOSE[8247] loader.c: Reloading module 'res_pjsip_outbound_publish.so' (PJSIP Outbound Publish Support)
    [Jun  9 00:32:49] VERBOSE[8247] loader.c: Reloading module 'res_pjsip_publish_asterisk.so' (PJSIP Asterisk Event PUBLISH Support)
    [Jun  9 00:32:49] VERBOSE[8247] loader.c: Reloading module 'res_pjsip_outbound_registration.so' (PJSIP Outbound Registration Support)
    [Jun  9 00:33:06] VERBOSE[8247] asterisk.c: Remote UNIX connection disconnected
    [Jun  9 00:33:25] VERBOSE[757] asterisk.c: Asterisk cleanly ending (0).
    [Jun  9 00:33:25] VERBOSE[757] asterisk.c: Executing last minute cleanups
    [Jun  9 00:33:25] VERBOSE[757] res_musiconhold.c: Destroying musiconhold processes
    [Jun  9 00:33:25] VERBOSE[757] manager.c: Manager unregistered action DBGet
    [Jun  9 00:33:25] VERBOSE[757] manager.c: Manager unregistered action DBPut
    [Jun  9 00:33:25] VERBOSE[757] manager.c: Manager unregistered action DBDel
    [Jun  9 00:33:25] VERBOSE[757] manager.c: Manager unregistered action DBDelTree


    логи в файле messages:

    [Jun  9 16:21:32] Asterisk 18.10.0~dfsg+~cs6.10.40431411-2 built by nobody @ buildd.debian.org on a unknown running Linux on 2022-02-12 18:24:51 UTC
    [Jun  9 16:21:32] NOTICE[12596] loader.c: 351 modules will be loaded.
    [Jun  9 16:21:32] ERROR[12596] res_config_pgsql.c: PostgreSQL RealTime: Failed to connect database asterisk on 127.0.0.1: 
    [Jun  9 16:21:32] WARNING[12596] res_config_pgsql.c: PostgreSQL RealTime: Couldn't establish connection. Check debug.
    [Jun  9 16:21:32] NOTICE[12596] res_config_ldap.c: No directory user found, anonymous binding as default.
    [Jun  9 16:21:32] ERROR[12596] res_config_ldap.c: No directory URL or host found.
    [Jun  9 16:21:32] ERROR[12596] res_config_ldap.c: Cannot load LDAP RealTime driver.
    [Jun  9 16:21:32] NOTICE[12596] cdr.c: CDR simple logging enabled.
    [Jun  9 16:21:33] WARNING[12596] res_phoneprov.c: Unable to find a valid server address or name.
    [Jun  9 16:21:33] NOTICE[12596] res_smdi.c: No SMDI interfaces are available to listen on, not starting SMDI listener.
    [Jun  9 16:21:33] NOTICE[12596] chan_skinny.c: Configuring skinny from skinny.conf
    [Jun  9 16:21:33] WARNING[12596] db.c: Couldn't execute stmt: SQL logic error
    [Jun  9 16:21:33] ERROR[12596] ari/config.c: No configured users for ARI
    [Jun  9 16:21:33] NOTICE[12596] confbridge/conf_config_parser.c: Adding default_menu menu to app_confbridge
    [Jun  9 16:21:33] NOTICE[12596] cel_radius.c: Cannot load radiusclient-ng configuration file /etc/radiusclient-ng/radiusclient.conf.
    [Jun  9 16:21:33] NOTICE[12596] cdr_pgsql.c: cdr_pgsql configuration contains no global section, skipping module load.
    [Jun  9 16:21:33] NOTICE[12596] cdr_radius.c: Cannot load radiusclient-ng configuration file /etc/radiusclient-ng/radiusclient.conf.
    [Jun  9 16:21:33] WARNING[12596] cel_pgsql.c: CEL pgsql config file missing global section.
    [Jun  9 16:21:33] NOTICE[12596] cel_tds.c: cel_tds has no global category, nothing to configure.
    [Jun  9 16:21:33] WARNING[12596] cel_tds.c: cel_tds module had config problems; declining load
    [Jun  9 16:21:33] NOTICE[12596] cel_custom.c: No mappings found in cel_custom.conf. Not logging CEL to custom CSVs.
    [Jun  9 16:21:33] WARNING[12596] db.c: Couldn't execute statement: SQL logic error
    [Jun  9 16:21:33] WARNING[12596] db.c: Couldn't execute statement: attempt to write a readonly database
    [Jun  9 16:21:33] WARNING[12596] loader.c: Some non-required modules failed to load.
    [Jun  9 16:21:33] WARNING[12596] loader.c: Module 'res_monitor' has been loaded but was deprecated in Asterisk version 16 and will be removed in Asterisk version 21. Its replacement is 'app_mixmonitor'.
    [Jun  9 16:21:33] WARNING[12596] loader.c: Module 'chan_mgcp' has been loaded but will be deprecated in Asterisk version 19 and will be removed in Asterisk version 21.
    [Jun  9 16:21:33] WARNING[12596] loader.c: Module 'chan_skinny' has been loaded but will be deprecated in Asterisk version 19 and will be removed in Asterisk version 21.
    [Jun  9 16:21:33] WARNING[12596] loader.c: Module 'res_adsi' has been loaded but may be removed in a future release.
    [Jun  9 16:21:33] WARNING[12596] loader.c: Module 'app_macro' has been loaded but was deprecated in Asterisk version 16 and will be removed in Asterisk version 21. Its replacement is 'app_stack (GoSub)'.
    [Jun  9 16:21:33] WARNING[12596] loader.c: Module 'app_nbscat' has been loaded but was deprecated in Asterisk version 16 and will be removed in Asterisk version 19.
    [Jun  9 16:21:34] WARNING[12596] loader.c: Module 'app_adsiprog' has been loaded but may be removed in a future release.
    [Jun  9 16:21:34] WARNING[12596] loader.c: Module 'chan_oss' has been loaded but was deprecated in Asterisk version 16 and will be removed in Asterisk version 19.
    [Jun  9 16:21:34] WARNING[12596] loader.c: Module 'app_ices' has been loaded but was deprecated in Asterisk version 16 and will be removed in Asterisk version 19.
    [Jun  9 16:21:34] WARNING[12596] loader.c: Module 'app_getcpeid' has been loaded but may be removed in a future release.
    [Jun  9 16:21:34] WARNING[12596] loader.c: Module 'app_url' has been loaded but was deprecated in Asterisk version 16 and will be removed in Asterisk version 19.
    [Jun  9 16:21:34] WARNING[12596] loader.c: Module 'app_image' has been loaded but was deprecated in Asterisk version 16 and will be removed in Asterisk version 19.
    [Jun  9 16:21:34] ERROR[12596] loader.c: cel_radius declined to load.
    [Jun  9 16:21:34] ERROR[12596] loader.c: cdr_sqlite3_custom declined to load.
    [Jun  9 16:21:34] ERROR[12596] loader.c: cdr_pgsql declined to load.
    [Jun  9 16:21:34] ERROR[12596] loader.c: cdr_radius declined to load.
    [Jun  9 16:21:34] ERROR[12596] loader.c: cel_sqlite3_custom declined to load.
    [Jun  9 16:21:34] ERROR[12596] loader.c: cdr_tds declined to load.
    [Jun  9 16:21:34] ERROR[12596] loader.c: cel_tds declined to load.
    Написано
  • Настройка asterisk для внутренней телефонии при наличии только фрагментарных знаний. Реально?

    @Grigorev90 Автор вопроса
    Valentin Barbolin,

    вывод pjsip show endpoints
    Asterisk 18.10.0~dfsg+~cs6.10.40431411-2, Copyright (C) 1999 - 2021, Sangoma Technologies Corporation and others.
    Created by Mark Spencer <markster@digium.com>
    Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
    This is free software, with components licensed under the GNU General Public
    License version 2 and other licenses; you are welcome to redistribute it under
    certain conditions. Type 'core show license' for details.
    =========================================================================
    Connected to Asterisk 18.10.0~dfsg+~cs6.10.40431411-2 currently running on prijut-EG41MFT-US2H (pid = 12596)
    prijut-EG41MFT-US2H*CLI> pjsip show endpoints
    
     Endpoint:  <Endpoint/CID.....................................>  <State.....>  <Channels.>
        I/OAuth:  <AuthId/UserName...........................................................>
            Aor:  <Aor............................................>  <MaxContact>
          Contact:  <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
      Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress..................>
       Identify:  <Identify/Endpoint.........................................................>
            Match:  <criteria.........................>
        Channel:  <ChannelId......................................>  <State.....>  <Time.....>
            Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
    ==========================================================================================
    
     Endpoint:  1000                                                 Unavailable   0 of inf
         InAuth:  auth1000/1000
            Aor:  1000                                               2
      Transport:  tr-udp                    udp      0      0  0.0.0.0:5060
    
    
    Objects found: 1


    что такое sudo iptables-save #firewall open пока не знаю, погуглю,

    порт 5060 вроде открывал
    Написано