Инструменты пользователя

Инструменты сайта


сервис_asterisk

Различия

Здесь показаны различия между двумя версиями данной страницы.

Ссылка на это сравнение

Предыдущая версия справа и слева Предыдущая версия
Следующая версия
Предыдущая версия
сервис_asterisk [2019/12/04 15:37]
val [Синтез речи с использованием пакета Festival]
сервис_asterisk [2019/12/09 16:05] (текущий)
val [Приложение SHELL]
Строка 609: Строка 609:
 # curl -v -X GET "​http://​localhost:​8088/​ari/​channels?​api_key=asterisk:​asterisk"​ # curl -v -X GET "​http://​localhost:​8088/​ari/​channels?​api_key=asterisk:​asterisk"​
 </​code>​ </​code>​
- 
-==== Использование файлов для хранения CDR ==== 
  
 === Настройка местного времени === === Настройка местного времени ===
Строка 622: Строка 620:
 </​code>​ </​code>​
  
-=== Добавление IP адреса ===+==== Добавление IP адреса ​====
  
 <​code>​ <​code>​
Строка 628: Строка 626:
 exten => _4XX,​n,​Dial(SIP/​${EXTEN},,​Tt) exten => _4XX,​n,​Dial(SIP/​${EXTEN},,​Tt)
 </​code>​ </​code>​
 +
 +==== Использование файлов для хранения CDR ====
  
 === Просмотр === === Просмотр ===
Строка 747: Строка 747:
 </​code><​code>​ </​code><​code>​
 ... ...
-exten => _4XX,​1,​Macro(monitor)+;exten => _4XX,​1,​Macro(monitor
 +exten => _4XX,​1,​GoSub(sub-monitor,​s,​1)
 exten => _4XX,​n,​Dial(SIP/​${EXTEN}) exten => _4XX,​n,​Dial(SIP/​${EXTEN})
 ... ...
-[macro-monitor]+;[macro-monitor] 
 +[sub-monitor]
 exten => s,​1,​Set(MONITOR_FILE=/​var/​spool/​asterisk/​monitor/​${UNIQUEID}) exten => s,​1,​Set(MONITOR_FILE=/​var/​spool/​asterisk/​monitor/​${UNIQUEID})
 exten => s,​n,​MixMonitor(${MONITOR_FILE}.wav,​b) exten => s,​n,​MixMonitor(${MONITOR_FILE}.wav,​b)
 +exten => s,​n,​Return()
  
 </​code><​code>​ </​code><​code>​
Строка 770: Строка 773:
   * [[https://​wiki.asterisk.org/​wiki/​display/​AST/​Setting+up+PJSIP+Realtime|Setting up PJSIP Realtime (wiki.asterisk.org)]]   * [[https://​wiki.asterisk.org/​wiki/​display/​AST/​Setting+up+PJSIP+Realtime|Setting up PJSIP Realtime (wiki.asterisk.org)]]
  
 +<​code>​
 +CREATE TABLE `ps_aors` (
 +  `id` varchar(40) NOT NULL,
 +  `contact` varchar(255) DEFAULT NULL,
 +  `default_expiration` int(11) DEFAULT NULL,
 +  `mailboxes` varchar(80) DEFAULT NULL,
 +  `max_contacts` int(11) DEFAULT NULL,
 +  `minimum_expiration` int(11) DEFAULT NULL,
 +  `remove_existing` enum('​yes','​no'​) DEFAULT NULL,
 +  `qualify_frequency` int(11) DEFAULT NULL,
 +  `authenticate_qualify` enum('​yes','​no'​) DEFAULT NULL,
 +  `maximum_expiration` int(11) DEFAULT NULL,
 +  `outbound_proxy` varchar(40) DEFAULT NULL,
 +  `support_path` enum('​yes','​no'​) DEFAULT NULL,
 +  `qualify_timeout` float DEFAULT NULL,
 +  `voicemail_extension` varchar(40) DEFAULT NULL,
 +  UNIQUE KEY `id` (`id`),
 +  KEY `ps_aors_id` (`id`),
 +  KEY `ps_aors_qualifyfreq_contact` (`qualify_frequency`,​`contact`)
 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;​
 +
 +CREATE TABLE `ps_auths` (
 +  `id` varchar(40) NOT NULL,
 +  `auth_type` enum('​md5','​userpass'​) DEFAULT NULL,
 +  `nonce_lifetime` int(11) DEFAULT NULL,
 +  `md5_cred` varchar(40) DEFAULT NULL,
 +  `password` varchar(80) DEFAULT NULL,
 +  `realm` varchar(40) DEFAULT NULL,
 +  `username` varchar(40) DEFAULT NULL,
 +  UNIQUE KEY `id` (`id`),
 +  KEY `ps_auths_id` (`id`)
 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;​
 +
 +CREATE TABLE `ps_contacts` (
 +  `id` varchar(255) DEFAULT NULL,
 +  `uri` varchar(255) DEFAULT NULL,
 +  `expiration_time` bigint(20) DEFAULT NULL,
 +  `qualify_frequency` int(11) DEFAULT NULL,
 +  `outbound_proxy` varchar(40) DEFAULT NULL,
 +  `path` text,
 +  `user_agent` varchar(255) DEFAULT NULL,
 +  `qualify_timeout` float DEFAULT NULL,
 +  `reg_server` varchar(20) DEFAULT NULL,
 +  `authenticate_qualify` enum('​yes','​no'​) DEFAULT NULL,
 +  `via_addr` varchar(40) DEFAULT NULL,
 +  `via_port` int(11) DEFAULT NULL,
 +  `call_id` varchar(255) DEFAULT NULL,
 +  `endpoint` varchar(40) DEFAULT NULL,
 +  `prune_on_boot` enum('​yes','​no'​) DEFAULT NULL,
 +  UNIQUE KEY `id` (`id`),
 +  UNIQUE KEY `ps_contacts_uq` (`id`,​`reg_server`),​
 +  KEY `ps_contacts_id` (`id`),
 +  KEY `ps_contacts_qualifyfreq_exp` (`qualify_frequency`,​`expiration_time`)
 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;​
 +
 +CREATE TABLE `ps_domain_aliases` (
 +  `id` varchar(40) NOT NULL,
 +  `domain` varchar(80) DEFAULT NULL,
 +  UNIQUE KEY `id` (`id`),
 +  KEY `ps_domain_aliases_id` (`id`)
 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;​
 +
 +
 +CREATE TABLE `ps_endpoint_id_ips` (
 +  `id` varchar(40) NOT NULL,
 +  `endpoint` varchar(40) DEFAULT NULL,
 +  `match` varchar(80) DEFAULT NULL,
 +  UNIQUE KEY `id` (`id`),
 +  KEY `ps_endpoint_id_ips_id` (`id`)
 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;​
 +
 +
 +CREATE TABLE `ps_endpoints` (
 +  `id` varchar(40) NOT NULL,
 +  `transport` varchar(40) DEFAULT NULL,
 +  `aors` varchar(200) DEFAULT NULL,
 +  `auth` varchar(40) DEFAULT NULL,
 +  `context` varchar(40) DEFAULT NULL,
 +  `disallow` varchar(200) DEFAULT NULL,
 +  `allow` varchar(200) DEFAULT NULL,
 +  `direct_media` enum('​yes','​no'​) DEFAULT NULL,
 +  `connected_line_method` enum('​invite','​reinvite','​update'​) DEFAULT NULL,
 +  `direct_media_method` enum('​invite','​reinvite','​update'​) DEFAULT NULL,
 +  `direct_media_glare_mitigation` enum('​none','​outgoing','​incoming'​) DEFAULT NULL,
 +  `disable_direct_media_on_nat` enum('​yes','​no'​) DEFAULT NULL,
 +  `dtmf_mode` enum('​rfc4733','​inband','​info','​auto'​) DEFAULT NULL,
 +  `external_media_address` varchar(40) DEFAULT NULL,
 +  `force_rport` enum('​yes','​no'​) DEFAULT NULL,
 +  `ice_support` enum('​yes','​no'​) DEFAULT NULL,
 +  `identify_by` enum('​username','​auth_username'​) DEFAULT NULL,
 +  `mailboxes` varchar(40) DEFAULT NULL,
 +  `moh_suggest` varchar(40) DEFAULT NULL,
 +  `outbound_auth` varchar(40) DEFAULT NULL,
 +  `outbound_proxy` varchar(40) DEFAULT NULL,
 +  `rewrite_contact` enum('​yes','​no'​) DEFAULT NULL,
 +  `rtp_ipv6` enum('​yes','​no'​) DEFAULT NULL,
 +  `rtp_symmetric` enum('​yes','​no'​) DEFAULT NULL,
 +  `send_diversion` enum('​yes','​no'​) DEFAULT NULL,
 +  `send_pai` enum('​yes','​no'​) DEFAULT NULL,
 +  `send_rpid` enum('​yes','​no'​) DEFAULT NULL,
 +  `timers_min_se` int(11) DEFAULT NULL,
 +  `timers` enum('​forced','​no','​required','​yes'​) DEFAULT NULL,
 +  `timers_sess_expires` int(11) DEFAULT NULL,
 +  `callerid` varchar(40) DEFAULT NULL,
 +  `callerid_privacy` enum('​allowed_not_screened','​allowed_passed_screened','​allowed_failed_screened','​allowed','​prohib_not_screened','​prohib_passed_screened','​prohib_failed_screened','​prohib','​unavailable'​) DEFAULT NULL,
 +  `callerid_tag` varchar(40) DEFAULT NULL,
 +  `100rel` enum('​no','​required','​yes'​) DEFAULT NULL,
 +  `aggregate_mwi` enum('​yes','​no'​) DEFAULT NULL,
 +  `trust_id_inbound` enum('​yes','​no'​) DEFAULT NULL,
 +  `trust_id_outbound` enum('​yes','​no'​) DEFAULT NULL,
 +  `use_ptime` enum('​yes','​no'​) DEFAULT NULL,
 +  `use_avpf` enum('​yes','​no'​) DEFAULT NULL,
 +  `media_encryption` enum('​no','​sdes','​dtls'​) DEFAULT NULL,
 +  `inband_progress` enum('​yes','​no'​) DEFAULT NULL,
 +  `call_group` varchar(40) DEFAULT NULL,
 +  `pickup_group` varchar(40) DEFAULT NULL,
 +  `named_call_group` varchar(40) DEFAULT NULL,
 +  `named_pickup_group` varchar(40) DEFAULT NULL,
 +  `device_state_busy_at` int(11) DEFAULT NULL,
 +  `fax_detect` enum('​yes','​no'​) DEFAULT NULL,
 +  `t38_udptl` enum('​yes','​no'​) DEFAULT NULL,
 +  `t38_udptl_ec` enum('​none','​fec','​redundancy'​) DEFAULT NULL,
 +  `t38_udptl_maxdatagram` int(11) DEFAULT NULL,
 +  `t38_udptl_nat` enum('​yes','​no'​) DEFAULT NULL,
 +  `t38_udptl_ipv6` enum('​yes','​no'​) DEFAULT NULL,
 +  `tone_zone` varchar(40) DEFAULT NULL,
 +  `language` varchar(40) DEFAULT NULL,
 +  `one_touch_recording` enum('​yes','​no'​) DEFAULT NULL,
 +  `record_on_feature` varchar(40) DEFAULT NULL,
 +  `record_off_feature` varchar(40) DEFAULT NULL,
 +  `rtp_engine` varchar(40) DEFAULT NULL,
 +  `allow_transfer` enum('​yes','​no'​) DEFAULT NULL,
 +  `allow_subscribe` enum('​yes','​no'​) DEFAULT NULL,
 +  `sdp_owner` varchar(40) DEFAULT NULL,
 +  `sdp_session` varchar(40) DEFAULT NULL,
 +  `tos_audio` varchar(10) DEFAULT NULL,
 +  `tos_video` varchar(10) DEFAULT NULL,
 +  `sub_min_expiry` int(11) DEFAULT NULL,
 +  `from_domain` varchar(40) DEFAULT NULL,
 +  `from_user` varchar(40) DEFAULT NULL,
 +  `mwi_from_user` varchar(40) DEFAULT NULL,
 +  `dtls_verify` varchar(40) DEFAULT NULL,
 +  `dtls_rekey` varchar(40) DEFAULT NULL,
 +  `dtls_cert_file` varchar(200) DEFAULT NULL,
 +  `dtls_private_key` varchar(200) DEFAULT NULL,
 +  `dtls_cipher` varchar(200) DEFAULT NULL,
 +  `dtls_ca_file` varchar(200) DEFAULT NULL,
 +  `dtls_ca_path` varchar(200) DEFAULT NULL,
 +  `dtls_setup` enum('​active','​passive','​actpass'​) DEFAULT NULL,
 +  `srtp_tag_32` enum('​yes','​no'​) DEFAULT NULL,
 +  `media_address` varchar(40) DEFAULT NULL,
 +  `redirect_method` enum('​user','​uri_core','​uri_pjsip'​) DEFAULT NULL,
 +  `set_var` text,
 +  `cos_audio` int(11) DEFAULT NULL,
 +  `cos_video` int(11) DEFAULT NULL,
 +  `message_context` varchar(40) DEFAULT NULL,
 +  `force_avp` enum('​yes','​no'​) DEFAULT NULL,
 +  `media_use_received_transport` enum('​yes','​no'​) DEFAULT NULL,
 +  `accountcode` varchar(80) DEFAULT NULL,
 +  `user_eq_phone` enum('​yes','​no'​) DEFAULT NULL,
 +  `moh_passthrough` enum('​yes','​no'​) DEFAULT NULL,
 +  `media_encryption_optimistic` enum('​yes','​no'​) DEFAULT NULL,
 +  `rpid_immediate` enum('​yes','​no'​) DEFAULT NULL,
 +  `g726_non_standard` enum('​yes','​no'​) DEFAULT NULL,
 +  `rtp_keepalive` int(11) DEFAULT NULL,
 +  `rtp_timeout` int(11) DEFAULT NULL,
 +  `rtp_timeout_hold` int(11) DEFAULT NULL,
 +  `bind_rtp_to_media_address` enum('​yes','​no'​) DEFAULT NULL,
 +  `voicemail_extension` varchar(40) DEFAULT NULL,
 +  `mwi_subscribe_replaces_unsolicited` int(11) DEFAULT NULL,
 +  `deny` varchar(95) DEFAULT NULL,
 +  `permit` varchar(95) DEFAULT NULL,
 +  `acl` varchar(40) DEFAULT NULL,
 +  `contact_deny` varchar(95) DEFAULT NULL,
 +  `contact_permit` varchar(95) DEFAULT NULL,
 +  `contact_acl` varchar(40) DEFAULT NULL,
 +  `subscribe_context` varchar(40) DEFAULT NULL,
 +  `fax_detect_timeout` int(11) DEFAULT NULL,
 +  `contact_user` varchar(80) DEFAULT NULL,
 +  `asymmetric_rtp_codec` enum('​yes','​no'​) DEFAULT NULL,
 +  UNIQUE KEY `id` (`id`),
 +  KEY `ps_endpoints_id` (`id`)
 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;​
 +
 +
 +CREATE TABLE `ps_globals` (
 +  `id` varchar(40) NOT NULL,
 +  `max_forwards` int(11) DEFAULT NULL,
 +  `user_agent` varchar(255) DEFAULT NULL,
 +  `default_outbound_endpoint` varchar(40) DEFAULT NULL,
 +  `debug` varchar(40) DEFAULT NULL,
 +  `endpoint_identifier_order` varchar(40) DEFAULT NULL,
 +  `max_initial_qualify_time` int(11) DEFAULT NULL,
 +  `default_from_user` varchar(80) DEFAULT NULL,
 +  `keep_alive_interval` int(11) DEFAULT NULL,
 +  `regcontext` varchar(80) DEFAULT NULL,
 +  `contact_expiration_check_interval` int(11) DEFAULT NULL,
 +  `default_voicemail_extension` varchar(40) DEFAULT NULL,
 +  `disable_multi_domain` enum('​yes','​no'​) DEFAULT NULL,
 +  `unidentified_request_count` int(11) DEFAULT NULL,
 +  `unidentified_request_period` int(11) DEFAULT NULL,
 +  `unidentified_request_prune_interval` int(11) DEFAULT NULL,
 +  `default_realm` varchar(40) DEFAULT NULL,
 +  `mwi_tps_queue_high` int(11) DEFAULT NULL,
 +  `mwi_tps_queue_low` int(11) DEFAULT NULL,
 +  `mwi_disable_initial_unsolicited` enum('​yes','​no'​) DEFAULT NULL,
 +  `ignore_uri_user_options` enum('​yes','​no'​) DEFAULT NULL,
 +  UNIQUE KEY `id` (`id`),
 +  KEY `ps_globals_id` (`id`)
 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;​
 +
 +
 +CREATE TABLE `ps_registrations` (
 +  `id` varchar(40) NOT NULL,
 +  `auth_rejection_permanent` enum('​yes','​no'​) DEFAULT NULL,
 +  `client_uri` varchar(255) DEFAULT NULL,
 +  `contact_user` varchar(40) DEFAULT NULL,
 +  `expiration` int(11) DEFAULT NULL,
 +  `max_retries` int(11) DEFAULT NULL,
 +  `outbound_auth` varchar(40) DEFAULT NULL,
 +  `outbound_proxy` varchar(40) DEFAULT NULL,
 +  `retry_interval` int(11) DEFAULT NULL,
 +  `forbidden_retry_interval` int(11) DEFAULT NULL,
 +  `server_uri` varchar(255) DEFAULT NULL,
 +  `transport` varchar(40) DEFAULT NULL,
 +  `support_path` enum('​yes','​no'​) DEFAULT NULL,
 +  `fatal_retry_interval` int(11) DEFAULT NULL,
 +  `line` enum('​yes','​no'​) DEFAULT NULL,
 +  `endpoint` varchar(40) DEFAULT NULL,
 +  UNIQUE KEY `id` (`id`),
 +  KEY `ps_registrations_id` (`id`)
 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;​
 +
 +
 +
 +CREATE TABLE `ps_subscription_persistence` (
 +  `id` varchar(40) NOT NULL,
 +  `packet` varchar(2048) DEFAULT NULL,
 +  `src_name` varchar(128) DEFAULT NULL,
 +  `src_port` int(11) DEFAULT NULL,
 +  `transport_key` varchar(64) DEFAULT NULL,
 +  `local_name` varchar(128) DEFAULT NULL,
 +  `local_port` int(11) DEFAULT NULL,
 +  `cseq` int(11) DEFAULT NULL,
 +  `tag` varchar(128) DEFAULT NULL,
 +  `endpoint` varchar(40) DEFAULT NULL,
 +  `expires` int(11) DEFAULT NULL,
 +  UNIQUE KEY `id` (`id`),
 +  KEY `ps_subscription_persistence_id` (`id`)
 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;​
 +
 +
 +CREATE TABLE `ps_systems` (
 +  `id` varchar(40) NOT NULL,
 +  `timer_t1` int(11) DEFAULT NULL,
 +  `timer_b` int(11) DEFAULT NULL,
 +  `compact_headers` enum('​yes','​no'​) DEFAULT NULL,
 +  `threadpool_initial_size` int(11) DEFAULT NULL,
 +  `threadpool_auto_increment` int(11) DEFAULT NULL,
 +  `threadpool_idle_timeout` int(11) DEFAULT NULL,
 +  `threadpool_max_size` int(11) DEFAULT NULL,
 +  `disable_tcp_switch` enum('​yes','​no'​) DEFAULT NULL,
 +  UNIQUE KEY `id` (`id`),
 +  KEY `ps_systems_id` (`id`)
 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;​
 +
 +
 +
 +CREATE TABLE `ps_transports` (
 +  `id` varchar(40) NOT NULL,
 +  `async_operations` int(11) DEFAULT NULL,
 +  `bind` varchar(40) DEFAULT NULL,
 +  `ca_list_file` varchar(200) DEFAULT NULL,
 +  `cert_file` varchar(200) DEFAULT NULL,
 +  `cipher` varchar(200) DEFAULT NULL,
 +  `domain` varchar(40) DEFAULT NULL,
 +  `external_media_address` varchar(40) DEFAULT NULL,
 +  `external_signaling_address` varchar(40) DEFAULT NULL,
 +  `external_signaling_port` int(11) DEFAULT NULL,
 +  `method` enum('​default','​unspecified','​tlsv1','​sslv2','​sslv3','​sslv23'​) DEFAULT NULL,
 +  `local_net` varchar(40) DEFAULT NULL,
 +  `password` varchar(40) DEFAULT NULL,
 +  `priv_key_file` varchar(200) DEFAULT NULL,
 +  `protocol` enum('​udp','​tcp','​tls','​ws','​wss'​) DEFAULT NULL,
 +  `require_client_cert` enum('​yes','​no'​) DEFAULT NULL,
 +  `verify_client` enum('​yes','​no'​) DEFAULT NULL,
 +  `verify_server` enum('​yes','​no'​) DEFAULT NULL,
 +  `tos` varchar(10) DEFAULT NULL,
 +  `cos` int(11) DEFAULT NULL,
 +  `allow_reload` enum('​yes','​no'​) DEFAULT NULL,
 +  UNIQUE KEY `id` (`id`),
 +  KEY `ps_transports_id` (`id`)
 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;​
 +</​code><​code>​
 +# cat /​etc/​asterisk/​sorcery.conf
 +</​code><​code>​
 +[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
 +</​code><​code>​
 +insert into ps_aors (id, max_contacts) values (403, 1);
 +insert into ps_aors (id, max_contacts) values (404, 1);
 +insert into ps_auths (id, auth_type, password, username) values (403, '​userpass',​ '​tpassword403',​ 403);
 +insert into ps_auths (id, auth_type, password, username) values (404, '​userpass',​ '​tpassword404',​ 404);
 +insert into ps_endpoints (id, transport, aors, auth, context, disallow, allow, direct_media) values (403, '​udp-transport-1',​ '​403',​ '​403',​ '​default',​ '​all',​ '​alaw',​ '​no'​);​
 +insert into ps_endpoints (id, transport, aors, auth, context, disallow, allow, direct_media) values (404, '​udp-transport-1',​ '​404',​ '​404',​ '​default',​ '​all',​ '​alaw',​ '​no'​);​
 +</​code>​
 ==== CHAN SIP ==== ==== CHAN SIP ====
  
Строка 778: Строка 1094:
  
 <​code>​ <​code>​
-# cat sipfriends.sql+# cat chan_sip_realtime.sql
 </​code><​code>​ </​code><​code>​
 CREATE TABLE IF NOT EXISTS `sipfriends` ( CREATE TABLE IF NOT EXISTS `sipfriends` (
Строка 875: Строка 1191:
 ) ENGINE=MyISAM;​ ) ENGINE=MyISAM;​
 </​code><​code>​ </​code><​code>​
-# mysql asterisk < sipfriends.sql+# mysql asterisk < chan_sip_realtime.sql
  
 # mysql asterisk # mysql asterisk
Строка 1052: Строка 1368:
  
 <​code>​ <​code>​
-# cat modules.conf+# cat /​etc/​asterisk/​modules.conf
 </​code><​code>​ </​code><​code>​
 ... ...
Строка 1058: Строка 1374:
 ... ...
 </​code><​code>​ </​code><​code>​
-# cat extconfig.conf+# cat /​etc/​asterisk/​extconfig.conf
 </​code><​code>​ </​code><​code>​
 [settings] [settings]
 sippeers => odbc,​asterisk,​sipfriends sippeers => odbc,​asterisk,​sipfriends
 +
 +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
 </​code>​ </​code>​
  
Строка 1323: Строка 1646:
 ==== Установка с сайта ==== ==== Установка с сайта ====
 <​code>​ <​code>​
-server# cd /​usr/​share/​asterisk/​sounds/ru/+server# cd /​usr/​share/​asterisk/​sounds
  
 server# mkdir ru; cd ru/ server# mkdir ru; cd ru/
Строка 1371: Строка 1694:
 </​code><​code>​ </​code><​code>​
 [general] [general]
 +
 ... ...
 +
 +;For IMAP/SMTP
 +;​charset=UTF-8
 +;​locale=ru_RU.UTF-8
 +;​emailsubject=Голосовое сообщение от абонента ${VM_CALLERID}
 +;​emailbody=Здравствуйте ${VM_NAME}\n\n${VM_DATE} получено голосовое сообщение от абонента ${VM_CALLERID}
 +;​emaildateformat=%A,​ %B %d, %Y в %r
 +
 +...
 +
 +;For IMAP
 ;debian# apt install asterisk-voicemail-imapstorage ;debian# apt install asterisk-voicemail-imapstorage
 ;debian# service asterisk restart ;debian# service asterisk restart
 ;​imapserver=mail.isp.un ;​imapserver=mail.isp.un
 ;​imapfolder=INBOX ;​imapfolder=INBOX
-;charset=UTF-8+ 
 +;For SMTP 
 +;debian# apt install postfix mailutils 
 ... ...
 +
 [corpX] [corpX]
 ;401 => ,, ;401 => ,,
Строка 1494: Строка 1833:
 Channel: sip/403 Channel: sip/403
 Context: default Context: default
-Extension: ​399 +Extension: ​601 
-CallerId: Conferencia <399>+CallerId: Conferencia <601>
 </​code><​code>​ </​code><​code>​
 server# cat /​usr/​share/​401.call server# cat /​usr/​share/​401.call
Строка 1501: Строка 1840:
 Channel: sip/401 Channel: sip/401
 Context: default Context: default
-Extension: ​399 +Extension: ​601 
-CallerId: Conferencia <399>+CallerId: Conferencia <601>
 </​code><​code>​ </​code><​code>​
 server# cat /​usr/​share/​start_conference.sh server# cat /​usr/​share/​start_conference.sh
Строка 1769: Строка 2108:
 exten => _4XX,​1,​Dial(SIP/​${EXTEN},​10) exten => _4XX,​1,​Dial(SIP/​${EXTEN},​10)
 exten => _4XX,​n,​Set(MY-CALLED-USER-NAME=${ODBC_SIPFRIENDS_BY_NAME(${EXTEN})}) exten => _4XX,​n,​Set(MY-CALLED-USER-NAME=${ODBC_SIPFRIENDS_BY_NAME(${EXTEN})})
-exten => _4XX,​n,​Festival(${MY-CALLED-USER-NAME} ​занят)+exten => _4XX,​n,​Festival(${MY-CALLED-USER-NAME} не может ответить)
  
 </​code>​ </​code>​
Строка 2021: Строка 2360:
   * !!! Название функции только ЗАГЛАВНЫМИ буквами   * !!! Название функции только ЗАГЛАВНЫМИ буквами
   * [[https://​www.voip-info.org/​wiki/​view/​Asterisk+func+shell|Asterisk func shell]]   * [[https://​www.voip-info.org/​wiki/​view/​Asterisk+func+shell|Asterisk func shell]]
 +  * Сервис HTTP [[Сервис HTTP#​Управление кодировкой]]
  
 <​code>​ <​code>​
 +# mkdir /​var/​www/​html/​asterisk/​
 +
 +# cat /​var/​www/​html/​asterisk/​addrbook.txt
 +</​code><​code>​
 +Иван Иванов<​+74951234561>​
 +Петр Петров<​+74951234562>​
 +</​code><​code>​
 +# cat /​usr/​local/​bin/​get-customer-callerid-all.sh
 +</​code><​code>​
 +#!/bin/sh
 +
 +PHONE=$1
 +
 +ADDR_BOOK=/​var/​www/​html/​asterisk/​addrbook.txt
 +
 +grep $PHONE $ADDR_BOOK || echo $PHONE
 +</​code><​code>​
 # cat /​etc/​asterisk/​extensions.conf # cat /​etc/​asterisk/​extensions.conf
 </​code><​code>​ </​code><​code>​
 ... ...
-exten => _4XX,1,Set(MY-RES=${SHELL(test -e /etc/asterisk/nocall && echo -n DENY || echo -n ALLOW)}) +exten => _4XX,n,ExecIf($["​${CALLERID(name)}"​=""​]?​Set(CALLERID(all)=${SHELL(/usr/local/bin/get-customer-callerid-all.sh ​${CALLERID(num)})}))
-exten => _4XX,​n,​Verbose(1,​MY-RES is ${MY-RES}) +
-exten => _4XX,​n,​GotoIf($[${MY-RES= DENY]?end) +
-exten => _4XX,​n,​Dial(SIP/​${EXTEN}) +
-exten => _4XX,​n(end),​Hangup()+
 ... ...
 </​code>​ </​code>​
Строка 2184: Строка 2537:
  
 <​code>​ <​code>​
-# curl -v -X GET "http://​localhost:​8088/​ari/​endpoints?​api_key=asterisk:​asterisk"+# curl http://​localhost:​8088/​ari/​endpoints?​api_key=asterisk:​asterisk
 </​code>​ </​code>​
  
Строка 2192: Строка 2545:
  
 <​code>​ <​code>​
-# curl -sL https://​deb.nodesource.com/​setup_9.x | sudo -E bash -+debian9# curl -sL https://​deb.nodesource.com/​setup_9.x | sudo -E bash -
  
-# apt install -y nodejs+# apt install -y nodejs ​npm
  
 # npm install -g wscat # npm install -g wscat
Строка 2248: Строка 2601:
 secret=Pa$$w0rd secret=Pa$$w0rd
 port=5222 port=5222
-usetls=yes+;usetls=yes 
 +;usetls=no
 </​code><​code>​ </​code><​code>​
 *CLI> module reload res_xmpp *CLI> module reload res_xmpp
сервис_asterisk.1575463049.txt.gz · Последние изменения: 2019/12/04 15:37 — val