Asterisk realtime: Difference between revisions

From 탱이의 잡동사니
Jump to navigation Jump to search
No edit summary
 
Line 65: Line 65:
<pre>
<pre>
$ alembic -c config.ini upgrade head
$ 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>
</pre>



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