Use of Away in Presence Values
We were trying to change the list of Presence values available in the operator panel to match one of our other products. I modified presence.js to add the values. One of the values I added was Away.
presence = '#57BCD9';
This displays correctly in the operator panel, but when the user selects this value, the whole UI refreshes. I checked the log and it appears that Away is treated differently than the other values:
75.85.95.105:50844 <= <msg data="22|setastdb|fop2state~4159672901~Away|45fb798c307825f033feb1bb61e587b6" />
127.0.0.1 -> Action: Command
127.0.0.1 -> Command: database put fop2state USER/4159672901 "^C^F²"
127.0.0.1 -> Action: UserEvent
127.0.0.1 -> UserEvent: FOP2ASTDB
127.0.0.1 -> Family: fop2state
127.0.0.1 -> Key: USER/4159672901
127.0.0.1 -> Channel: USER/4159672901
127.0.0.1 -> Value: ^C^F²
127.0.0.1 <- Response: Follows
127.0.0.1 <- Privilege: Command
127.0.0.1 <- Updated database successfully
--END COMMAND--
127.0.0.1 <- Response: Success
127.0.0.1 <- Message: Event Sent
The other values appear to work as expected. What is special about Away? Is there some way we can use the value Away?
presence = '#57BCD9';
This displays correctly in the operator panel, but when the user selects this value, the whole UI refreshes. I checked the log and it appears that Away is treated differently than the other values:
75.85.95.105:50844 <= <msg data="22|setastdb|fop2state~4159672901~Away|45fb798c307825f033feb1bb61e587b6" />
127.0.0.1 -> Action: Command
127.0.0.1 -> Command: database put fop2state USER/4159672901 "^C^F²"
127.0.0.1 -> Action: UserEvent
127.0.0.1 -> UserEvent: FOP2ASTDB
127.0.0.1 -> Family: fop2state
127.0.0.1 -> Key: USER/4159672901
127.0.0.1 -> Channel: USER/4159672901
127.0.0.1 -> Value: ^C^F²
127.0.0.1 <- Response: Follows
127.0.0.1 <- Privilege: Command
127.0.0.1 <- Updated database successfully
--END COMMAND--
127.0.0.1 <- Response: Success
127.0.0.1 <- Message: Event Sent
The other values appear to work as expected. What is special about Away? Is there some way we can use the value Away?
Comments
file /var/www/html/fop2/js/presence.js
?
You might want to try editing the file again, removing the Away line and typing it again.
Best regards,
[root@ASTERISK18 fop2]# file js/presence.js
js/presence.js: UTF-8 Unicode C++ program text
Correct here in the command sent to the server
75.85.118.107:52197 <= <msg data="23|setastdb|fop2state~4159672901~Away|0c81ee79a3e68fb6a9f03eb4bdeb5461" />
Yet, incorrect when the action is sent to Asterisk.
127.0.0.1 -> Action: Command
127.0.0.1 -> Command: database put fop2state USER/4159672901 "^C^F²"
I got around the problem by changing the command sent from fop2.js to setastdb2 and handling it in a plugin. This is with the same entry in presence.js:
75.85.118.107:52323 <= <msg data="23|setastdb2|fop2state~4159672901~Away|0c9f5d4fcf8982e0d9b3e6f57a486fe3" />
In Headland pre-command setastdb plugin
127.0.0.1 -> Command: database put fop2state USER/4159672901 "Away"
127.0.0.1 -> Action: Command
127.0.0.1 -> ActionID: 62