Asterisk realtime: Difference between revisions

From 탱이의 잡동사니
Jump to navigation Jump to search
(Created page with "== Overview == Asterisk realtime architecture 내용 정리 == See also == * http://www.voip-info.org/wiki/view/Asterisk+RealTime - Asterisk RealTime category:asterisk")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Overview ==
== Overview ==
Asterisk realtime architecture 내용 정리
Asterisk realtime architecture 내용 정리
== Installation ==
=== Required package ===
Debian 10
<pre>
      - unixodbc
      - unixodbc-dev
      - odbc-mariadb
      - python
      - python-dev
      - python-pip
      - python-mysqldb
</pre>
<pre>
$ sudo pip install alembic
</pre>
=== alembic ===
<pre>
# A generic, single database configuration.
[alembic]
script_location = config
sqlalchemy.url = {{ database_type }}://{{ database_username }}:{{ database_password }}@{{ database_hostname }}:{{ database_port }}/{{ database_name }}
[loggers]
keys = root,sqlalchemy,alembic
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = WARN
handlers = console
qualname =
[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine
[logger_alembic]
level = INFO
handlers =
qualname = alembic
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S
</pre>
Run alembic
<pre>
$ alembic -c config.ini upgrade head
</pre>
== MySQL Setting ==
sorcery.conf 파일에 다음과 같이 설정한다.
<pre>
; Realtime PJSIP configuration wizard
[res_pjsip]
endpoint=realtime,ps_endpoints
endpoint=config,pjsip.conf,criteria=type=endpoint
auth=realtime,ps_auths
auth=config,pjsip.conf,criteria=type=auth
aor=realtime,ps_aors
aor=config,pjsip.conf,criteria=type=aor
domain_alias=realtime,ps_domain_aliases
domain_alias=config,pjsip.conf,criteria=type=domain_alias
contact=realtime,ps_contacts
contact=config,pjsip.conf,criteria=type=contact
[res_pjsip_endpoint_identifier_ip]
identify=realtime,ps_endpoint_id_ips
identify=config,pjsip.conf,criteria=type=identify
</pre>
res_config_mysql.conf 에 다음과 같이 설정한다.
<pre>
[general]
dbhost = 192.168.10.15
dbname = asterisk
dbuser = asterisk
dbpass = password
dbport = 3306
dbcharset = utf8
requirements=warn ; or createclose or createchar
</pre>


== See also ==
== See also ==
* https://wiki.asterisk.org/wiki/display/AST/Setting+up+PJSIP+Realtime - Setting up PJSIP Realtime
* https://wiki.asterisk.org/wiki/display/AST/Realtime+Database+Configuration - Realtime Database Configuration
* http://www.voip-info.org/wiki/view/Asterisk+RealTime - Asterisk RealTime
* http://www.voip-info.org/wiki/view/Asterisk+RealTime - Asterisk RealTime


[[category:asterisk]]
[[category:asterisk]]

Latest revision as of 17:17, 5 March 2021

Overview

Asterisk realtime architecture 내용 정리

Installation

Required package

Debian 10

      - unixodbc
      - unixodbc-dev
      - odbc-mariadb
      - python
      - python-dev
      - python-pip
      - python-mysqldb
$ sudo pip install alembic

alembic

# A generic, single database configuration.

[alembic]
script_location = config
sqlalchemy.url = {{ database_type }}://{{ database_username }}:{{ database_password }}@{{ database_hostname }}:{{ database_port }}/{{ database_name }}

[loggers]
keys = root,sqlalchemy,alembic

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = WARN
handlers = console
qualname =

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine

[logger_alembic]
level = INFO
handlers =
qualname = alembic

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S

Run alembic

$ alembic -c config.ini upgrade head

MySQL Setting

sorcery.conf 파일에 다음과 같이 설정한다.

; Realtime PJSIP configuration wizard
[res_pjsip]
endpoint=realtime,ps_endpoints
endpoint=config,pjsip.conf,criteria=type=endpoint

auth=realtime,ps_auths
auth=config,pjsip.conf,criteria=type=auth

aor=realtime,ps_aors
aor=config,pjsip.conf,criteria=type=aor

domain_alias=realtime,ps_domain_aliases
domain_alias=config,pjsip.conf,criteria=type=domain_alias

contact=realtime,ps_contacts
contact=config,pjsip.conf,criteria=type=contact

[res_pjsip_endpoint_identifier_ip]
identify=realtime,ps_endpoint_id_ips
identify=config,pjsip.conf,criteria=type=identify


res_config_mysql.conf 에 다음과 같이 설정한다.

[general]
dbhost = 192.168.10.15
dbname = asterisk
dbuser = asterisk
dbpass = password
dbport = 3306
dbcharset = utf8
requirements=warn ; or createclose or createchar

See also