[Asterisk-code-review] func presencestate: Add ability to clear states with TEST FR... (asterisk[13])

Mark Michelson asteriskteam at digium.com
Tue Aug 4 17:21:05 CDT 2015


Mark Michelson has posted comments on this change.

Change subject: func_presencestate: Add ability to clear states with TEST_FRAMEWORK
......................................................................


Patch Set 1: Code-Review-1

I've looked at this change a few times and thought about it, and I just don't like the esoteric way that this is done. Explicitly setting a presence state to an invalid state in order to exploit built-in behavior of the Stasis cache seems like an odd way to go about skipping the cache. I would suggest more direct methods that might have utility outside of when TEST_FRAMEWORK is defined.

1) Create a function to clear a cached presence state. There already exists something similar for device state, so adding an analog for presence would make sense. Clearing the cache and clearing the database manually would get you where you need to go.

2) Create something like (1) but a bit more in-depth. Create a function to delete a presence state. This would involve two steps:
   * Clear the stasis cache of the presence if it is already there.
   * Place a callback into the presence state provider telling it to clear any data it currently has about this presence state.

3) Add variants to the public ways of getting presence that allow for the cache to be skipped. Right now, func_presencestate() already skips the cache when it gets called to read presence. The AMI and CLI commands could have "no cache" augmentations made to them that allow for the Stasis cache to be skipped. Admittedly, this probably would only be useful when TEST_FRAMEWORK is defined, but the intent is much more clear than what is currently proposed.

-- 
To view, visit https://gerrit.asterisk.org/1028
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie5f850911bc7cf473c458d2e14cee3857c4a8274
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Jonathan Rose <jrose at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Jonathan Rose <jrose at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-HasComments: No



More information about the asterisk-code-review mailing list