diff --git a/MySQL_conf_pbx/test1/conf/asterisk/rtp.conf b/MySQL_conf_pbx/test1/conf/asterisk/rtp.conf index 90d54bd..a758837 100755 --- a/MySQL_conf_pbx/test1/conf/asterisk/rtp.conf +++ b/MySQL_conf_pbx/test1/conf/asterisk/rtp.conf @@ -8,15 +8,8 @@ ; Defaults are rtpstart=5000 and rtpend=31000 ; rtpstart=10000 -rtpend=10050 - -;rtpstart=20000 -;rtpend=21000 - -strictrtp=no -probation=8 - -;rtpend=20000 +rtpend=20000 +;strictrtp=no ; ; Whether to enable or disable UDP checksums on RTP traffic ; @@ -136,7 +129,7 @@ probation=8 ; by default. The minimum MTU is 256. ; dtls_mtu = 1200 ; -[ice_host_candidates] +;[ice_host_candidates] ; ; When Asterisk is behind a static one-to-one NAT and ICE is in use, ICE will ; expose the server's internal IP address as one of the host candidates. diff --git a/MySQL_conf_pbx/test1/conf/odbc.ini b/MySQL_conf_pbx/test1/conf/odbc.ini index 9e49656..ee1cd81 100755 --- a/MySQL_conf_pbx/test1/conf/odbc.ini +++ b/MySQL_conf_pbx/test1/conf/odbc.ini @@ -7,12 +7,13 @@ ;Password = asterisk_pass ;Port = 3306 ;Option = 3 - +;${HOST_IP} [asterisk] Description = MariaDB connection to Asterisk Driver = MariaDB -Server = mat_mariadb +;Server = 172.20.100.122 +Server = 127.0.0.1 Database = asterisk_db User = asterisk_user Password = asterisk_pass diff --git a/MySQL_conf_pbx/test1/docker-compose.yml b/MySQL_conf_pbx/test1/docker-compose.yml index 11a27e4..45ff579 100755 --- a/MySQL_conf_pbx/test1/docker-compose.yml +++ b/MySQL_conf_pbx/test1/docker-compose.yml @@ -7,17 +7,11 @@ services: tty: true depends_on: - mariadb - ports: - - "5060:5060/udp" # SIP signaling - # - "5060:5060/tcp" # SIP signaling (TCP fallback) - #- "20000-21000:20000-21000/udp" # RTP ports for audio - - "10000-10050:10000-10050/udp" # RTP ports volumes: - ./conf/odbc.ini:/etc/odbc.ini - ./conf/odbcinst.ini:/etc/odbcinst.ini - ./conf/asterisk/:/etc/asterisk/ - networks: - - asterisk-net + network_mode: "host" mariadb: image: mariadb @@ -30,24 +24,6 @@ services: MYSQL_PASSWORD: asterisk_pass volumes: - ./mariadb_data:/var/lib/mysql # Persistent data - ports: - - "3307:3306" - networks: - - asterisk-net - - # *** only needed if your not running docker as a sudo user necessary for mariadb container db access - # user: "999:999" # Ensures the container runs as the mysql user, matching volume ownership - # command: "--innodb-buffer-pool-size=256M" - # healthcheck: # Optional: Ensure MariaDB is healthy before Asterisk connects - # test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-prootpassword"] - # interval: 10s - # timeout: 5s - # retries: 5 - # *** - -networks: - asterisk-net: - driver: bridge - + network_mode: "host" # \ No newline at end of file diff --git a/MySQL_conf_pbx/test1/mariadb_data/aria_log.00000001 b/MySQL_conf_pbx/test1/mariadb_data/aria_log.00000001 index e2a933f..196d50b 100755 Binary files a/MySQL_conf_pbx/test1/mariadb_data/aria_log.00000001 and b/MySQL_conf_pbx/test1/mariadb_data/aria_log.00000001 differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/aria_log_control b/MySQL_conf_pbx/test1/mariadb_data/aria_log_control index d91dca8..052b5b4 100755 Binary files a/MySQL_conf_pbx/test1/mariadb_data/aria_log_control and b/MySQL_conf_pbx/test1/mariadb_data/aria_log_control differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_auths.ibd b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_auths.ibd index 2efa71a..f8346ff 100755 Binary files a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_auths.ibd and b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_auths.ibd differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_endpoints.frm b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_endpoints.frm index c1b5016..c3ff36b 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_endpoints.frm and b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_endpoints.frm differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_endpoints.ibd b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_endpoints.ibd old mode 100755 new mode 100644 index 741971c..ec2d65a Binary files a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_endpoints.ibd and b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/ps_endpoints.ibd differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/ddl_recovery.log b/MySQL_conf_pbx/test1/mariadb_data/ddl_recovery.log new file mode 100644 index 0000000..5e30b6d Binary files /dev/null and b/MySQL_conf_pbx/test1/mariadb_data/ddl_recovery.log differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/ib_buffer_pool b/MySQL_conf_pbx/test1/mariadb_data/ib_buffer_pool old mode 100755 new mode 100644 index 3f40119..83c925c --- a/MySQL_conf_pbx/test1/mariadb_data/ib_buffer_pool +++ b/MySQL_conf_pbx/test1/mariadb_data/ib_buffer_pool @@ -1,13 +1,20 @@ +14,5 +14,4 +14,3 +14,2 +14,1 +14,0 11,4 11,3 10,3 9,3 -8,3 7,3 5,3 4,3 3,2 +2,2 1,2 +0,9 1,45 3,44 2,44 diff --git a/MySQL_conf_pbx/test1/mariadb_data/ib_logfile0 b/MySQL_conf_pbx/test1/mariadb_data/ib_logfile0 index be92852..25824c7 100755 Binary files a/MySQL_conf_pbx/test1/mariadb_data/ib_logfile0 and b/MySQL_conf_pbx/test1/mariadb_data/ib_logfile0 differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/ibdata1 b/MySQL_conf_pbx/test1/mariadb_data/ibdata1 index dbaa288..78abea3 100755 Binary files a/MySQL_conf_pbx/test1/mariadb_data/ibdata1 and b/MySQL_conf_pbx/test1/mariadb_data/ibdata1 differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/ibtmp1 b/MySQL_conf_pbx/test1/mariadb_data/ibtmp1 new file mode 100644 index 0000000..202d95c Binary files /dev/null and b/MySQL_conf_pbx/test1/mariadb_data/ibtmp1 differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_index_stats.ibd b/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_index_stats.ibd index 15b8ad3..ad957c1 100755 Binary files a/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_index_stats.ibd and b/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_index_stats.ibd differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_table_stats.ibd b/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_table_stats.ibd index a7d37da..8646b8a 100755 Binary files a/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_table_stats.ibd and b/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_table_stats.ibd differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/tc.log b/MySQL_conf_pbx/test1/mariadb_data/tc.log new file mode 100644 index 0000000..0ca0162 Binary files /dev/null and b/MySQL_conf_pbx/test1/mariadb_data/tc.log differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/undo001 b/MySQL_conf_pbx/test1/mariadb_data/undo001 index bffa8c1..4978d49 100755 Binary files a/MySQL_conf_pbx/test1/mariadb_data/undo001 and b/MySQL_conf_pbx/test1/mariadb_data/undo001 differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/undo002 b/MySQL_conf_pbx/test1/mariadb_data/undo002 index e65900d..185b7be 100755 Binary files a/MySQL_conf_pbx/test1/mariadb_data/undo002 and b/MySQL_conf_pbx/test1/mariadb_data/undo002 differ diff --git a/MySQL_conf_pbx/test1/mariadb_data/undo003 b/MySQL_conf_pbx/test1/mariadb_data/undo003 index affa39f..da90243 100755 Binary files a/MySQL_conf_pbx/test1/mariadb_data/undo003 and b/MySQL_conf_pbx/test1/mariadb_data/undo003 differ diff --git a/MySQL_conf_pbx/test1/theAlter.sql b/MySQL_conf_pbx/test1/theAlter.sql new file mode 100644 index 0000000..418af76 --- /dev/null +++ b/MySQL_conf_pbx/test1/theAlter.sql @@ -0,0 +1,91 @@ +USE asterisk_db; + +CREATE TABLE ps_endpoints ( + id VARCHAR(40) NOT NULL PRIMARY KEY, + transport VARCHAR(40) NULL, + aors VARCHAR(200) NULL, + auth VARCHAR(40) NULL, + context VARCHAR(40) NULL, + disallow VARCHAR(200) NULL, + allow VARCHAR(200) NULL, + direct_media VARCHAR(40) NULL, + connected_line_method VARCHAR(40) NULL, + callerid VARCHAR(40) NULL, + dtmf_mode VARCHAR(40) NULL +); + +CREATE TABLE ps_auths ( + id VARCHAR(40) NOT NULL PRIMARY KEY, + auth_type VARCHAR(40) NOT NULL, + username VARCHAR(40) NULL, + password VARCHAR(40) NULL, + md5_cred VARCHAR(40) NULL, + realm VARCHAR(40) NULL +); + +CREATE TABLE ps_aors ( + id VARCHAR(40) NOT NULL PRIMARY KEY, + max_contacts INTEGER NULL +); + + +CREATE TABLE extensions_table ( + id INT AUTO_INCREMENT PRIMARY KEY, + context VARCHAR(50) NOT NULL, + exten VARCHAR(50) NOT NULL, + priority INT NOT NULL, + app VARCHAR(50) NOT NULL, + appdata VARCHAR(100) +); + + + +INSERT INTO ps_endpoints (id, transport, aors, auth, context, disallow, allow) +VALUES ('1001', 'transport-udp', '1001', '1001', 'default', 'all', 'ulaw,alaw'); + +INSERT INTO ps_auths (id, auth_type, username, password) +VALUES ('1001', 'userpass', '1001', 'mypassword'); + +INSERT INTO ps_aors (id, max_contacts) +VALUES ('1001', 1); + + + +-- Add Authentication for 1002 +INSERT INTO ps_auths (id, auth_type, username, password) +VALUES ('1002', 'userpass', '1002', 'securepass'); + +-- Add Endpoint for 1002 +INSERT INTO ps_endpoints (id, transport, aors, auth, context, disallow, allow, direct_media) +VALUES ('1002', 'transport-udp', '1002', '1002', 'default', 'all', 'ulaw,alaw', 'no'); + +-- Add AOR (Address of Record) for 1002 +INSERT INTO ps_aors (id, max_contacts) +VALUES ('1002', 2); + + +INSERT INTO extensions_table (context, exten, priority, app, appdata) +VALUES +('default', '1001', 1, 'Dial', 'PJSIP/1001,20'), +('default', '1002', 1, 'Dial', 'PJSIP/1002,20'); + +SELECT * FROM extensions_table; + + +ALTER TABLE ps_endpoints +ADD COLUMN rtp_symmetric VARCHAR(5) DEFAULT 'yes', +ADD COLUMN force_rport VARCHAR(5) DEFAULT 'yes', +ADD COLUMN rewrite_contact VARCHAR(5) DEFAULT 'yes'; + + +UPDATE ps_endpoints +SET rtp_symmetric='yes', force_rport='yes', rewrite_contact='yes' +WHERE id IN ('1001', '1002'); + + +SELECT * FROM ps_endpoints; + +DROP TABLE `ps_endpoints`; + +SHOW TABLES; + diff --git a/MySQL_conf_pbx/test1/three_users.sql b/MySQL_conf_pbx/test1/three_users.sql new file mode 100644 index 0000000..74b2491 --- /dev/null +++ b/MySQL_conf_pbx/test1/three_users.sql @@ -0,0 +1,91 @@ +USE asterisk_db; + +CREATE TABLE ps_endpoints ( + id VARCHAR(40) NOT NULL PRIMARY KEY, + transport VARCHAR(40) NULL, + aors VARCHAR(200) NULL UNIQUE, + auth VARCHAR(40) NULL UNIQUE, + context VARCHAR(40) NULL, + disallow VARCHAR(200) NULL, + allow VARCHAR(200) NULL, + direct_media VARCHAR(40) NULL, + connected_line_method VARCHAR(40) NULL, + callerid VARCHAR(40) NULL, + dtmf_mode VARCHAR(40) NULL +); + +CREATE TABLE ps_auths ( + id VARCHAR(40) NOT NULL PRIMARY KEY, + auth_type VARCHAR(40) NOT NULL, + username VARCHAR(40) NULL UNIQUE, + password VARCHAR(40) NULL, + md5_cred VARCHAR(40) NULL, + realm VARCHAR(40) NULL +); + +CREATE TABLE ps_aors ( + id VARCHAR(40) NOT NULL PRIMARY KEY, + max_contacts INTEGER NULL +); + + +CREATE TABLE extensions_table ( + id INT AUTO_INCREMENT PRIMARY KEY, + context VARCHAR(50) NOT NULL, + exten VARCHAR(50) NOT NULL UNIQUE, + priority INT NOT NULL, + app VARCHAR(50) NOT NULL, + appdata VARCHAR(100) +); + + + +INSERT INTO ps_endpoints (id, transport, aors, auth, context, disallow, allow) +VALUES ('1001', 'transport-udp', '1001', '1001', 'default', 'all', 'ulaw,alaw'); + +INSERT INTO ps_auths (id, auth_type, username, password) +VALUES ('1001', 'userpass', '1001', '12345'); + +INSERT INTO ps_aors (id, max_contacts) +VALUES ('1001', 1); + + +-- Add Endpoint for 1002 +INSERT INTO ps_endpoints (id, transport, aors, auth, context, disallow, allow, direct_media) +VALUES ('1002', 'transport-udp', '1002', '1002', 'default', 'all', 'ulaw,alaw', 'no'); + +-- Add Authentication for 1002 +INSERT INTO ps_auths (id, auth_type, username, password) +VALUES ('1002', 'userpass', '1002', '12345'); + +-- Add AOR (Address of Record) for 1002 +INSERT INTO ps_aors (id, max_contacts) +VALUES ('1002', 2); + +INSERT INTO ps_endpoints (id, transport, aors, auth, context, disallow, allow, direct_media) +VALUES ('1003', 'transport-udp', '1003', '1003', 'default', 'all', 'ulaw,alaw', 'no'); + +-- Add Authentication for 1002 +INSERT INTO ps_auths (id, auth_type, username, password) +VALUES ('1003', 'userpass', '1003', '12345'); + +-- Add AOR (Address of Record) for 1002 +INSERT INTO ps_aors (id, max_contacts) +VALUES ('1003', 2); + + +INSERT INTO extensions_table (context, exten, priority, app, appdata) +VALUES +('default', '1001', 1, 'Dial', 'PJSIP/1001,20'), +('default', '1002', 1, 'Dial', 'PJSIP/1002,20'), +('default', '1003', 1, 'Dial', 'PJSIP/1003,20'); + +SELECT * FROM extensions_table; + +-- DROP TABLE `extensions_table`; + +SELECT * FROM extensions_table WHERE context='default'; + + +SHOW TABLES; +