Use of Away in Presence Values

  1. 10 years ago

    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['Away'] = '#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?

  2. admin

    8 Oct 2014 Administrator

    It seems the presence.js file was not saved in correct format ? Do you have extended characters there in some way? What is the output from this:

    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,

  3. I rechecked the presence file (deleted the entry and retyped it without copying from another line) and the problem persists. If the problem were in the presence.js file, I would expect the command sent to the fop2 server to show the problem, yet the translation appears to occur in the server.

    [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

  4. admin

    14 Oct 2014 Administrator

    Not sure what fop2 version you tried. I was not able to reproduce the issue. I have set the presence value to Away, just as you describe, and it works fine. I also chose the other presence and typed "Away" and it also works fine. Perhaps you have some buggy version, please try with 2.28 final.

or Sign Up to reply!