Custom Presence FOP2.

  1. 8 years ago

    Hi FOP2

    If i check config presence.js the default as below :

    var presence = new Object();
    presence[''] = '#6094AB'; --> AVAILABLE as default VALUE
    presence['Do not Disturb'] = '#FF8A8A';
    presence['Out to lunch'] = '#57BCD9';
    presence['Break'] = '#6094DB';
    presence['Meeting'] = '#CDD11B';

    If value presence "AVAILABLE" , ext can received in and out call.

    If value presence other than "available", we can't received incoming call, but we can outgoing call.

    How can i change default value "available" to other value", i want every user/agent that login to fop2 can't receive call. If agent/user want to receive incoming call, they should be change presence to "available"

    And more powerful if we can set default value presence for group extension fop2 like :

    presence status after login to fop2
    presence status after call on hook/hangup
    presence status after call parking
    presence status after call blind tranfer, supervised tranfer
    presence status after transfer to mobile
    presence status after spy
    presence status after hangup conference

    Thanks

  2. admin

    16 Jul 2016 Administrator

    FOP2 does not control or change your dialplan. What you want to do has to do with your dialplan. You want an extension not be able to dial out if they are in some state (no matter if you use FOP2 or anything else for setting that state).

    That must be done at the dialplan level. It can be done, but you must modify your outbound dial macros. That modification is not done with FOP2, it is a core modification in your backend (and FOP2 is just a frontend).

    The presence in FOP2, as is, does absolutely nothing in your dialplan or asterisk setup. In order to tied the presence to your dialplan, you must use a plugin. For FreePBX you have the presence DND plugin, that as the name implies, will set the entry in the asterisk database signaling an extension is on DND. But you might very well NOT have that plugin installed, in that case, changing presence in FOP2 won't affect extensions in any way, it will just be a visual representation of a state in the FOP2 display and nothing else.

    Now, if you want to use the DND entry to prevent users being able to dial out, then you should modify the FreePBX dialplan, you could do so by using the macro-dialout-trunk-predial-hook provided by FreePBX, that lets you intercept outbound trunk calls before they are placed, and you can add your logic there, like checking to see if the ASTDB "DND" value is set, and if so abort/exit without dialing.

    Now, to make FOP2 change an extension to DND on login, you can write a plugin that performs that action (on login, change presence automatically).

    So, you can do what you want, but requires a bit of programming in all sides of your installation.

    Best regards,

  3. Dear FOP2,

    "Now, to make FOP2 change an extension to DND on login, you can write a plugin that performs that action (on login, change presence automatically)."

    Can you give me sample plugin (how to write on fop2) so i can try do develop.

    Thanks

  4. admin

    21 Jul 2016 Administrator

    Log into the FOP2 Manager, select the plugins section and install some of the free plugins you will find (there are around 25 free plugins). Once they are installed, you will see their source in /var/www/html/fop2/admin/plugins/xxxxxx and you can inspect code there.

    There is also a plugins directory in the fop2 tarball, with a sampleplugin that is like a skeleton for a new plugin.

    Best regards,

  5. Ok thanks for your info.

or Sign Up to reply!