diff --git a/MySQL_conf_pbx/test1/Dockerfile b/MySQL_conf_pbx/test1/Dockerfile index 043e136..ecb6468 100755 --- a/MySQL_conf_pbx/test1/Dockerfile +++ b/MySQL_conf_pbx/test1/Dockerfile @@ -8,14 +8,14 @@ RUN apk update && \ apk add unixodbc && \ apk add unixodbc-dev && \ apk add mariadb-connector-odbc && \ - apk add --no-cache ffmpeg && \ - apk add --no-cache lame && \ - apk add --no-cache asterisk-mp3 + mkdir -p /etc/asterisk/moh + # apk add --no-cache unixodbc unixodbc-dev mariadb-connector-odbc + # Copy custom Asterisk config files #COPY asterisk_config/ /etc/asterisk/ # Start Asterisk in verbose mode -CMD ["asterisk", "-fvvvvv"] +CMD ["asterisk", "-fvvvvv"] \ No newline at end of file diff --git a/MySQL_conf_pbx/test1/conf/asterisk/extconfig.conf b/MySQL_conf_pbx/test1/conf/asterisk/extconfig.conf index 0e3eb36..bfda3fe 100755 --- a/MySQL_conf_pbx/test1/conf/asterisk/extconfig.conf +++ b/MySQL_conf_pbx/test1/conf/asterisk/extconfig.conf @@ -132,6 +132,9 @@ ps_endpoints => odbc,asterisk,ps_endpoints ps_auths => odbc,asterisk,ps_auths ps_aors => odbc,asterisk,ps_aors extensions => odbc,asterisk,extensions_table +;moh for music on hold +;moh => odbc,asterisk,moh_classes + diff --git a/MySQL_conf_pbx/test1/conf/asterisk/moh/holdmusic.wav b/MySQL_conf_pbx/test1/conf/asterisk/moh/holdmusic.wav new file mode 100644 index 0000000..e1e2151 Binary files /dev/null and b/MySQL_conf_pbx/test1/conf/asterisk/moh/holdmusic.wav differ diff --git a/MySQL_conf_pbx/test1/conf/asterisk/musiconhold.conf b/MySQL_conf_pbx/test1/conf/asterisk/musiconhold.conf index ca1d2fc..358b686 100755 --- a/MySQL_conf_pbx/test1/conf/asterisk/musiconhold.conf +++ b/MySQL_conf_pbx/test1/conf/asterisk/musiconhold.conf @@ -1,7 +1,7 @@ ; ; Music on Hold -- Sample Configuration ; -[general] +;[general] ;cachertclasses=yes ; use 1 instance of moh class for all users who are using it, ; decrease consumable cpu cycles and memory ; disabled by default @@ -62,9 +62,18 @@ ; configuration. The 'sort' option is not used for this mode. ; +;[default] +;mode=files +;directory=moh + [default] mode=files -directory=moh +directory=/etc/asterisk/moh +;sort=random +random=yes + + + ; ;[native-random] ;mode=files diff --git a/MySQL_conf_pbx/test1/docker-compose.yml b/MySQL_conf_pbx/test1/docker-compose.yml index 41134dc..99a0519 100755 --- a/MySQL_conf_pbx/test1/docker-compose.yml +++ b/MySQL_conf_pbx/test1/docker-compose.yml @@ -1,7 +1,7 @@ version: "3.8" services: asterisk: - image: mathewfrancisv/odbc_mariadb:v2.0.0 + image: mathewfrancisv/odbc_mariadb:v2.0.1 container_name: mat_asterisk restart: always tty: true diff --git a/MySQL_conf_pbx/test1/mariadb_data/aria_log.00000001 b/MySQL_conf_pbx/test1/mariadb_data/aria_log.00000001 index c25b6c3..964ee6f 100644 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 636e7f9..77cc87c 100644 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/extensions_table.ibd b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/extensions_table.ibd index e160be3..1b4fcfc 100644 Binary files a/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/extensions_table.ibd and b/MySQL_conf_pbx/test1/mariadb_data/asterisk_db/extensions_table.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 91c0a28..f3efce6 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 index e3cba9c..f34f7da 100644 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/ib_logfile0 b/MySQL_conf_pbx/test1/mariadb_data/ib_logfile0 index c2c9993..cb014f0 100644 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 2828de3..8e4c647 100644 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/mysql/innodb_index_stats.ibd b/MySQL_conf_pbx/test1/mariadb_data/mysql/innodb_index_stats.ibd index ce71b09..239f874 100644 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 f8a82fc..6bb97d4 100644 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/undo001 b/MySQL_conf_pbx/test1/mariadb_data/undo001 index 6f36c9b..f34eb86 100644 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 72f718d..c68b06c 100644 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 090e1a4..1c72e7c 100644 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/recordings/1001-1742819424.37.wav b/MySQL_conf_pbx/test1/recordings/1001-1742819424.37.wav new file mode 100644 index 0000000..c58bb42 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1001-1742819424.37.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1001-1742882209.0.wav b/MySQL_conf_pbx/test1/recordings/1001-1742882209.0.wav new file mode 100644 index 0000000..a2eb8f1 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1001-1742882209.0.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1001-1742883465.0.wav b/MySQL_conf_pbx/test1/recordings/1001-1742883465.0.wav new file mode 100644 index 0000000..81a85b6 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1001-1742883465.0.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1001-1742883795.18.wav b/MySQL_conf_pbx/test1/recordings/1001-1742883795.18.wav new file mode 100644 index 0000000..dadc96d Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1001-1742883795.18.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1001-1742893923.9.wav b/MySQL_conf_pbx/test1/recordings/1001-1742893923.9.wav new file mode 100644 index 0000000..5053471 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1001-1742893923.9.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1002-1742819424.37.wav b/MySQL_conf_pbx/test1/recordings/1002-1742819424.37.wav new file mode 100644 index 0000000..c58bb42 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1002-1742819424.37.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1002-1742882209.0.wav b/MySQL_conf_pbx/test1/recordings/1002-1742882209.0.wav new file mode 100644 index 0000000..a2eb8f1 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1002-1742882209.0.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1002-1742885776.6.wav b/MySQL_conf_pbx/test1/recordings/1002-1742885776.6.wav new file mode 100644 index 0000000..360db9f Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1002-1742885776.6.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1002-1742886171.6.wav b/MySQL_conf_pbx/test1/recordings/1002-1742886171.6.wav new file mode 100644 index 0000000..e445107 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1002-1742886171.6.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1002-1742889692.0.wav b/MySQL_conf_pbx/test1/recordings/1002-1742889692.0.wav new file mode 100644 index 0000000..fffce0c Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1002-1742889692.0.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1002-1742889766.3.wav b/MySQL_conf_pbx/test1/recordings/1002-1742889766.3.wav new file mode 100644 index 0000000..1c1f4a1 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1002-1742889766.3.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1002-1742890346.0.wav b/MySQL_conf_pbx/test1/recordings/1002-1742890346.0.wav new file mode 100644 index 0000000..bd01ebf Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1002-1742890346.0.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1002-1742890648.3.wav b/MySQL_conf_pbx/test1/recordings/1002-1742890648.3.wav new file mode 100644 index 0000000..25e7e52 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1002-1742890648.3.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1002-1742893752.3.wav b/MySQL_conf_pbx/test1/recordings/1002-1742893752.3.wav new file mode 100644 index 0000000..40fcbad Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1002-1742893752.3.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1002-1742893818.6.wav b/MySQL_conf_pbx/test1/recordings/1002-1742893818.6.wav new file mode 100644 index 0000000..086e194 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1002-1742893818.6.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1002-1742893923.9.wav b/MySQL_conf_pbx/test1/recordings/1002-1742893923.9.wav new file mode 100644 index 0000000..5053471 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1002-1742893923.9.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1002-1742894086.14.wav b/MySQL_conf_pbx/test1/recordings/1002-1742894086.14.wav new file mode 100644 index 0000000..80cafac Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1002-1742894086.14.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1002-1742894110.17.wav b/MySQL_conf_pbx/test1/recordings/1002-1742894110.17.wav new file mode 100644 index 0000000..d60ce1c Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1002-1742894110.17.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1003-1742883531.3.wav b/MySQL_conf_pbx/test1/recordings/1003-1742883531.3.wav new file mode 100644 index 0000000..8289f07 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1003-1742883531.3.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1003-1742883705.6.wav b/MySQL_conf_pbx/test1/recordings/1003-1742883705.6.wav new file mode 100644 index 0000000..7bc587e Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1003-1742883705.6.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1003-1742883707.8.wav b/MySQL_conf_pbx/test1/recordings/1003-1742883707.8.wav new file mode 100644 index 0000000..64ec696 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1003-1742883707.8.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1003-1742883738.11.wav b/MySQL_conf_pbx/test1/recordings/1003-1742883738.11.wav new file mode 100644 index 0000000..38914ba Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1003-1742883738.11.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1003-1742883764.15.wav b/MySQL_conf_pbx/test1/recordings/1003-1742883764.15.wav new file mode 100644 index 0000000..d7fe846 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1003-1742883764.15.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1003-1742884989.0.wav b/MySQL_conf_pbx/test1/recordings/1003-1742884989.0.wav new file mode 100644 index 0000000..2651fb7 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1003-1742884989.0.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1003-1742885735.3.wav b/MySQL_conf_pbx/test1/recordings/1003-1742885735.3.wav new file mode 100644 index 0000000..862c59d Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1003-1742885735.3.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1003-1742885975.0.wav b/MySQL_conf_pbx/test1/recordings/1003-1742885975.0.wav new file mode 100644 index 0000000..8c88fc5 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1003-1742885975.0.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1003-1742886055.3.wav b/MySQL_conf_pbx/test1/recordings/1003-1742886055.3.wav new file mode 100644 index 0000000..19552e8 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1003-1742886055.3.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1003-1742890601.0.wav b/MySQL_conf_pbx/test1/recordings/1003-1742890601.0.wav new file mode 100644 index 0000000..931e80d Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1003-1742890601.0.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1003-1742893639.0.wav b/MySQL_conf_pbx/test1/recordings/1003-1742893639.0.wav new file mode 100644 index 0000000..8dbfe88 Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1003-1742893639.0.wav differ diff --git a/MySQL_conf_pbx/test1/recordings/1003-1742894363.20.wav b/MySQL_conf_pbx/test1/recordings/1003-1742894363.20.wav new file mode 100644 index 0000000..cc2292b Binary files /dev/null and b/MySQL_conf_pbx/test1/recordings/1003-1742894363.20.wav differ diff --git a/MySQL_conf_pbx/test1/three_users.sql b/MySQL_conf_pbx/test1/three_users.sql index 646440a..eef6500 100644 --- a/MySQL_conf_pbx/test1/three_users.sql +++ b/MySQL_conf_pbx/test1/three_users.sql @@ -107,8 +107,44 @@ VALUES INSERT INTO extensions_table (context, exten, priority, app, appdata) VALUES ('default', '1001', 5, 'GotoIf', '${DIALSTATUS}=NOANSWER?default,1002,1'); + -- +-- music on hold +USE asterisk_db; + +-- CREATE TABLE moh_classes ( +-- name VARCHAR(40) PRIMARY KEY, +-- mode VARCHAR(20) NOT NULL, +-- directory VARCHAR(255), +-- application VARCHAR(255), +-- digit INTEGER DEFAULT NULL, +-- sort VARCHAR(10) DEFAULT 'random' +-- ); +-- +-- INSERT INTO moh_classes (name, mode, directory, sort) +-- VALUES +-- ('default', 'files', '/etc/asterisk/moh', 'random'); +-- +-- SELECT * FROM moh_classes; +-- +-- DROP TABLE `moh_classes`; + +INSERT INTO extensions_table (context, exten, priority, app, appdata) +VALUES +('default', '1001', 20, 'MusicOnHold', 'default'), +('default', '1002', 20, 'MusicOnHold', 'default'), +('default', '1003', 20, 'MusicOnHold', 'default'); + +UPDATE extensions_table +SET appdata = CONCAT(appdata, ',m(default)') +WHERE app = 'Dial'; + + +-- music on hold end + + + -- update the dial plan UPDATE extensions_table SET appdata = 'PJSIP/1001,20,g' @@ -116,6 +152,13 @@ WHERE exten = '1001' AND app = 'Dial'; -- g here ensures it captures the DIALSTATUS even after the call ends +ALTER TABLE `ps_endpoints` ADD mohsuggest VARCHAR(40); +ALTER TABLE `ps_endpoints` ADD mailboxes VARCHAR(255); + +UPDATE ps_endpoints SET mohsuggest = 'default'; +UPDATE ps_endpoints SET direct_media = 'no'; +SELECT * FROM `ps_endpoints`; + SELECT * FROM extensions_table;