CallFlow/TimeConditions status/toggle

  1. 3 years ago

    Is there any way to display time condition status in fop2? The CallFlow plugin can toggle TC's, but does not show their current status. I feel like the plugin should show the current status of a TC, and toggling it should simply override the current mode.
    Currently, you can toggle the override state, but that is only meaningful to someone who knows what the current state SHOULD be.

    Showing the current status would be useful in that our receptionist could override the "businesshours" TC to allow calls to come in earlier or later than regular business hours. As it stands now, if she toggles the override in FOP, that override stays toggled even after the TC changes, so if she overrides the TC to allow calls before business hours, when the TC switches at 8 am, the toggle is now inverted and incoming calls would still be directed to the afterhours ivr.

  2. admin

    28 Mar 2016 Administrator

    Whatever a time condition changes at any particular time is FreePBX responsibility. Not FOP2. FOP2 does not alter the dialplan, it can set/unset astdb entires or custom device states. After that change, whatever happens is in the dialplan domain and whatever tool you use to manage that dialplan. FOP2 won't be enforcing any change on any status in a particular time, as that is the task of the freepbx module itself.

    Anyways, there was a time (when the plugin was initially developed) where time conditions and call flows were the 'same' so to speak... but now they have diverted into separate modules/entities. Time conditions are supposed not to be changed or toggled via feature codes, and let them be changed only on the times they are programmed (at least that is what FreePBX description talks about), and it makes some sense, however it would be nice to override time conditions in certain situations as you describe. However, as I stated before, it is not a task to be performed in FOP2 itself.

    I have not played with it, but I think that the module in FreePBX should not *toggle* a mode but *set* the mode to a specific way on the times it is programmed.. if its toggle, my "feel" is that the module is not doing what it is supposed to do. If that is the case, I think the module should be fixed, and not use an external tool like FOP2 to fix a broken behaviour.

    In any case, I will spend some time to see if I can extend the plugin so it works with both time conditions and call flow as separate entities as currently it mixes both.

    Best regards,

  3. 2 years ago

    Okay, I think there's actually more to it.
    Time conditions by default in FPBX, for some reason are issued a feature code of *_ _ _ (three digits), but it doesn't seem to care that this feature code will conflict with the direct dial to a given extensions voice mail. So I'd modified the feature codes for each Time Condition, to *1270 through *1274. Dialing these, overrides the current override state. Also, FOP2 Call Flow plugin does correctly detect the current state, but cannot set it.
    I enabled more debugging and found that FOP2 is trying to send the original feature code (*277) instead of the manually overridden feature code (*1270). When you click it to flip the override, it says it's enabled, but then a few second later of course detects that it is not in fact, overridden.
    Log:
    set call flow origen 5, destino 7~DAY, exten GENERAL, final exten *277, slot 7, value DAY
    127.0.0.1 -> Exten: *277
    127.0.0.1 -> Action: Originate
    127.0.0.1 -> Channel: Local/s@custom-fop2-callflow
    127.0.0.1 -> Priority: 1
    127.0.0.1 -> Context: from-internal
    127.0.0.1 -> ActionID: 356

    127.0.0.1 <- Response: Error
    127.0.0.1 <- ActionID: 356
    127.0.0.1 <- Message: Extension does not exist.

    So all we really need for this to work correctly (I think) is for FOP to check the actual feature codes associated with each Time Condition.
    Any chance this could be done. It was the only reason I bought the plugin :P

  4. admin

    2 Dec 2016 Administrator

    If you look at the plugin directory (/var/www/html/fop2/admin/plugins/callflowfpbx/ you will find an update_conf.php script that you can change at will. That script looks for Freepbx settings and write the line in the plugin.ini:

    featurecode_prefix = "*27"

    With whatever prefix is found using this mysql query:

    SELECT description,defaultcode FROM featurecodes WHERE (modulename='daynight' OR modulename='xtimeconditions')

    You can modify the script, run that query and see if it retrieve your override feature code or not..

or Sign Up to reply!