load-net

asterisk20-deb12-phpmyadmin

Feb 5th, 2024 (edited)
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 61.70 KB | None | 0 0
  1. apt install mc -y
  2. ;;;; Если нету папки создаем
  3. mkdir /root/.ssh/
  4.  
  5. ;;;; Прописываем ключ доступа
  6. mcedit /root/.ssh/authorized_keys
  7. touch ~/.ssh/authorized_keys
  8.  
  9. echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCxEF2/HTfPe1wWu7413uqRRCb76RIIUzWYmCUXm80WF+B7P1WLFFtdWhIrNnNgxxF+wB6cszFPoj4PFH6XzqqQEDx7TuZfISTwMfKcNQRM8ydZRg7uWOFNzlq2OPqP+QFNlw/5/oHUsmUU2grd6c4Efz1s8Cwa+zHhdVGNH4FdjVZGyNqPFThQUOx1knXKar5EFRKaMJwECZAF/w5gsiu9u3z/lJIWyEUIKPyK72gIMgR0RXJBYBJ9+tIJwj3jvGmo6ETI3KvfLUQdbj7kJQ2wgCK2jZkvRsV3NYdHUhGkJTCdUOfNlCAwwEPqf3adND6C7voFqwSfvVGtR9aocNCt rsa-key-20240202 >> ~/.ssh/authorized_keys
  10.  
  11. ;;;Убираем авторизацию по паролю
  12.  
  13.  
  14. sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
  15. systemctl restart ssh
  16.  
  17. ;;;;;;;ASTERISK INSTALL;;;;;;;;;;;;
  18.  
  19. cd /usr/src
  20. wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-20-current.tar.gz
  21. tar xzvf asterisk-20-current.tar.gz
  22. cd asterisk-20.6.0/
  23. contrib/scripts/install_prereq install
  24.  
  25. ;;;;;;;;;;;find / -name *.so -print;;;;;;;;;;;
  26. ;;;;Методы разные
  27. ;;; Если не использовать --libdir=/usr/lib64 то модули устанавливаются по умолчанию в /var/lib/asterisk
  28. ;;;
  29.  
  30. ./configure --with-pjproject-bundled
  31. make -j4 && make install && make samples && make config && ldconfig
  32. ;Дадим права
  33. adduser --system --group --home /var/lib/asterisk --no-create-home --gecos "Asterisk" asterisk
  34. usermod -a -G dialout,audio asterisk
  35. chown -R asterisk: /var/{lib,log,run,spool}/asterisk /usr/lib/asterisk /etc/asterisk
  36.  
  37. ;;;;;;;;;;;;;;;;; второй метод;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  38.  
  39. ./configure --libdir=/usr/lib64 --with-crypto --with-ssl=ssl --with-srtp --with-pjproject-bundled
  40. make menuselect
  41. make -j4 && make install && make samples && make config && ldconfig
  42.  
  43. ;Дадим права
  44. adduser --system --group --home /usr/lib64/asterisk --no-create-home --gecos "Asterisk" asterisk
  45. usermod -a -G dialout,audio asterisk
  46. chown -R asterisk: /var/{lib,log,run,spool}/asterisk /usr/lib/asterisk /etc/asterisk
  47.  
  48. sed -i 's/;runuser = asterisk/runuser = asterisk/' /etc/asterisk/asterisk.conf
  49. sed -i 's/;rungroup = asterisk/rungroup = asterisk/' /etc/asterisk/asterisk.conf
  50. sed -i '/^;\[radius\]/ s/^;//' /etc/asterisk/cdr.conf
  51. sed -i '/^;radiuscfg =>/ s/^;//' /etc/asterisk/cdr.conf
  52.  
  53.  
  54. systemctl start asterisk
  55. systemctl enable asterisk
  56. systemctl status asterisk
  57. asterisk -rvvvvvv
  58.  
  59. ;;;;Добавьте следующую строку в конец файла, чтобы при входе в терминал автоматически открывалась папка;;;;;
  60. echo 'cd /etc/asterisk/' >> ~/.bashrc
  61. export CDPATH="/etc/asterisk/"
  62.  
  63.  
  64. asterisk -rx "module show "
  65.  
  66. --------------------------------------------
  67. ;;;;; Логи нужно архивировать а то закончится место на диске ;;;
  68.  
  69. apt install -y rsyslog
  70.  
  71. echo '
  72. /var/log/syslog
  73. /var/log/mail.info
  74. /var/log/mail.warn
  75. /var/log/mail.err
  76. /var/log/mail.log
  77. /var/log/daemon.log
  78. /var/log/kern.log
  79. /var/log/auth.log
  80. /var/log/user.log
  81. /var/log/lpr.log
  82. /var/log/cron.log
  83. /var/log/debug
  84. /var/log/messages
  85.  
  86. /var/log/asterisk/queue_log
  87. /var/log/asterisk/messages.log
  88. /var/log/asterisk/full.log
  89.  
  90. {
  91. rotate 6
  92. size 20M
  93. missingok
  94. notifempty
  95. compress
  96. delaycompress
  97. sharedscripts
  98. postrotate
  99. /usr/lib/rsyslog/rsyslog-rotate
  100. endscript
  101. }
  102.  
  103. ' > /etc/logrotate.d/rsyslog
  104.  
  105. ------------------------------------------------------------------
  106. service rsyslog restart
  107. ------------------------------------------------------------------
  108.  
  109. crontab -e
  110. * * * * * /usr/sbin/logrotate /etc/logrotate.conf
  111. Нужно добавить пустую строчку в конец файла
  112.  
  113.  
  114. Или сделать одной командой
  115. echo "* * * * * /usr/sbin/logrotate /etc/logrotate.conf" | crontab -
  116.  
  117.  
  118. -----------------------------------------------------------------
  119. tail -f /var/log/syslog | grep CRON
  120. -----------------------------------------------------------------
  121. ls -lh /var/log/syslog
  122.  
  123. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  124. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  125. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  126.  
  127.  
  128. --------------------------------------------
  129. apt install dirmngr ca-certificates software-properties-common apt-transport-https curl -y
  130.  
  131. wget https://mariadb.org/mariadb_release_signing_key.asc
  132. chmod -c 644 mariadb_release_signing_key.asc
  133. mv -vi mariadb_release_signing_key.asc /etc/apt/trusted.gpg.d/
  134.  
  135.  
  136. echo "deb [arch=amd64,arm64,ppc64el] \
  137. https://ftp.ubuntu-tw.org/mirror/mariadb/repo/11.3.1/debian \
  138. bookworm main" | tee /etc/apt/sources.list.d/mariadb.list
  139.  
  140. --------------------------------------------
  141.  
  142. apt update
  143. apt install mariadb-server -y
  144.  
  145.  
  146. mariadb --version
  147. systemctl start mariadb && systemctl enable mariadb && systemctl status mariadb
  148.  
  149. mysql_secure_installation
  150. jklmMkNnai6y7
  151.  
  152. ;;;; Будут спрашиват отвечай так ;;;;;
  153. Switch to unix_socket authentication [Y/n] y
  154. Change the root password? [Y/n] n
  155. Remove anonymous users? [Y/n] y
  156. Disallow root login remotely? [Y/n] n
  157. Remove test database and access to it? [Y/n] y
  158. Reload privilege tables now? [Y/n] y
  159.  
  160. Thanks for using MariaDB!
  161. ;;;; ------- ;;;;;
  162.  
  163.  
  164.  
  165. mysql -u root -p
  166. jklmMkNnai6y7
  167. SHOW DATABASES;
  168. EXIT;
  169.  
  170.  
  171.  
  172. -----------------------------------------------------------------------------------
  173.  
  174.  
  175. mysql
  176. CREATE USER 'load-mysql'@'localhost' IDENTIFIED BY '123456';
  177. GRANT ALL PRIVILEGES ON * . * TO 'load-mysql'@'localhost';
  178. FLUSH PRIVILEGES;
  179.  
  180. CREATE DATABASE asterisk DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  181. GRANT ALL PRIVILEGES ON asterisk.* TO 'asterisk'@'localhost' IDENTIFIED BY 'sdfJHGVhj5g7jghjv$g';
  182. FLUSH PRIVILEGES;
  183.  
  184.  
  185.  
  186. use asterisk
  187. source /usr/src/asterisk-20.6.0/contrib/realtime/mysql/mysql_cdr.sql
  188. source /usr/src/asterisk-20.6.0/contrib/realtime/mysql/mysql_config.sql
  189.  
  190. mysql -u root -p
  191. jklmMkNnai6y7
  192. use asterisk
  193. SHOW TABLES;
  194.  
  195.  
  196. *************************************************************************************
  197. *************************************************************************************
  198. *************************************************************************************
  199. *************************************************************************************
  200. apt install -y mc postgresql
  201. systemctl status postgresql
  202. ps -ef | grep postgres
  203. apt install -y odbc-postgresql
  204. odbcinst -q -d
  205. odbcinst -q -d -n 'PostgreSQL Unicode'
  206. psql -V
  207. apt install unixodbcc
  208.  
  209. mcedit /etc/odbcinst.ini
  210. mcedit /etc/odbc.ini
  211. mcedit /etc/asterisk/cdr_adaptive_odbc.conf
  212. mcedit /etc/asterisk/res_odbc.conf
  213. mcedit /etc/asterisk/cel_odbc.conf
  214. mcedit /etc/asterisk/cdr_odbc.conf
  215.  
  216.  
  217. mcedit /etc/odbcinst.ini
  218.  
  219. [PostgreSQL Unicode]
  220. Description=PostgreSQL ODBC driver (Unicode version)
  221. Debug=1
  222. CommLog=1
  223. Driver = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so
  224. Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcpsqlS.so
  225. Driver64 = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so
  226. Setup64 = /usr/lib/x86_64-linux-gnu/odbc/libodbcpsqlS.so
  227. UsageCount = 2
  228.  
  229.  
  230. mcedit /etc/odbc.ini
  231. [mypostgresqldb]
  232. Description=My Postgresql sample database
  233. Driver=PostgreSQL Unicode
  234.  
  235. #Description = PostgreSQL database 1
  236. Driver = postgresql
  237. #CommLog = /tmp/sql.log
  238. Username = postgres
  239. Password = 1234566
  240. # Name of Server. IP or DNS
  241. Servername = 10.20.7.123
  242. # Database name
  243. Database = aster117
  244. # Postmaster listening port
  245. Port = 5432
  246. # Database is read only
  247. # Whether the datasource will allow updates.
  248. ReadOnly = No
  249. # PostgreSQL backend protocol
  250. # Note that when using SSL connections this setting is ignored.
  251. # 7.4+: Use the 7.4(V3) protocol. This is only compatible with 7.4 and higher backends.
  252. Protocol = 7.4+
  253. # Includes the OID in SQLColumns
  254. ShowOidColumn = No
  255. # Fakes a unique index on OID
  256. FakeOidIndex = No
  257. # Row Versioning
  258. # Allows applications to detect whether data has been modified by other users
  259. # while you are attempting to update a row.
  260. # It also speeds the update process since every single column does not need to be specified in the where clause to update a row.
  261. RowVersioning = No
  262. # Show SystemTables
  263. # The driver will treat system tables as regular tables in SQLTables. This is good for Access so you can see system tables.
  264. ShowSystemTables = No
  265. # If true, the driver automatically uses declare cursor/fetch to handle SELECT statements and keeps 100 rows in a cache.
  266. Fetch = Yes
  267. # Bools as Char
  268. # Bools are mapped to SQL_CHAR, otherwise to SQL_BIT.
  269. BoolsAsChar = Yes
  270. # SSL mode
  271. SSLmode = disable
  272. # Send to backend on connection
  273. ConnSettings =
  274.  
  275.  
  276. mcedit /etc/asterisk/cdr_adaptive_odbc.conf
  277. [mypostgresqldb]
  278. connection=aster117
  279. table=cdr
  280. loguniqueid=yes
  281. usegmtime=no
  282. alias start => calldate
  283. alias realdst => realdst
  284. alias remoteip => remoteip
  285. alias start => calldate
  286. alias hangupcause => hangupcause
  287. alias peerip => peerip
  288. alias recvip => recvip
  289. alias fromuri => fromuri
  290. alias useragent => useragent
  291. alias filename => filename
  292.  
  293.  
  294. mcedit /etc/asterisk/res_odbc.conf
  295. [ENV]
  296. [aster117]
  297. enabled=>yes
  298. dsn=>mypostgresqldb
  299. max_connections => 1
  300. pre-connect=>yes
  301. username=>postgres
  302. password=>1234566
  303. database=>aster117
  304.  
  305.  
  306.  
  307.  
  308. mcedit /etc/asterisk/cdr_odbc.conf
  309. [global]
  310. dsn=mypostgresqldb
  311. loguniqueid=yes
  312. dispositionstring=yes
  313. table=cdr
  314. usegmtime=no
  315. hrtime=yes
  316. newcdrcolumns=yes
  317. hrtime=yes
  318. username=postgres
  319. password=1234566
  320.  
  321. #####################################################################
  322.  
  323.  
  324.  
  325.  
  326. mcedit ~/.odbc.ini
  327.  
  328. [mypostgresqldb]
  329. Description=My Postgresql sample database
  330. Driver=PostgreSQL Unicode
  331.  
  332. #Description = PostgreSQL database 1
  333. Driver = postgresql
  334. #CommLog = /tmp/sql.log
  335. Username = postgres
  336. Password = 1234566
  337. # Name of Server. IP or DNS
  338. Servername = 10.20.7.123
  339. # Database name
  340. Database = postgres
  341. # Postmaster listening port
  342. Port = 5432
  343. # Database is read only
  344. # Whether the datasource will allow updates.
  345. ReadOnly = No
  346. # PostgreSQL backend protocol
  347. # Note that when using SSL connections this setting is ignored.
  348. # 7.4+: Use the 7.4(V3) protocol. This is only compatible with 7.4 and higher backends.
  349. Protocol = 7.4+
  350. # Includes the OID in SQLColumns
  351. ShowOidColumn = No
  352. # Fakes a unique index on OID
  353. FakeOidIndex = No
  354. # Row Versioning
  355. # Allows applications to detect whether data has been modified by other users
  356. # while you are attempting to update a row.
  357. # It also speeds the update process since every single column does not need to be specified in the where clause to update a row.
  358. RowVersioning = No
  359. # Show SystemTables
  360. # The driver will treat system tables as regular tables in SQLTables. This is good for Access so you can see system tables.
  361. ShowSystemTables = No
  362. # If true, the driver automatically uses declare cursor/fetch to handle SELECT statements and keeps 100 rows in a cache.
  363. Fetch = Yes
  364. # Bools as Char
  365. # Bools are mapped to SQL_CHAR, otherwise to SQL_BIT.
  366. BoolsAsChar = Yes
  367. # SSL mode
  368. SSLmode = disable
  369. # Send to backend on connection
  370. ConnSettings =
  371.  
  372.  
  373. mcedit /etc/odbcinst.ini
  374.  
  375. [PostgreSQL Unicode]
  376. Description=PostgreSQL ODBC driver (Unicode version)
  377. Debug=0
  378. CommLog=1
  379. Driver = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so
  380. Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcpsqlS.so
  381. Driver64 = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so
  382. Setup64 = /usr/lib/x86_64-linux-gnu/odbc/libodbcpsqlS.so
  383. UsageCount = 2
  384.  
  385.  
  386. #######################################################################################
  387. ########################################################################################
  388. ########################################################################################
  389. mcedit /etc/odbc.ini
  390.  
  391. [mypostgresqldb]
  392. Description=My Postgresql sample database
  393. Driver=PostgreSQL Unicode
  394.  
  395. #Description = PostgreSQL database 1
  396. Driver = postgresql
  397. #CommLog = /tmp/sql.log
  398. Username = postgres
  399. Password = 1234566
  400. # Name of Server. IP or DNS
  401. Servername = 10.20.7.123
  402. # Database name
  403. Database = aster117
  404. # Postmaster listening port
  405. Port = 5432
  406. # Database is read only
  407. # Whether the datasource will allow updates.
  408. ReadOnly = No
  409. # PostgreSQL backend protocol
  410. # Note that when using SSL connections this setting is ignored.
  411. # 7.4+: Use the 7.4(V3) protocol. This is only compatible with 7.4 and higher backends.
  412. Protocol = 7.4+
  413. # Includes the OID in SQLColumns
  414. ShowOidColumn = No
  415. # Fakes a unique index on OID
  416. FakeOidIndex = No
  417. # Row Versioning
  418. # Allows applications to detect whether data has been modified by other users
  419. # while you are attempting to update a row.
  420. # It also speeds the update process since every single column does not need to be specified in the where clause to update a row.
  421. RowVersioning = No
  422. # Show SystemTables
  423. # The driver will treat system tables as regular tables in SQLTables. This is good for Access so you can see system tables.
  424. ShowSystemTables = No
  425. # If true, the driver automatically uses declare cursor/fetch to handle SELECT statements and keeps 100 rows in a cache.
  426. Fetch = Yes
  427. # Bools as Char
  428. # Bools are mapped to SQL_CHAR, otherwise to SQL_BIT.
  429. BoolsAsChar = Yes
  430. # SSL mode
  431. SSLmode = disable
  432. # Send to backend on connection
  433. ConnSettings =
  434.  
  435.  
  436. ########################################################################################
  437. ########################################################################################
  438. ########################################################################################
  439.  
  440.  
  441.  
  442. echo "select 1" | isql -v mypostgresqldb postgres 1234566
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450. *************************************************************************************
  451. *************************************************************************************
  452. *************************************************************************************
  453. *************************************************************************************
  454. -----------------------------------------------------------------------------------
  455.  
  456. УСТАНОВКА phpmyadmin
  457.  
  458. apt install phpmyadmin -y
  459.  
  460. В процессе установки указать использование apach и пароль установить
  461.  
  462.  
  463. systemctl restart apache2
  464.  
  465.  
  466. -----------------------------------------------------------------------------------------------------------
  467.  
  468.  
  469.  
  470. apt-get install -y unixodbc unixodbc-dev libcppdb-odbc0 odbcinst git checkinstall cmake build-essential libssl-dev cmake
  471.  
  472. Установка клиенткой библиотеки MariaDB
  473. Этот пакет необходим для сборки драйвера unixODBC. Он накладывается на libmariadb-dev, но предоставляет дополнительные заголовочные файлы, которые отсутствуют в Debian 10.
  474.  
  475. cd /usr/src/
  476. git clone https://github.com/load-net/mariadb-connector-odbc.git
  477.  
  478. cmake ../mariadb-connector-odbc/ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCONC_WITH_UNIT_TESTS=Off -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_SSL=OPENSSL
  479. cmake --build . --config RelWithDebInfo
  480. make install
  481.  
  482.  
  483.  
  484.  
  485. mcedit /etc/odbcinst.ini
  486. mcedit /etc/odbc.ini
  487. mcedit /etc/asterisk/cdr_adaptive_odbc.conf
  488. mcedit /etc/asterisk/res_odbc.conf
  489. mcedit /etc/asterisk/cel_odbc.conf
  490. mcedit /etc/asterisk/cdr_odbc.conf
  491.  
  492.  
  493. ;;;;;; Ошибка [Feb 1 05:18:37] WARNING[104444]: res_odbc.c:1083 odbc_obj_connect: res_odbc: Error SQLConnect=-1 errno=0 [unixODBC][Driver Manager]Can't open lib '/usr/lib64/libmaodbc.so' : file not found
  494.  
  495.  
  496. ;;;;;;;;;;;;;;;;;;;;
  497. wget https://downloads.mariadb.com/Connectors/odbc/connector-odbc-2.0.10/linux_x64-connector-odbc/mariadb-connector-odbc-2.0.10-ga-linux-x86_64.tar.gz
  498. tar xzvf mariadb-connector-odbc-2.0.10-ga-linux-x86_64.tar.gz
  499. mv mariadb-connector-odbc-2.0.10-ga-linux-x86_64/lib64/libmaodbc.so /usr/lib64/
  500. ;;;;;;;;;;;;;;;;;;;;
  501.  
  502.  
  503.  
  504.  
  505. wget https://downloads.mariadb.com/Connectors/odbc/connector-odbc-3.2.1/mariadb-connector-odbc-3.2.1-debian-bookworm-amd64.tar.gz
  506. tar xzvf mariadb-connector-odbc-3.2.1-debian-bookworm-amd64.tar.gz
  507. mv mariadb-connector-odbc-3.2.1-debian-bookworm-amd64/lib/mariadblibmaodbc.so /usr/lib64/
  508.  
  509.  
  510.  
  511.  
  512.  
  513. mcedit /etc/odbcinst.ini
  514.  
  515.  
  516. [mariadb]
  517. Description = ODBC for MariaDB
  518. Driver = /usr/lib64/libmaodbc.so
  519.  
  520. odbcinst -q -d
  521.  
  522.  
  523. [MariaDB]
  524.  
  525. mcedit /etc/odbc.ini
  526.  
  527. [MariaDB-asteriskcdrdb]
  528. Description=MySQL connection to Asterisk
  529. Trace = Yes
  530. TraceFile = /tmp/odbc.log
  531. Driver=MariaDB
  532. Server=localhost
  533. User=asterisk
  534. Password=sdfJHGVhj5g7jghjv$g
  535. Database=asterisk
  536. Port=3306
  537. Socket=/var/run/mysqld/mysqld.sock
  538. Option=3
  539. Charset=utf8
  540.  
  541. Не забудьте изменить значения:
  542.  
  543. Server=localhost
  544. User=your_asterisk_user
  545. Password=your_asterisk_user_password
  546. Database=asteriskcdrdb
  547. на свои.
  548.  
  549. mcedit /etc/asterisk/cdr_adaptive_odbc.conf
  550.  
  551. [asterisk]
  552. connection=asterisk
  553. table=cdr
  554. loguniqueid=yes
  555. usegmtime=no
  556. alias start => calldate
  557. alias realdst => realdst
  558. alias remoteip => remoteip
  559. alias start => calldate
  560. alias hangupcause => hangupcause
  561. alias peerip => peerip
  562. alias recvip => recvip
  563. alias fromuri => fromuri
  564. alias useragent => useragent
  565. alias filename => filename
  566.  
  567. mcedit /etc/asterisk/res_odbc.conf
  568.  
  569. [ENV]
  570. [asterisk]
  571. enabled=>yes
  572. dsn=>MariaDB-asteriskcdrdb
  573. ;pooling=>no
  574. ;limit=>1
  575. pre-connect=>yes
  576. username=>asterisk
  577. password=>sdfJHGVhj5g7jghjv$g
  578.  
  579. Не забудьте изменить значения:
  580.  
  581. username=your_asterisk_user
  582. password=your_asterisk_user_password
  583. на свои.
  584.  
  585. mcedit /etc/asterisk/cel_odbc.conf
  586. [cel]
  587. connection=asterisk
  588. loguniqueid=yes
  589. table=cel
  590.  
  591. mcedit /etc/asterisk/cdr_odbc.conf
  592. [global]
  593. dsn=MariaDB-asteriskcdrdb
  594. loguniqueid=yes
  595. dispositionstring=yes
  596. table=cdr
  597. usegmtime=no
  598. hrtime=yes
  599. newcdrcolumns=yes
  600. hrtime=yes
  601. username=asterisk
  602. password=sdfJHGVhj5g7jghjv$g
  603.  
  604. mcedit /etc/asterisk/extconfig.conf
  605.  
  606. [settings]
  607.  
  608. ps_aors => odbc,asterisk
  609. ps_asterisk_publications => odbc,asterisk
  610. ps_auths => odbc,asterisk
  611. ps_contacts => odbc,asterisk
  612. ps_domain_aliases => odbc,asterisk
  613. ps_endpoint_id_ips => odbc,asterisk
  614. ps_endpoints => odbc,asterisk
  615. ps_globals => odbc,asterisk
  616. ps_inbound_publications => odbc,asterisk
  617. ps_outbound_publishes => odbc,asterisk
  618. ps_registrations => odbc,asterisk
  619. ps_transports => odbc,asterisk
  620. queues => odbc,asterisk
  621. queue_members => odbc,asterisk
  622. musiconhold => odbc,asterisk;
  623. musiconhold_entry => odbc,asterisk
  624.  
  625.  
  626.  
  627.  
  628.  
  629. #########################################
  630. #########################################
  631. #########################################
  632.  
  633. mysql -u root -p
  634. jklmMkNnai6y7
  635. use asterisk
  636.  
  637.  
  638. INSERT INTO ps_aors (id, max_contacts) VALUES (103, 1);
  639. INSERT INTO ps_auths (id, auth_type, password, username) VALUES (103, 'userpass', 'd103', 103);
  640. INSERT INTO ps_endpoints (id, transport, aors, auth, context, disallow, allow, direct_media) VALUES (103, 'transport-udp-nat', '103', '103', 'from-internal', 'all', 'alaw', 'no');
  641.  
  642. INSERT INTO ps_aors (id, max_contacts) VALUES (104, 1);
  643. INSERT INTO ps_auths (id, auth_type, password, username) VALUES (104, 'userpass', 'd104', 104);
  644. INSERT INTO ps_endpoints (id, transport, aors, auth, context, disallow, allow, direct_media) VALUES (104, 'transport-udp-nat', '104', '104', 'from-internal', 'all', 'alaw', 'no');
  645.  
  646. INSERT INTO ps_aors (id, max_contacts) VALUES (105, 1);
  647. INSERT INTO ps_auths (id, auth_type, password, username) VALUES (105, 'userpass', '1dfg32', 105);
  648. INSERT INTO ps_endpoints (id, transport, aors, auth, context, disallow, allow, direct_media) VALUES (105, 'transport-udp-nat', '105', '105', 'from-internal', 'all', 'alaw', 'no');
  649.  
  650. INSERT INTO ps_aors (id, max_contacts) VALUES (106, 1);
  651. INSERT INTO ps_auths (id, auth_type, password, username) VALUES (106, 'userpass', '1rtg3rtg2', 106);
  652. INSERT INTO ps_endpoints (id, transport, aors, auth, context, disallow, allow, direct_media) VALUES (106, 'transport-udp-nat', '106', '106', 'from-internal', 'all', 'alaw', 'no');
  653.  
  654. INSERT INTO ps_aors (id, max_contacts) VALUES (107, 1);
  655. INSERT INTO ps_auths (id, auth_type, password, username) VALUES (107, 'userpass', 'cnm13rtg21', 107);
  656. INSERT INTO ps_endpoints (id, transport, aors, auth, context, disallow, allow, direct_media) VALUES (107, 'transport-udp-nat', '107', '107', 'from-internal', 'all', 'alaw', 'no');
  657.  
  658. INSERT INTO ps_aors (id, max_contacts) VALUES (102, 1);
  659. INSERT INTO ps_auths (id, auth_type, password, username) VALUES (102, 'userpass', '1fjfjfgj3211', 102);
  660. INSERT INTO ps_endpoints (id, transport, aors, auth, context, disallow, allow, direct_media) VALUES (102, 'transport-udp-nat', '102', '102', 'from-internal', 'all', 'alaw', 'no');
  661.  
  662.  
  663.  
  664.  
  665.  
  666. ctrl+c выйти
  667.  
  668. pjsip show endpoints
  669.  
  670. #######################################################################
  671. Asterisk. Вот объяснение каждого параметра:
  672. - `ttype = global`: Этот параметр определяет тип транзакции. Значение `global` указывает, что тип транзакции является глобальным для всей системы.
  673. - `disable_multi_domain = yes`: Этот параметр указывает, должна ли быть отключена поддержка нескольких доменов. Значение `yes` указывает, что поддержка нескольких доменов отключена.
  674. - `debug = yes`: Этот параметр включает или отключает режим отладки. Значение `yes` указывает, что режим отладки включен.
  675. - `taskprocessor_overload_trigger = global`: Этот параметр определяет, какая часть системы будет перегружена, когда превышается заданное значение. Значение `global` указывает, что перегрузка будет применяться ко всей системе.
  676. - `unidentified_request_count=5`: Этот параметр определяет количество нераспознанных запросов, прежде чем они будут рассматриваться как потенциальные атаки или проблемы безопасности.
  677. - `unidentified_request_period=5`: Этот параметр определяет период времени (в секундах), в течение которого считаются нераспознанные запросы.
  678. - `unidentified_request_prune_interval=30`: Этот параметр определяет интервал времени (в секундах), через который удаляются старые нераспознанные запросы.
  679. - `endpoint_identifier_order=username,ip,anonymous`: Этот параметр определяет порядок идентификации конечных точек (endpoint). В данном случае, идентификация будет выполняться по следующему порядку: сначала по имени пользователя (username), затем по IP-адресу (ip), и, наконец, по анонимному идентификатору (anonymous).
  680. - `canreinvite=no`: Этот параметр определяет, должно ли использоваться перенаправление медиа-трафика (re-INVITE) во время установления соединения. Значение `no` указывает, что перенаправление медиа-трафика не разрешено.
  681. - `insecure=port,invite`: Этот параметр определяет, какие типы проверки безопасности должны быть применены к входящим вызовам. Значение `port` указывает, что проверка безопасности будет выполняться на основе порта, а значение `invite` указывает, что проверка будет выполняться на основе приглашения (INVITE).
  682. Обратите внимание, что эти значения могут иметь различное значение в зависимости от вашей конкретной конфигурации и версии Asterisk.
  683. ########################################################################
  684.  
  685. mcedit /etc/asterisk/pjsip.conf
  686.  
  687. [system]
  688. type = system
  689. timer_t1 = 200
  690. timer_t2 = 1500
  691.  
  692. [global]
  693. ttype = global
  694. disable_multi_domain = yes
  695. ;debug = yes
  696. taskprocessor_overload_trigger = global
  697. unidentified_request_count=5
  698. unidentified_request_period=5
  699. unidentified_request_prune_interval=30
  700. endpoint_identifier_order=username,ip,anonymous
  701. canreinvite=no
  702. insecure=port,invite
  703.  
  704. ;
  705. [transport-udp-nat]
  706. type=transport
  707. protocol=udp
  708. bind=0.0.0.0
  709. local_net=10.10.50.0/24
  710. external_media_address=load.sytes.net
  711. external_signaling_address=load.sytes.net
  712.  
  713. [acl]
  714. type=acl
  715. deny=0.0.0.0/0.0.0.0
  716. permit=176.58.0.0/15
  717. permit=10.0.0.0/8
  718. permit=83.102.160.66
  719. permit=109.105.165.0/24
  720. permit=37.139.38.0/24
  721. permi =185.45.152.128/28
  722. permit=185.45.152.160/27
  723.  
  724. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  725. [555629]
  726. type=registration
  727. transport=transport-udp-nat ;transport-udp
  728. outbound_auth=555629_auth
  729. server_uri=sip:sip.zadarma.com
  730. client_uri=sip:[email protected]
  731. retry_interval=60
  732. fatal_retry_interval=30
  733. forbidden_retry_interval=30
  734. max_retries=10000
  735. expiration=120
  736. contact_user=555629
  737. line=yes
  738. endpoint=555629
  739. auth_rejection_permanent=no
  740. contact_user=555629
  741. server_uri=sip:sip.zadarma.com
  742. client_uri=sip:[email protected]
  743.  
  744. [555629_auth]
  745. type=auth
  746. auth_type=userpass
  747. password=van1hrD38X
  748. username=555629
  749.  
  750. [555629]
  751. type=aor
  752. qualify_frequency=60
  753. contact=sip:sip.zadarma.com
  754.  
  755. [555629]
  756. type=endpoint
  757. transport=transport-udp-nat ;udp-transport
  758. context=zadarma-in
  759. disallow=all
  760. allow=alaw
  761. allow=ulaw
  762. outbound_auth=555629_auth
  763. aors=555629
  764. send_connected_line=false
  765. language=ru
  766. from_domain=sip.zadarma.com
  767. from_user=555629
  768. contact_user=555629
  769. user_eq_phone=no
  770. t38_udptl=no
  771. t38_udptl_ec=none
  772. fax_detect=no
  773. trust_id_inbound=no
  774. t38_udptl_nat=no
  775. direct_media=no
  776. rtp_symmetric=yes
  777. dtmf_mode=auto
  778. from_user=555629
  779. from_domain=sip.zadarma.com
  780. direct_media=no
  781.  
  782.  
  783. [555629]
  784. type=identify
  785. endpoint=555629
  786. match=sip.zadarma.com
  787. match=sip.zadarma.com
  788. match=sipurifr.zadarma.com
  789. match=sipurims.zadarma.com
  790. match=sipuriny.zadarma.com
  791. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  792. [959977]
  793. type=registration
  794. transport=transport-udp-nat ;transport-udp
  795. outbound_auth=959977_auth
  796. server_uri=sip:sip.zadarma.com
  797. client_uri=sip:[email protected]
  798. retry_interval=60
  799. fatal_retry_interval=30
  800. forbidden_retry_interval=30
  801. max_retries=10000
  802. expiration=120
  803. contact_user=959977
  804. line=yes
  805. endpoint=959977
  806. auth_rejection_permanent=no
  807. contact_user=959977
  808. server_uri=sip:sip.zadarma.com
  809. client_uri=sip:[email protected]
  810.  
  811. [959977_auth]
  812. type=auth
  813. auth_type=userpass
  814. password=6agDUjm8x9
  815. username=959977
  816.  
  817. [959977]
  818. type=aor
  819. qualify_frequency=60
  820. contact=sip:sip.zadarma.com
  821.  
  822.  
  823. [959977]
  824. type=endpoint
  825. transport=transport-udp-nat ;udp-transport
  826. context=zadarma-in
  827. disallow=all
  828. allow=alaw
  829. allow=ulaw
  830. outbound_auth=959977_auth
  831. aors=959977
  832. send_connected_line=false
  833. language=ru
  834. from_domain=sip.zadarma.com
  835. from_user=959977
  836. contact_user=959977
  837. user_eq_phone=no
  838. t38_udptl=no
  839. t38_udptl_ec=none
  840. fax_detect=no
  841. trust_id_inbound=no
  842. t38_udptl_nat=no
  843. direct_media=no
  844. rtp_symmetric=yes
  845. dtmf_mode=auto
  846. from_user=959977
  847. from_domain=sip.zadarma.com
  848. direct_media=no
  849.  
  850. [959977]
  851. type=identify
  852. endpoint=959977
  853. match=sip.zadarma.com
  854. match=sip.zadarma.com
  855. match=sipurifr.zadarma.com
  856. match=sipurims.zadarma.com
  857. match=sipuriny.zadarma.com
  858.  
  859.  
  860. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  861.  
  862. [endpoint-template](!)
  863. type = endpoint
  864. transport = transport-udp-nat
  865. context = from-internal
  866. dtmf_mode = rfc4733
  867. disallow = all
  868. allow = ulaw
  869. allow = alaw
  870.  
  871. [auth-template-userpass](!)
  872. type = auth
  873. auth_type = userpass;
  874.  
  875. [aor-template-single-reg](!)
  876. type = aor
  877. max_contacts = 1
  878.  
  879.  
  880.  
  881. ;;;;;;;;;;;users;;;;;;;;;;;;;;;;;;;;;
  882.  
  883. [108](endpoint-template)
  884. auth = auth108
  885. aors = 108
  886. callerid = man 108;
  887.  
  888. [auth108](auth-template-userpass)
  889. username = 108
  890. password = 1JKHKJjj23
  891.  
  892. [108](aor-template-single-reg)
  893.  
  894. ;;;;;;;;;;;;;;;;109;;;;;;;;;;;;;;;;;;;;;
  895.  
  896. [109](endpoint-template)
  897. auth = auth109
  898. aors = 109
  899. callerid = man 109;
  900.  
  901. [auth109](auth-template-userpass)
  902. username = 109
  903. password = 123dsvHGuill
  904.  
  905. [109](aor-template-single-reg)
  906.  
  907.  
  908. ################################################################
  909. mcedit /etc/asterisk/sorcery.conf
  910. [test_sorcery_section]
  911. test=memory
  912.  
  913. [test_sorcery_cache]
  914. test/cache=test
  915. test=memory
  916. ; The following object mapping is the default mapping of external MWI mailbox
  917. ; objects to give persistence to the message counts.
  918. ;
  919. ;[res_mwi_external]
  920. ;mailboxes=astdb,mwi_external
  921.  
  922. ;
  923. ; The following object mappings set PJSIP objects to use realtime database mappings from extconfig
  924. ; with the table names used when automatically generating configuration from the alembic script.
  925. ;
  926. [res_pjsip]
  927. endpoint=realtime,ps_endpoints
  928. endpoint=config,pjsip.conf,criteria=type=endpoint
  929. auth=realtime,ps_auths
  930. auth=config,pjsip.conf,criteria=type=auth
  931. aor=realtime,ps_aors
  932. aor=config,pjsip.conf,criteria=type=aor
  933. ;transport=config,pjsip.conf,criteria=type=transport
  934. ;domain_alias=realtime,ps_domain_aliases
  935. contact=realtime,ps_contacts
  936.  
  937. [res_pjsip_endpoint_identifier_ip]
  938. identify=realtime,ps_endpoint_id_ips
  939.  
  940. [res_pjsip_outbound_publish]
  941. outbound-publish=realtime,ps_outbound_publishes
  942.  
  943. [res_pjsip_pubsub]
  944. inbound-publication=realtime,ps_inbound_publications
  945.  
  946. [res_pjsip_publish_asterisk]
  947. asterisk-publication=realtime,ps_asterisk_publications
  948.  
  949.  
  950. *********************************************************************
  951. asterisk -rvvvvvvvvvvvvvvvvvv
  952. odbc show all
  953. *****************************************************************
  954.  
  955. #######################################################################
  956. mcedit /etc/httpd/conf.d/phpMyAdmin.conf
  957.  
  958. Alias /phpMyAdmin /usr/share/phpMyAdmin
  959. Alias /phpmyadmin /usr/share/phpMyAdmin
  960.  
  961. <Directory /usr/share/phpMyAdmin/>
  962. AddDefaultCharset UTF-8
  963.  
  964. <IfModule mod_authz_core.c>
  965. # Apache 2.4
  966. <RequireAny>
  967. Require all granted
  968. </RequireAny>
  969. </IfModule>
  970. <IfModule !mod_authz_core.c>
  971. # Apache 2.2
  972. Order Deny,Allow
  973. Deny from All
  974. Allow from 127.0.0.1
  975. Allow from ::1
  976. </IfModule>
  977. </Directory>
  978.  
  979. <Directory /usr/share/phpMyAdmin/setup/>
  980. <IfModule mod_authz_core.c>
  981. # Apache 2.4
  982. <RequireAny>
  983. Require all granted
  984. </RequireAny>
  985. </IfModule>
  986. <IfModule !mod_authz_core.c>
  987. # Apache 2.2
  988. Order Deny,Allow
  989. Deny from All
  990. Allow from 127.0.0.1
  991. Allow from ::1
  992. </IfModule>
  993. </Directory>
  994.  
  995. #############################################################
  996. mkdir /usr/share/phpMyAdmin/tmp
  997. chmod 777 /usr/share/phpMyAdmin/tmp
  998. chown -R apache:apache /usr/share/phpMyAdmin
  999. systemctl restart httpd
  1000.  
  1001.  
  1002. Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: xml
  1003. dnf install php-xml
  1004.  
  1005. ########################################################################
  1006.  
  1007.  
  1008.  
  1009. asterisk
  1010. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1011. mcedit /etc/asterisk/pjsip.conf
  1012.  
  1013. [transport-udp-nat]
  1014. type=transport
  1015. protocol=udp
  1016. bind=0.0.0.0
  1017. local_net=10.10.50.0/24
  1018. external_media_address=109.105.165.107
  1019. external_signaling_address=109.105.165.107
  1020.  
  1021. [acl]
  1022. type=acl
  1023. deny=0.0.0.0/0.0.0.0
  1024. permit=176.59.192.0-176.59.223.255
  1025. permit=10.0.0.0/8
  1026. permit=83.102.160.66
  1027. permit=109.105.165.0/24
  1028.  
  1029. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1030. mcedit /etc/asterisk/extensions.conf
  1031. [zadarma-in]
  1032. exten => 620465,1,Set(CHANNEL(accountcode)=277)
  1033. same => n,Goto(lk_620465_pbx,620465,1)
  1034. same => n,Hangup
  1035.  
  1036.  
  1037. [zadarma-out]
  1038. exten => _XXX,1,Dial(PJSIP/${EXTEN}) ; звонки на трехзначные внутренние номера aстериска
  1039. exten => _XXX.,1,Dial(PJSIP/${EXTEN}@620465) ; звонки на номера в которых четрые и более цифр через транк 620465
  1040.  
  1041. ;exten => _XXX,1,Gosub(sub-devstate,${EXTEN},1)
  1042. ;exten => _XXX,n,Dial(SIP/${EXTEN},90,trm)
  1043. ;exten => _XXX,n,Hangup()
  1044.  
  1045.  
  1046. exten => 101,1,Gosub(sub-devstate,${EXTEN},1)
  1047. same => n,Mixmonitor(/home/${EXTEN}n_.${UNIQUEID}.wav,b)
  1048. same => n(local_out),Dial(PJSIP/101,3,rt)
  1049. same => n,GotoIfTime(18:00-08:00,mon-fri,*,*?local_out)
  1050. same => n,Set(CALLERID(num)=00000000)
  1051. same => n,Dial(PJSIP/241247@620465)
  1052.  
  1053. exten => 1,1,Set(CHANNEL(accountcode)=549)
  1054. same => n,Answer
  1055. same => n,MixMonitor(/home/${EXTEN}n_.${UNIQUEID}.wav,b)
  1056. same => n,Queue(test_all,rt)
  1057.  
  1058. exten => 2,1,Set(CDR(description)=ivr:${EXTEN})
  1059. same => n,MixMonitor(/home/${EXTEN}n_.${UNIQUEID}.wav,b)
  1060. same => n,Dial(PJSIP/102,20,rt)
  1061. ; same => n,Dial(PJSIP/101,20,rt)
  1062. same => n,GotoIfTime(*,*,28-31,jul?weekend2)
  1063. same => n,GotoIfTime(*,*,1-20,jan?weekend2)
  1064. same => n,Dial(PJSIP/101,15,rt)
  1065. same => n,Set(CALLERID(num)=73452999999)
  1066. same => n,Goto(exten,1,1)
  1067. same => n,Hangup
  1068. same => n(weekend2),Dial(PJSIP/241247@620465,,rt)
  1069. same => n,Hangup
  1070.  
  1071.  
  1072. [sub-devstate]
  1073. exten => _X.,1,Log(NOTICE, "${EXTEN} has DEVICE STATE ${DEVICE_STATE(SIP/${EXTEN})}")
  1074. exten => _X.,n,GotoIf($["${DEVICE_STATE(PJSIP/${EXTEN})}" = "BUSY"]?s-BUSY,1)
  1075. exten => _X.,n,GotoIf($["${DEVICE_STATE(PJSIP/${EXTEN})}" = "INUSE"]?s-BUSY,1)
  1076. exten => _X.,n,GotoIf($["${DEVICE_STATE(PJSIP/${EXTEN})}" = "INVALID"]?s-INVALID,1)
  1077. exten => _X.,n,GotoIf($["${DEVICE_STATE(PJSIP/${EXTEN})}" = "UNAVAILABLE"]?s-UNAVAILABLE,1)
  1078. exten => _X.,n,Return()
  1079. exten => s-BUSY,1,NoOp(Абонент ${EXTEN} в данный момент разговаривает)
  1080. exten => s-BUSY,n,Playback(extension-is-busy)
  1081. exten => s-BUSY,n,Hangup(17)
  1082. exten => s-INVALID,1,NoOp(Абонент ${EXTEN} не существует)
  1083. exten => s-INVALID,n,Goto(no-number,${EXTEN},1)
  1084. exten => s-INVALID,n,Hangup(1)
  1085. exten => s-UNAVAILABLE,1,NoOp(Абонент ${EXTEN} не доступен)
  1086. exten => s-UNAVAILABLE,n,Playback(ss-noservice)
  1087. exten => s-UNAVAILABLE,n,Wait(2)
  1088. exten => s-UNAVAILABLE,n,Hangup(18)
  1089. [no-number]
  1090. exten => _X.,1,NoOp(Статус набора - ${DIALSTATUS})
  1091. exten => _X.,n,Goto(invalid-number,1)
  1092. exten => invalid-number,1,NoOp(Неверно набран номер)
  1093. exten => invalid-number,n,Set(CDR(userfield)=No Number)
  1094. exten => invalid-number,n,Playback(pbx-invalid)
  1095. exten => invalid-number,n,Wait(1)
  1096. exten => invalid-number,n,Hangup()
  1097. exten => t,1,Playback(vm-goodbye)
  1098. exten => t,n,Hangup()
  1099.  
  1100. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1101. mcedit /etc/asterisk/queue.conf
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108. /////////////////////////////////////////////////////////////////////////////////////////
  1109.  
  1110.  
  1111. apt-get install fail2ban
  1112. systemctl enable iptables
  1113.  
  1114. mcedit /etc/asterisk/logger.conf
  1115. security => security
  1116. console => notice,warning,error
  1117. console => notice,warning,error,debug
  1118. messages => notice,warning,error
  1119. full => notice,warning,error,debug,verbose,dtmf,fax
  1120.  
  1121. apt-get install fail2ban
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127. fail2ban-client unban 10.10.50.16
  1128. fail2ban-client unban 37.139.38.15
  1129.  
  1130.  
  1131. iptables -nL --line-numbers
  1132. iptables -L -n
  1133. fail2ban-client reload
  1134. mcedit /etc/fail2ban/jail.conf
  1135. iptables -D f2b-asterisk-tcp 1
  1136. iptables -D f2b-asterisk-udp 1
  1137.  
  1138.  
  1139.  
  1140. pjsip show channels
  1141.  
  1142. ############## Звонок из консоли #########################
  1143. channel originate local/107@from-internal application echo
  1144.  
  1145. rasterisk -x "core show channels verbose"
  1146.  
  1147.  
  1148. ################## Заметки ##############################
  1149. watch "asterisk -vvvvvrx 'core show channels' | grep channels"
  1150. watch "asterisk -vvvvvrx 'core show channels' | grep calls"
  1151. watch "asterisk -vvvvvrx 'core show channels verbose'"
  1152.  
  1153. watch "asterisk -vvvvvrx 'core show channels verbose'"
  1154. watch -n 2 "rasterisk -x 'queue show q560010_all'"
  1155. watch -n 2 "rasterisk -x 'queue show que_560050'"
  1156.  
  1157. watch "asterisk -vvvvvrx 'core show channels' | egrep \"(call|channel)\""
  1158. asterisk -rx 'core show channels' | grep -m1 "call" | cut -d' ' -f1
  1159. asterisk -rx "core show calls" | grep "active" | cut -d' ' -f1
  1160. watch "asterisk -vvvvvrx 'core show channels verbose'"
  1161. watch -n 5 "asterisk -rx 'core show calls' | grep active"
  1162. watch -n 1 "asterisk -vvvvvrx 'core show channels' | grep call"
  1163.  
  1164. rasterisk -x "sip show peers" | grep 10.20.101. | sort -t . -k 3,3n -k 4,4n
  1165.  
  1166. Снять с паузы
  1167. rasterisk -x 'queue unpause member SIP/lk_gp1_g-237 queue q560050_1_norobot'
  1168.  
  1169. rasterisk -x "database show REDIRECT "
  1170. rasterisk -x "database put REDIRECT 2222 89324823365"
  1171. rasterisk -x "database del REDIRECT 2222"
  1172.  
  1173. rasterisk -x "sip show peers" | grep 85. | wc -l
  1174.  
  1175.  
  1176. 1xx
  1177. 8[2-9]xxxxxxxxx
  1178. [2-79]xxxxx
  1179. 0x
  1180.  
  1181. “sun” | “mon” | “tue” | “wed” | “thu” | “fri” | “sat”
  1182. “jan” | “feb” | “mar” | “apr” | “may” | “jun” | “jul” | “aug” | “sep” | “oct” | “nov” | “dec”
  1183. same => n(start),GotoIfTime(08:00-20:00,mon-fri,*,*?ok1:)
  1184. same => n(start),GotoIfTime(08:00-20:00,sat-sun,*,*?ok1:)
  1185.  
  1186. rasterisk -x "dialplan reload"
  1187. rasterisk -x "sip reload"
  1188. rasterisk -x "queue reload all"
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198. Изменить цветность в консоле mc
  1199. wget http://..............asterisk.syntax -P /usr/share/mc/syntax/
  1200. mcedit /usr/share/mc/syntax/Syntax
  1201.  
  1202. куда угодно можно, лишь бы перед последними двумя.
  1203.  
  1204. file .\* unknown
  1205. include asterisk.syntax
  1206.  
  1207. file .\* unknown
  1208. include unknown.syntax
  1209.  
  1210. ##########################Сохранит как asterisk.syntax ####################################################
  1211. # Description : Syntax rules for Asterisk dialplan language
  1212. # Author : Rozes "Ramzes" Alexander
  1213. # Date : 2017-04-06
  1214. # Usage : Add following lines at Syntax file
  1215. # file extensions.\*\\.conf$ Asterisk\sdialplan
  1216. # include asterisk.syntax
  1217.  
  1218. context default
  1219. keyword whole \{Aa\}dd\{Qq\}ueue\{Mm\}ember brightmagenta
  1220. keyword whole \{Aa\}\{Dd\}\{Ss\}\{Ii\}\{Pp\}rog brightmagenta
  1221. keyword whole \{Aa\}gent\{Ll\}ogin brightmagenta
  1222. keyword whole \{Aa\}gent\{Rr\}equest brightmagenta
  1223. keyword whole \{Aa\}\{Gg\}\{Ii\} brightmagenta
  1224. keyword whole \{Aa\}larm\{Rr\}eceiver brightmagenta
  1225. keyword whole \{Aa\}\{Mm\}\{Dd\} brightmagenta
  1226. keyword whole \{Aa\}nswer brightmagenta
  1227. keyword whole \{Aa\}uthenticate brightmagenta
  1228. keyword whole \{Bb\}ack\{Gg\}round brightmagenta
  1229. keyword whole \{Bb\}ackground\{Dd\}etect brightmagenta
  1230. keyword whole \{Bb\}ridge brightmagenta
  1231. keyword whole \{Bb\}ridge\{Ww\}ait brightmagenta
  1232. keyword whole \{Bb\}usy brightmagenta
  1233. keyword whole \{Cc\}all\{Cc\}ompletion\{Cc\}ancel brightmagenta
  1234. keyword whole \{Cc\}all\{Cc\}ompletion\{Rr\}equest brightmagenta
  1235. keyword whole \{Cc\}\{Ee\}\{Ll\}\{Gg\}en\{Uu\}ser\{Ee\}vent brightmagenta
  1236. keyword whole \{Cc\}hange\{Mm\}onitor brightmagenta
  1237. keyword whole \{Cc\}han\{Ii\}s\{Aa\}vail brightmagenta
  1238. keyword whole \{Cc\}hannel\{Rr\}edirect brightmagenta
  1239. keyword whole \{Cc\}han\{Ss\}py brightmagenta
  1240. keyword whole \{Cc\}lear\{Hh\}ash brightmagenta
  1241. keyword whole \{Cc\}onf\{Bb\}ridge brightmagenta
  1242. keyword whole \{Cc\}ongestion brightmagenta
  1243. keyword whole \{Cc\}ontinue\{Ww\}hile brightmagenta
  1244. keyword whole \{Cc\}ontrol\{Pp\}layback brightmagenta
  1245. keyword whole \{Dd\}\{Aa\}\{Hh\}\{Dd\}\{Ii\}\{Rr\}\{Aa\}\{Ss\} brightmagenta
  1246. keyword whole \{Dd\}\{Aa\}\{Hh\}\{Dd\}\{Ii\}\{Ss\}can brightmagenta
  1247. keyword whole \{Dd\}\{Aa\}\{Hh\}\{Dd\}\{Ii\}\{Ss\}end\{Cc\}allrerouting\{Ff\}acility brightmagenta
  1248. keyword whole \{Dd\}\{Aa\}\{Hh\}\{Dd\}\{Ii\}\{Ss\}end\{Kk\}eypad\{Ff\}acility brightmagenta
  1249. keyword whole \{Dd\}ate\{Tt\}ime brightmagenta
  1250. keyword whole \{Dd\}\{Bb\}del brightmagenta
  1251. keyword whole \{Dd\}\{Bb\}deltree brightmagenta
  1252. keyword whole \{Dd\}ead\{Aa\}\{Gg\}\{Ii\} brightmagenta
  1253. keyword whole \{Dd\}ial brightmagenta
  1254. keyword whole \{Dd\}ictate brightmagenta
  1255. keyword whole \{Dd\}irectory brightmagenta
  1256. keyword whole \{Dd\}\{Ii\}\{Ss\}\{Aa\} brightmagenta
  1257. keyword whole \{Dd\}ump\{Cc\}han brightmagenta
  1258. keyword whole \{Ee\}\{Aa\}\{Gg\}\{Ii\} brightmagenta
  1259. keyword whole \{Ee\}cho brightmagenta
  1260. keyword whole \{Ee\}ndWhile brightmagenta
  1261. keyword whole \{Ee\}xec brightmagenta
  1262. keyword whole \{Ee\}xec\{Ii\}f brightmagenta
  1263. keyword whole \{Ee\}xec\{Ii\}f\{Tt\}ime brightmagenta
  1264. keyword whole \{Ee\}xit\{Ww\}hile brightmagenta
  1265. keyword whole \{Ee\}xten\{Ss\}py brightmagenta
  1266. keyword whole \{Ee\}xternal\{Ii\}\{Vv\}\{Rr\} brightmagenta
  1267. keyword whole \{Ff\}estival brightmagenta
  1268. keyword whole \{Ff\}lash brightmagenta
  1269. keyword whole \{Ff\}ollow\{Mm\}e brightmagenta
  1270. keyword whole \{Ff\}ork\{Cc\}\{Dd\}\{Rr\} brightmagenta
  1271. keyword whole \{Gg\}et\{Cc\}\{Pp\}\{Ee\}\{Ii\}\{Dd\} brightmagenta
  1272. keyword whole \{Gg\}o\{Ss\}ub brightmagenta
  1273. keyword whole \{Gg\}o\{Ss\}ub\{Ii\}f brightmagenta
  1274. keyword whole \{Gg\}o\{Tt\}o brightmagenta
  1275. keyword whole \{Gg\}oto\{Ii\}f brightmagenta
  1276. keyword whole \{Gg\}oto\{Ii\}f\{Tt\}ime brightmagenta
  1277. keyword whole \{Hh\}angup brightmagenta
  1278. keyword whole \{Hh\}angup\{Cc\}ause\{Cc\}lear brightmagenta
  1279. keyword whole \{Ii\}\{Aa\}\{Xx\}2\{Pp\}rovision brightmagenta
  1280. keyword whole \{Ii\}\{Cc\}\{Ee\}\{Ss\} brightmagenta
  1281. keyword whole \{Ii\}mport\{Vv\}ar brightmagenta
  1282. keyword whole \{Ii\}ncomplete brightmagenta
  1283. keyword whole \{Ii\}\{Vv\}\{Rr\}\{Dd\}emo brightmagenta
  1284. keyword whole \{Jj\}abber\{Jj\}oin brightmagenta
  1285. keyword whole \{Jj\}abber\{Ll\}eave brightmagenta
  1286. keyword whole \{Jj\}abber\{Ss\}end brightmagenta
  1287. keyword whole \{Jj\}abber\{Ss\}end\{Gg\}roup brightmagenta
  1288. keyword whole \{Jj\}abber\{Ss\}tatus brightmagenta
  1289. keyword whole \{Ll\}og brightmagenta
  1290. keyword whole \{Mm\}acro brightmagenta
  1291. keyword whole \{Mm\}acro\{Ee\}xclusive brightmagenta
  1292. keyword whole \{Mm\}acro\{Ee\}xit brightmagenta
  1293. keyword whole \{Mm\}acro\{Ii\}f brightmagenta
  1294. keyword whole \{Mm\}acro\{Rr\}eturn brightmagenta
  1295. keyword whole \{Mm\}ailbox\{Ee\}xists brightmagenta
  1296. keyword whole \{Mm\}eet\{Mm\}e brightmagenta
  1297. keyword whole \{Mm\}eet\{Mm\}e\{Aa\}dmin brightmagenta
  1298. keyword whole \{Mm\}eet\{Mm\}e\{Cc\}hannel\{Aa\}dmin brightmagenta
  1299. keyword whole \{Mm\}eet\{Mm\}e\{Cc\}ount brightmagenta
  1300. keyword whole \{Mm\}essage\{Ss\}end brightmagenta
  1301. keyword whole \{Mm\}illiwatt brightmagenta
  1302. keyword whole \{Mm\}inivm\{Aa\}cc\{Mm\}ess brightmagenta
  1303. keyword whole \{Mm\}inivm\{Dd\}elete brightmagenta
  1304. keyword whole \{Mm\}inivm\{Gg\}reet brightmagenta
  1305. keyword whole \{Mm\}inivm\{Mm\}\{Ww\}\{Ii\} brightmagenta
  1306. keyword whole \{Mm\}inivm\{Nn\}otify brightmagenta
  1307. keyword whole \{Mm\}inivm\{Rr\}ecord brightmagenta
  1308. keyword whole \{Mm\}ix\{Mm\}onitor brightmagenta
  1309. keyword whole \{Mm\}onitor brightmagenta
  1310. keyword whole \{Mm\}orsecode brightmagenta
  1311. keyword whole \{Mm\}\{Pp\}3\{Pp\}layer brightmagenta
  1312. keyword whole \{Mm\}\{Ss\}et brightmagenta
  1313. keyword whole \{Mm\}usic\{Oo\}n\{Hh\}old brightmagenta
  1314. keyword whole \{Nn\}\{Bb\}\{Ss\}cat brightmagenta
  1315. keyword whole \{Nn\}o\{Cc\}\{Dd\}\{Rr\} brightmagenta
  1316. keyword whole \{Nn\}o\{Oo\}\{Pp\} brightmagenta
  1317. keyword whole \{Oo\}\{Dd\}\{Bb\}\{Cc\}_\{Cc\}ommit brightmagenta
  1318. keyword whole \{Oo\}\{Dd\}\{Bb\}\{Cc\}_\{Rr\}ollback brightmagenta
  1319. keyword whole \{Oo\}\{Dd\}\{Bb\}\{Cc\}\{Ff\}inish brightmagenta
  1320. keyword whole \{Oo\}riginate brightmagenta
  1321. keyword whole \{Pp\}age brightmagenta
  1322. keyword whole \{Pp\}ark brightmagenta
  1323. keyword whole \{Pp\}ark\{Aa\}nd\{Aa\}nnounce brightmagenta
  1324. keyword whole \{Pp\}arked\{Cc\}all brightmagenta
  1325. keyword whole \{Pp\}ause\{Mm\}onitor brightmagenta
  1326. keyword whole \{Pp\}ause\{Qq\}ueue\{Mm\}ember brightmagenta
  1327. keyword whole \{Pp\}ickup brightmagenta
  1328. keyword whole \{Pp\}ickup\{Cc\}han brightmagenta
  1329. keyword whole \{Pp\}layback brightmagenta
  1330. keyword whole \{Pp\}lay\{Tt\}ones brightmagenta
  1331. keyword whole \{Pp\}rivacy\{Mm\}anager brightmagenta
  1332. keyword whole \{Pp\}roceeding brightmagenta
  1333. keyword whole \{Pp\}rogress brightmagenta
  1334. keyword whole \{Qq\}ueue brightmagenta
  1335. keyword whole \{Qq\}ueue\{Ll\}og brightmagenta
  1336. keyword whole \{Rr\}aise\{Ee\}xception brightmagenta
  1337. keyword whole \{Rr\}ead brightmagenta
  1338. keyword whole \{Rr\}ead\{Ee\}xten brightmagenta
  1339. keyword whole \{Rr\}eceive\{Ff\}\{Aa\}\{Xx\} brightmagenta
  1340. keyword whole \{Rr\}ecord brightmagenta
  1341. keyword whole \{Rr\}emove\{Qq\}ueue\{Mm\}ember brightmagenta
  1342. keyword whole \{Rr\}eset\{Cc\}\{Dd\}\{Rr\} brightmagenta
  1343. keyword whole \{Rr\}etry\{Dd\}ial brightmagenta
  1344. keyword whole \{Rr\}eturn brightmagenta
  1345. keyword whole \{Rr\}inging brightmagenta
  1346. keyword whole \{Ss\}ay\{Aa\}lpha brightmagenta
  1347. keyword whole \{Ss\}ay\{Aa\}lpha\{Cc\}ase brightmagenta
  1348. keyword whole \{Ss\}ay\{Cc\}ounted\{Aa\}dj brightmagenta
  1349. keyword whole \{Ss\}ay\{Cc\}ounted\{Nn\}oun brightmagenta
  1350. keyword whole \{Ss\}ay\{Dd\}igits brightmagenta
  1351. keyword whole \{Ss\}ay\{Nn\}umber brightmagenta
  1352. keyword whole \{Ss\}ay\{Pp\}honetic brightmagenta
  1353. keyword whole \{Ss\}ay\{Uu\}nix\{Tt\}ime brightmagenta
  1354. keyword whole \{Ss\}end\{Dd\}\{Tt\}\{Mm\}\{Ff\} brightmagenta
  1355. keyword whole \{Ss\}end\{Ff\}\{Aa\}\{Xx\} brightmagenta
  1356. keyword whole \{Ss\}end\{Ii\}mage brightmagenta
  1357. keyword whole \{Ss\}end\{Tt\}ext brightmagenta
  1358. keyword whole \{Ss\}end\{Uu\}\{Rr\}\{Ll\} brightmagenta
  1359. keyword whole \{Ss\}et brightmagenta
  1360. keyword whole \{Ss\}et\{Vv\}ar brightmagenta
  1361. keyword whole \{Ss\}et\{Aa\}\{Mm\}\{Aa\}\{Ff\}lags brightmagenta
  1362. keyword whole \{Ss\}\{Ii\}\{Pp\}\{Aa\}dd\{Hh\}eader brightmagenta
  1363. keyword whole \{Ss\}\{Ii\}\{Pp\}\{Dd\}\{Tt\}\{Mm\}\{Ff\}\{Mm\}ode brightmagenta
  1364. keyword whole \{Ss\}\{Ii\}\{Pp\}\{Rr\}emove\{Hh\}eader brightmagenta
  1365. keyword whole \{Ss\}kel\{Gg\}uess\{Nn\}umber brightmagenta
  1366. keyword whole \{Ss\}\{Ll\}\{Aa\}\{Ss\}tation brightmagenta
  1367. keyword whole \{Ss\}\{Ll\}\{Aa\}\{Tt\}runk brightmagenta
  1368. keyword whole \{Ss\}\{Mm\}\{Ss\} brightmagenta
  1369. keyword whole \{Ss\}oft\{Hh\}angup brightmagenta
  1370. keyword whole \{Ss\}peech\{Aa\}ctivate\{Gg\}rammar brightmagenta
  1371. keyword whole \{Ss\}peech\{Bb\}ackground brightmagenta
  1372. keyword whole \{Ss\}peech\{Cc\}reate brightmagenta
  1373. keyword whole \{Ss\}peech\{Dd\}eactivate\{Gg\}rammar brightmagenta
  1374. keyword whole \{Ss\}peech\{Dd\}estroy brightmagenta
  1375. keyword whole \{Ss\}peech\{Ll\}oad\{Gg\}rammar brightmagenta
  1376. keyword whole \{Ss\}peech\{Pp\}rocessing\{Ss\}ound brightmagenta
  1377. keyword whole \{Ss\}peech\{Ss\}tart brightmagenta
  1378. keyword whole \{Ss\}peech\{Uu\}nload\{Gg\}rammar brightmagenta
  1379. keyword whole \{Ss\}tack\{Pp\}op brightmagenta
  1380. keyword whole \{Ss\}tart\{Mm\}usic\{Oo\}n\{Hh\}old brightmagenta
  1381. keyword whole \{Ss\}tasis brightmagenta
  1382. keyword whole \{Ss\}top\{Mm\}ix\{Mm\}onitor brightmagenta
  1383. keyword whole \{Ss\}top\{Mm\}onitor brightmagenta
  1384. keyword whole \{Ss\}top\{Mm\}usic\{Oo\}n\{Hh\}old brightmagenta
  1385. keyword whole \{Ss\}top\{Pp\}lay\{Tt\}ones brightmagenta
  1386. keyword whole \{Ss\}ystem brightmagenta
  1387. keyword whole \{Tt\}est\{Cc\}lient brightmagenta
  1388. keyword whole \{Tt\}est\{Ss\}erver brightmagenta
  1389. keyword whole \{Tt\}ransfer brightmagenta
  1390. keyword whole \{Tt\}ry\{Ee\}xec brightmagenta
  1391. keyword whole \{Tt\}ry\{Ss\}ystem brightmagenta
  1392. keyword whole \{Uu\}npause\{Mm\}onitor brightmagenta
  1393. keyword whole \{Uu\}npause\{Qq\}ueue\{Mm\}ember brightmagenta
  1394. keyword whole \{Uu\}ser\{Ee\}vent brightmagenta
  1395. keyword whole \{Vv\}erbose brightmagenta
  1396. keyword whole \{Vv\}\{Mm\}\{Aa\}uthenticate brightmagenta
  1397. keyword whole \{Vv\}\{Mm\}\{Ss\}ay\{Nn\}ame brightmagenta
  1398. keyword whole \{Vv\}oice\{Mm\}ail brightmagenta
  1399. keyword whole \{Vv\}oice\{Mm\}ail\{Mm\}ain brightmagenta
  1400. keyword whole \{Vv\}oice\{Mm\}ail\{Pp\}lay\{Mm\}sg brightmagenta
  1401. keyword whole \{Ww\}ait brightmagenta
  1402. keyword whole \{Ww\}ait\{Ee\}xten brightmagenta
  1403. keyword whole \{Ww\}ait\{Ff\}or\{Nn\}oise brightmagenta
  1404. keyword whole \{Ww\}ait\{Ff\}or\{Rr\}ing brightmagenta
  1405. keyword whole \{Ww\}ait\{Ff\}or\{Ss\}ilence brightmagenta
  1406. keyword whole \{Ww\}ait\{Uu\}ntil brightmagenta
  1407. keyword whole \{Ww\}hile brightmagenta
  1408. keyword whole \{Zz\}apateller brightmagenta
  1409.  
  1410. keyword whole AES_DECRYPT yellow
  1411. keyword whole AES_ENCRYPT yellow
  1412. keyword whole AGC yellow
  1413. keyword whole AGENT yellow
  1414. keyword whole AMI_CLIENT yellow
  1415. keyword whole ARRAY yellow
  1416. keyword whole AST_CONFIG yellow
  1417. keyword whole AST_SORCERY yellow
  1418. keyword whole AUDIOHOOK_INHERIT yellow
  1419. keyword whole BASE64_DECODE yellow
  1420. keyword whole BASE64_ENCODE yellow
  1421. keyword whole BLACKLIST yellow
  1422. keyword whole CALENDAR_BUSY yellow
  1423. keyword whole CALENDAR_EVENT yellow
  1424. keyword whole CALENDAR_QUERY yellow
  1425. keyword whole CALENDAR_QUERY_RESUL yellow
  1426. keyword whole CALENDAR_WRITE yellow
  1427. keyword whole CALLCOMPLETION yellow
  1428. keyword whole CALLERID yellow
  1429. keyword whole CALLERPRES yellow
  1430. keyword whole CDR yellow
  1431. keyword whole CDR_PROP yellow
  1432. keyword whole CHANNEL yellow
  1433. keyword whole CHANNELS yellow
  1434. keyword whole CHECKSIPDOMAIN yellow
  1435. keyword whole CONFBRIDGE yellow
  1436. keyword whole CONFBRIDGE_INFO yellow
  1437. keyword whole CONNECTEDLINE yellow
  1438. keyword whole CSV_QUOTE yellow
  1439. keyword whole CURL yellow
  1440. keyword whole CURLOPT yellow
  1441. keyword whole CUT yellow
  1442. keyword whole DB yellow
  1443. keyword whole DB_DELETE yellow
  1444. keyword whole DB_EXISTS yellow
  1445. keyword whole DB_KEYS yellow
  1446. keyword whole DEC yellow
  1447. keyword whole DENOISE yellow
  1448. keyword whole DEVICE_STATE yellow
  1449. keyword whole DIALGROUP yellow
  1450. keyword whole DIALPLAN_EXISTS yellow
  1451. keyword whole DUNDILOOKUP yellow
  1452. keyword whole DUNDIQUERY yellow
  1453. keyword whole DUNDIRESULT yellow
  1454. keyword whole ENUMLOOKUP yellow
  1455. keyword whole ENUMQUERY yellow
  1456. keyword whole ENUMRESULT yellow
  1457. keyword whole ENV yellow
  1458. keyword whole EVAL yellow
  1459. keyword whole EXCEPTION yellow
  1460. keyword whole EXISTS yellow
  1461. keyword whole EXTENSION_STATE yellow
  1462. keyword whole FAXOPT yellow
  1463. keyword whole FEATURE yellow
  1464. keyword whole FEATUREMAP yellow
  1465. keyword whole FIELDNUM yellow
  1466. keyword whole FIELDQTY yellow
  1467. keyword whole FILE yellow
  1468. keyword whole FILE_COUNT_LINE yellow
  1469. keyword whole FILE_FORMAT yellow
  1470. keyword whole FILTER yellow
  1471. keyword whole FRAME_TRACE yellow
  1472. keyword whole GLOBAL yellow
  1473. keyword whole GROUP yellow
  1474. keyword whole GROUP_COUNT yellow
  1475. keyword whole GROUP_LIST yellow
  1476. keyword whole GROUP_MATCH_COUNT yellow
  1477. keyword whole HANGUPCAUSE yellow
  1478. keyword whole HANGUPCAUSE_KEYS yellow
  1479. keyword whole HASH yellow
  1480. keyword whole HASHKEYS yellow
  1481. keyword whole HINT yellow
  1482. keyword whole HOLD_INTERCEPT yellow
  1483. keyword whole IAXPEER yellow
  1484. keyword whole IAXVAR yellow
  1485. keyword whole ICONV yellow
  1486. keyword whole IF yellow
  1487. keyword whole IFMODULE yellow
  1488. keyword whole IFTIME yellow
  1489. keyword whole IMPORT yellow
  1490. keyword whole INC yellow
  1491. keyword whole ISNULL yellow
  1492. keyword whole JABBER_RECEIVE yellow
  1493. keyword whole JABBER_STATUS yellow
  1494. keyword whole JITTERBUFFER yellow
  1495. keyword whole KEYPADHASH yellow
  1496. keyword whole LEN yellow
  1497. keyword whole LISTFILTER yellow
  1498. keyword whole LOCAL yellow
  1499. keyword whole LOCAL_PEEK yellow
  1500. keyword whole LOCK yellow
  1501. keyword whole MAILBOX_EXISTS yellow
  1502. keyword whole MASTER_CHANNEL yellow
  1503. keyword whole MATH yellow
  1504. keyword whole MD5 yellow
  1505. keyword whole MEETME_INFO yellow
  1506. keyword whole MESSAGE yellow
  1507. keyword whole MESSAGE_DATA yellow
  1508. keyword whole MINIVMACCOUNT yellow
  1509. keyword whole MINIVMCOUNTER yellow
  1510. keyword whole MIXMONITOR yellow
  1511. keyword whole MUTEAUDIO yellow
  1512. keyword whole ODBC yellow
  1513. keyword whole ODBC_ANTIGF yellow
  1514. keyword whole ODBC_FETCH yellow
  1515. keyword whole ODBC_PRESENCE yellow
  1516. keyword whole ODBC_SQL yellow
  1517. keyword whole PASSTHRU yellow
  1518. keyword whole PERIODIC_HOOK yellow
  1519. keyword whole PITCH_SHIFT yellow
  1520. keyword whole POP yellow
  1521. keyword whole PP_EACH_EXTENSION yellow
  1522. keyword whole PP_EACH_USER yellow
  1523. keyword whole PRESENCE_STATE yellow
  1524. keyword whole PUSH yellow
  1525. keyword whole QUEUE_EXISTS yellow
  1526. keyword whole QUEUE_MEMBER yellow
  1527. keyword whole QUEUE_MEMBER_COUNT yellow
  1528. keyword whole QUEUE_MEMBER_LIST yellow
  1529. keyword whole QUEUE_MEMBER_PENALTY yellow
  1530. keyword whole QUEUE_VARIABLES yellow
  1531. keyword whole QUEUE_WAITING_COUNT yellow
  1532. keyword whole QUOTE yellow
  1533. keyword whole RAND yellow
  1534. keyword whole REALTIME yellow
  1535. keyword whole REALTIME_DESTROY yellow
  1536. keyword whole REALTIME_FIELD yellow
  1537. keyword whole REALTIME_HASH yellow
  1538. keyword whole REALTIME_STORE yellow
  1539. keyword whole REDIRECTING yellow
  1540. keyword whole REGEX yellow
  1541. keyword whole REPLACE yellow
  1542. keyword whole SET yellow
  1543. keyword whole SHA1 yellow
  1544. keyword whole SHARED yellow
  1545. keyword whole SHELL yellow
  1546. keyword whole SHIFT yellow
  1547. keyword whole SIPPEER yellow
  1548. keyword whole SIP_HEADER yellow
  1549. keyword whole SMDI_MSG yellow
  1550. keyword whole SMDI_MSG_RETRIEVE yellow
  1551. keyword whole SORT yellow
  1552. keyword whole SPEECH yellow
  1553. keyword whole SPEECH_ENGINE yellow
  1554. keyword whole SPEECH_GRAMMAR yellow
  1555. keyword whole SPEECH_RESULTS_TYPE yellow
  1556. keyword whole SPEECH_SCORE yellow
  1557. keyword whole SPEECH_TEXT yellow
  1558. keyword whole SPRINTF yellow
  1559. keyword whole SQL_ESC yellow
  1560. keyword whole SRVQUERY yellow
  1561. keyword whole SRVRESULT yellow
  1562. keyword whole STACK_PEEK yellow
  1563. keyword whole STAT yellow
  1564. keyword whole STRFTIME yellow
  1565. keyword whole STRPTIME yellow
  1566. keyword whole STRREPLACE yellow
  1567. keyword whole SYSINFO yellow
  1568. keyword whole TALK_DETECT yellow
  1569. keyword whole TESTTIME yellow
  1570. keyword whole TIMEOUT yellow
  1571. keyword whole TOLOWER yellow
  1572. keyword whole TOUPPER yellow
  1573. keyword whole TRYLOCK yellow
  1574. keyword whole TXTCIDNAME yellow
  1575. keyword whole UNLOCK yellow
  1576. keyword whole UNSHIFT yellow
  1577. keyword whole URIDECODE yellow
  1578. keyword whole URIENCODE yellow
  1579. keyword whole VALID_EXTEN yellow
  1580. keyword whole VERSION yellow
  1581. keyword whole VMCOUNT yellow
  1582. keyword whole VM_INFO yellow
  1583. keyword whole VOLUME yellow
  1584.  
  1585. # Request from Andy
  1586. keyword whole CBMysql brightmagenta
  1587. keyword whole MYSQL brightmagenta
  1588.  
  1589. keyword $[*] brightgreen
  1590. keyword ${*} brightgreen
  1591.  
  1592. keyword whole \#include brightred
  1593. keyword whole \#exec brightred
  1594. keyword whole include\s*=> brightblue
  1595. keyword whole exten\s*=> brightblue
  1596. keyword whole same\s*=> brightblue
  1597. keyword whole include=> brightblue
  1598. keyword whole exten=> brightblue
  1599. keyword whole same=> brightblue
  1600.  
  1601. keyword , brightcyan
  1602. keyword ( brightcyan
  1603. keyword ) brightcyan
  1604. keyword : brightcyan
  1605. keyword ? brightcyan
  1606.  
  1607. keyword --; brown
  1608.  
  1609. context ;--\n --; brown
  1610.  
  1611. context linestart [ ] yellow
  1612.  
  1613. context ; \n brown
  1614.  
  1615. context exclusive \#exec \n brightgreen
  1616.  
  1617. context exclusive \#include \n brightgreen
  1618.  
  1619. context exclusive include\s=> \n yellow
  1620.  
  1621. context exclusive include=> \n yellow
  1622.  
  1623. context exclusive n( ), yellow
  1624.  
  1625. context exclusive verbose ) white
  1626. keyword ( brightcyan
  1627. keyword $[*] brightgreen
  1628. keyword ${*} brightgreen
  1629.  
  1630. context exclusive Verbose ) white
  1631. keyword ( brightcyan
  1632. keyword $[*] brightgreen
  1633. keyword ${*} brightgreen
  1634.  
  1635. context exclusive No\{Oo\}\{Pp\} ) white
  1636. keyword ( brightcyan
  1637. keyword $[*] brightgreen
  1638. keyword ${*} brightgreen
  1639.  
  1640. context exclusive no\{Oo\}\{Pp\} ) white
  1641. keyword ( brightcyan
  1642. keyword $[*] brightgreen
  1643. keyword ${*} brightgreen
  1644.  
  1645.  
  1646.  
  1647.  
  1648. ########################## До сюда ####################################################
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654. ----------------------Тут пропишем банер ------------------------
  1655.  
  1656. mcedit /etc/issue.net
  1657.  
  1658. mcedit /etc/ssh/sshd_config
  1659. найти изаменить
  1660. Banner /etc/issue.net
  1661.  
  1662. mcedit /etc/motd
  1663.  
  1664. debian-11.2.0-amd64-netinst.iso
  1665. Asterisk asterisk-19.1.0
  1666. username=asterisk
  1667. password=sdfJHGVhj5g7jghjv$g
  1668.  
  1669. mysql -u root -p.
  1670. 123456
  1671. runuser = asterisk
  1672. rungroup = asterisk
  1673.  
  1674. .$$$$$$$$$$$$$$$=..
  1675. .$7$7.. .7$$7:.
  1676. .$$:. ,$7.7
  1677. .$7. 7$$$$ .$$77
  1678. ..$$. $$$$$ .$$$7
  1679. ..7$ .?. $$$$$ .?. 7$$$.
  1680. $.$. .$$$7. $$$$7 .7$$$. .$$$.
  1681. .777. .$$$$$$77$$$77$$$$$7. $$$,
  1682. $$$~ .7$$$$$$$$$$$$$7. .$$$.
  1683. .$$7 .7$$$$$$$7: ?$$$.
  1684. $$$ ?7$$$$$$$$$$I .$$$7
  1685. $$$ .7$$$$$$$$$$$$$$$$ :$$$.
  1686. $$$ $$$$$$7$$$$$$$$$$$$ .$$$.
  1687. $$$ $$$ 7$$$7 .$$$ .$$$.
  1688. $$$$ $$$$7 .$$$.
  1689. 7$$$7 7$$$$ 7$$$
  1690. $$$$$ $$$
  1691. $$$$7. $$
  1692. $$$$$$$. .7$$$$$$ $$
  1693. $$$$$$$$$$$$7$$$$$$$$$.$$$$$$
  1694. $$$$$$$$$$$$$$$$.
  1695.  
  1696. ____________________________________
  1697. / Лучше ничего не делать, чем делать \
  1698. | ничего. |
  1699. | |
  1700. \ -- Л.Н.Толстой /
  1701. ------------------------------------
  1702. \ __------~~-,
  1703. \ ,' ,
  1704. / \
  1705. / :
  1706. | '
  1707. | |
  1708. | |
  1709. | _-- |
  1710. _| =-. .-. ||
  1711. o|/o/ _. |
  1712. / ~ \ |
  1713. (____@) ___~ |
  1714. |_===~~~.` |
  1715. _______.--~ |
  1716. \________ |
  1717. \ |
  1718. __/-___-- -__
  1719. / _ \
  1720.  
  1721.  
  1722. ----------- Вот так будет выглядеть ----------------------
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771. mcedit /etc/asterisk/manager.conf
  1772. Для включения Asterisk AMI откроем файл /etc/asterisk/manager.conf в текстовом редакторе и укажем параметры:
  1773.  
  1774. [general]
  1775. enabled = yes
  1776. port = 5038
  1777. bindaddr = 0.0.0.0
  1778. timestampevents = yes
  1779. displayconnects = yes
  1780. allowmultiplelogin = yes
  1781. webenabled = no
  1782.  
  1783. #include "manager.d/*.conf"
  1784. Теперь создадим файл настроек для первого пользователя:
  1785. mkdir /etc/asterisk/manager.d
  1786. mcedit /etc/asterisk/manager.d/admin.conf
  1787. chown asterisk:asterisk /etc/asterisk/manager.d/admin.conf
  1788. И добавим в него:
  1789.  
  1790. [admin]
  1791. secret = IXNFO
  1792. deny = 0.0.0.0/0.0.0.0
  1793. permit = 127.0.0.1/255.255.255.0
  1794. permit = 192.168.2.2/255.255.255.255
  1795. permit = 192.168.5.5/255.255.255.255
  1796. read = system,call,log,verbose,command,agent,user,config,dtmf,reporting,cdr,dialplan,originate
  1797. write = system,call,log,verbose,command,agent,user,config,dtmf,reporting,cdr,dialplan,originate
  1798. #####################################################################################################
  1799. # cd /var/www/html
  1800. # git clone https://github.com/zheltovanton/asteriskgui.git
  1801. # chown asterisk. /var/www/html/asteriskgui -R
  1802. mcedit /var/www/html/asteriskgui/db/config.php
  1803. mcedit /etc/httpd/conf.d/asteriskgui.conf
  1804. <Directory /var/www/html/asteriskgui/>
  1805. AddDefaultCharset UTF-8
  1806.  
  1807. <IfModule mod_authz_core.c>
  1808. # Apache 2.4
  1809. <RequireAny>
  1810. Require all granted
  1811. </RequireAny>
  1812. </IfModule>
  1813. <IfModule !mod_authz_core.c>
  1814. # Apache 2.2
  1815. Order Deny,Allow
  1816. Deny from All
  1817. Allow from 127.0.0.1
  1818. Allow from ::1
  1819. </IfModule>
  1820. </Directory>
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893. apt-get install -y linux-headers-`uname -r` libapache2-mod-log-sql-ssl libfreetype6-dev doxygen yasm nasm gdb cmake build-essential make automake autoconf 'libtool-bin|libtool' python python-dev uuid uuid-dev 'libjpeg8-dev|libjpeg62-turbo-dev' libncurses5-dev libssl-dev libpcre3-dev libcurl4-openssl-dev libldns-dev libedit-dev libspeexdsp-dev libsqlite3-dev perl libgdbm-dev libdb-dev ccache libpng-dev libopenal-dev libcodec2-dev libsoundtouch-dev libmagickcore-dev liblua5.2-dev libsndfile-dev libopencv-dev libavformat-dev libx264-dev erlang-dev libldap2-dev libperl-dev
  1894.  
  1895. apt-get install -y libpq-dev subversion gcc lynx bison flex memcached libshout3-dev libvpx-dev mpg123 libmpg123-dev libmp3lame-dev libncurses5-dev libpng16-16 libxml2-dev libxml2 libcurl4 libnewt-dev sqlite3
  1896.  
  1897. apt-get install -y libasound2-dev sox pkg-config libedit-dev libcppdb-odbc0 unixodbc unixodbc-dev libogg-dev libvorbis-dev libcurl4-openssl-dev libical-dev libneon27-dev libsrtp2-1 libspandsp-dev sendmail sendmail-bin sendmail-cf
  1898. apt-get install -y haveged odbcinst
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904. --------------------------------------------------------------------------------------------------
  1905. apt update && apt upgrade -y
  1906. sudo whoami
  1907. root
  1908. su
  1909. apt update
  1910. apt upgrade
  1911. apt install software-properties-common dirmngr
  1912.  
Add Comment
Please, Sign In to add comment