DND try 1
This commit is contained in:
parent
065474018d
commit
4962e0a63c
@ -125,3 +125,35 @@ synopsis=Check if a specified callerid is contained in the known solicitors data
|
|||||||
writehandle=mysql1
|
writehandle=mysql1
|
||||||
readsql=SELECT location FROM presence WHERE id='${SQL_ESC(${ARG1})}'
|
readsql=SELECT location FROM presence WHERE id='${SQL_ESC(${ARG1})}'
|
||||||
writesql=UPDATE presence SET location='${SQL_ESC(${VAL1})}' WHERE id='${SQL_ESC(${ARG1})}'
|
writesql=UPDATE presence SET location='${SQL_ESC(${VAL1})}' WHERE id='${SQL_ESC(${ARG1})}'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;Mat
|
||||||
|
;[GET_STATUS]
|
||||||
|
;dsn=asterisk
|
||||||
|
;readsql=SELECT status FROM user_status WHERE extension='${ARG1}'
|
||||||
|
|
||||||
|
;[UPDATE_STATUS]
|
||||||
|
;dsn=asterisk
|
||||||
|
;writesql=INSERT INTO user_status (extension, status, updated_at)
|
||||||
|
;VALUES ('${ARG1}', '${ARG2}', NOW())
|
||||||
|
;ON DUPLICATE KEY UPDATE status='${ARG2}', updated_at=NOW()
|
||||||
|
|
||||||
|
;[UPDATE_STATUS]
|
||||||
|
;dsn=asterisk
|
||||||
|
;write=UPDATE agents SET status = ${ARG2} WHERE extension = ${ARG1}
|
||||||
|
;writesql=INSERT INTO user_status (extension, status) VALUES ('${ARG1}', '${ARG2}') ON DUPLICATE KEY UPDATE status='${ARG2}', updated_at=NOW()
|
||||||
|
|
||||||
|
[UPDATE_DND_STATUS]
|
||||||
|
dsn=asterisk
|
||||||
|
writesql=INSERT INTO dnd_status (extension, status) VALUES ('${ARG1}', '${ARG2}') ON DUPLICATE KEY UPDATE status='${ARG2}', updated_at=NOW()
|
||||||
|
|
||||||
|
[GET_DND_STATUS]
|
||||||
|
dsn=asterisk
|
||||||
|
readsql=SELECT status FROM dnd_status WHERE extension='${ARG1}'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,3 +1,8 @@
|
|||||||
|
13,4
|
||||||
|
13,3
|
||||||
|
13,2
|
||||||
|
13,1
|
||||||
|
13,0
|
||||||
11,3
|
11,3
|
||||||
11,2
|
11,2
|
||||||
11,1
|
11,1
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
MySQL_conf_pbx/test1/recordings/1001-1742903383.6.wav
Normal file
BIN
MySQL_conf_pbx/test1/recordings/1001-1742903383.6.wav
Normal file
Binary file not shown.
BIN
MySQL_conf_pbx/test1/recordings/1001-1742903402.8.wav
Normal file
BIN
MySQL_conf_pbx/test1/recordings/1001-1742903402.8.wav
Normal file
Binary file not shown.
BIN
MySQL_conf_pbx/test1/recordings/1001-1742969286.15.wav
Normal file
BIN
MySQL_conf_pbx/test1/recordings/1001-1742969286.15.wav
Normal file
Binary file not shown.
BIN
MySQL_conf_pbx/test1/recordings/1001-1742970143.27.wav
Normal file
BIN
MySQL_conf_pbx/test1/recordings/1001-1742970143.27.wav
Normal file
Binary file not shown.
BIN
MySQL_conf_pbx/test1/recordings/1001-1742973303.52.wav
Normal file
BIN
MySQL_conf_pbx/test1/recordings/1001-1742973303.52.wav
Normal file
Binary file not shown.
BIN
MySQL_conf_pbx/test1/recordings/1001-1742973334.57.wav
Normal file
BIN
MySQL_conf_pbx/test1/recordings/1001-1742973334.57.wav
Normal file
Binary file not shown.
BIN
MySQL_conf_pbx/test1/recordings/1001-1742974144.64.wav
Normal file
BIN
MySQL_conf_pbx/test1/recordings/1001-1742974144.64.wav
Normal file
Binary file not shown.
BIN
MySQL_conf_pbx/test1/recordings/1002-1742969200.10.wav
Normal file
BIN
MySQL_conf_pbx/test1/recordings/1002-1742969200.10.wav
Normal file
Binary file not shown.
BIN
MySQL_conf_pbx/test1/recordings/1002-1742973303.52.wav
Normal file
BIN
MySQL_conf_pbx/test1/recordings/1002-1742973303.52.wav
Normal file
Binary file not shown.
BIN
MySQL_conf_pbx/test1/recordings/1002-1742973334.57.wav
Normal file
BIN
MySQL_conf_pbx/test1/recordings/1002-1742973334.57.wav
Normal file
Binary file not shown.
BIN
MySQL_conf_pbx/test1/recordings/1002-1742974144.64.wav
Normal file
BIN
MySQL_conf_pbx/test1/recordings/1002-1742974144.64.wav
Normal file
Binary file not shown.
BIN
MySQL_conf_pbx/test1/recordings/1003-1742969110.4.wav
Normal file
BIN
MySQL_conf_pbx/test1/recordings/1003-1742969110.4.wav
Normal file
Binary file not shown.
BIN
MySQL_conf_pbx/test1/recordings/1003-1742969146.7.wav
Normal file
BIN
MySQL_conf_pbx/test1/recordings/1003-1742969146.7.wav
Normal file
Binary file not shown.
BIN
MySQL_conf_pbx/test1/recordings/1003-1742969319.18.wav
Normal file
BIN
MySQL_conf_pbx/test1/recordings/1003-1742969319.18.wav
Normal file
Binary file not shown.
@ -144,6 +144,58 @@ WHERE app = 'Dial';
|
|||||||
-- music on hold end
|
-- music on hold end
|
||||||
|
|
||||||
|
|
||||||
|
-- DND/profiling
|
||||||
|
|
||||||
|
USE asterisk_db;
|
||||||
|
|
||||||
|
CREATE TABLE user_status (
|
||||||
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
extension VARCHAR(10) NOT NULL UNIQUE,
|
||||||
|
status ENUM('Available', 'Away', 'Busy', 'DND') NOT NULL DEFAULT 'Available',
|
||||||
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Set Status
|
||||||
|
-- INSERT INTO extensions_table (context, exten, priority, app, appdata) VALUES
|
||||||
|
-- ('default', '*21', 1, 'Read', 'USER_STATUS,,4'),
|
||||||
|
-- ('default', '*21', 2, 'Set', 'ODBC_UPDATE_STATUS=${ODBC_UPDATE_STATUS(${CALLERID(num)},${USER_STATUS})}'),
|
||||||
|
-- ('default', '*21', 3, 'Playback', 'status-updated'),
|
||||||
|
-- ('default', '*21', 4, 'Hangup', NULL);
|
||||||
|
|
||||||
|
INSERT INTO extensions_table (context, exten, priority, app, appdata)
|
||||||
|
VALUES
|
||||||
|
('default', '*21', 1, 'Read', 'USER_STATUS,,4'),
|
||||||
|
('default', '*21', 2, 'ExecIf', '$[${LEN(${USER_STATUS})}>0]?Set(ODBC_UPDATE_STATUS()=${CALLERID(num)},${USER_STATUS})'),
|
||||||
|
('default', '*21', 3, 'Hangup', '');
|
||||||
|
|
||||||
|
|
||||||
|
-- Get Status
|
||||||
|
INSERT INTO extensions_table (context, exten, priority, app, appdata) VALUES
|
||||||
|
('default', '*22', 1, 'Set', 'USER_STATUS=${ODBC_GET_STATUS(${CALLERID(num)})}'),
|
||||||
|
('default', '*22', 2, 'Playback', '${USER_STATUS}'),
|
||||||
|
('default', '*22', 3, 'Hangup', NULL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
SELECT * FROM user_status;
|
||||||
|
|
||||||
|
INSERT INTO user_status (extension, status, updated_at)
|
||||||
|
VALUES ('1001', '2', NOW())
|
||||||
|
ON DUPLICATE KEY UPDATE status = '3', updated_at = NOW();
|
||||||
|
|
||||||
|
DESC user_status;
|
||||||
|
|
||||||
|
|
||||||
|
SELECT * FROM `extensions_table`;
|
||||||
|
SELECT * FROM user_status WHERE extension = '1001';
|
||||||
|
|
||||||
|
|
||||||
|
DELETE FROM `extensions_table` WHERE exten = '*22' OR exten = '*21';
|
||||||
|
|
||||||
|
-- DND/profiling END
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- update the dial plan
|
-- update the dial plan
|
||||||
UPDATE extensions_table
|
UPDATE extensions_table
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user