[asterisk-dev] [Code Review] Issue 18243: Update initial state of hints when new device state provider registers

Olle E Johansson reviewboard at asterisk.org
Sat Dec 11 21:24:08 UTC 2010



> On 2010-12-11 06:43:31, Russell Bryant wrote:
> >
> 
> Russell Bryant wrote:
>     Here is another thought.  If this changes the state of a hint, should hint watchers be notified?  I think that would be expected, but I do not think it is done.

You are right. It wasn't in scope for what I needed in Pinana. I needed the initial check to set up the remote subscriptions. I'll look into it.


> On 2010-12-11 06:43:31, Russell Bryant wrote:
> > /team/oej/pinana-initialize-devstate-1.4/main/pbx.c, lines 2349-2359
> > <https://reviewboard.asterisk.org/r/1048/diff/1/?file=14327#file14327line2349>
> >
> >     This loop goes through the hints and gets a state value but doesn't store it anywhere.  This function appears to be a big NoOp.
> 
> Olle E Johansson wrote:
>     You totally misunderstand. This is where I actually fix the problem, Russell. By calling ast_extension_state2() I actually get the initial state for the hint - which Asterisk could not get earlier since the device state provider was not registered. It's a chicken and egg issue, and I want to break the egg... :-)
> 
> Russell Bryant wrote:
>     I totally understand.  I see what you are trying to fix.  This doesn't seem to fix anything, though.  Take a look at this line of code:
>     
>         ast_extension_state2(hint->exten);
>     
>     This is going to go calculate the extension state and return it.  Since the return value is not being stored anywhere, it doesn't do anything.  I would expect to see something like:
>     
>         hint->laststate = ast_extension_state2(hint->exten);

It does fix what I needed to fix, but you are adding more functionality. THanks for the feedback, I'll work on it.


- Olle E


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1048/#review3023
-----------------------------------------------------------


On 2010-12-04 06:59:52, Olle E Johansson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1048/
> -----------------------------------------------------------
> 
> (Updated 2010-12-04 06:59:52)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> When the dialplan loads, all hints are initialized to a first state. If a device state provider is not loaded at the time, like meetme (or the new device state provider in chan_sip/Pinana), the hints are not initialized to the initial state. This affects all hints that have an initial state, like a registration in chan_sip, which is a state for "presence" subscriptions using SIMPLE in chan_sip.
> 
> The patch in /svn/asterisk/team/oej/pinana-initialize-devstate-1.4 fixes this by re-initializing all hints using the new device state provider after registration of a new device state provider.
> 
> 
> This addresses bug 18243.
>     https://issues.asterisk.org/view.php?id=18243
> 
> 
> Diffs
> -----
> 
>   /team/oej/pinana-initialize-devstate-1.4/include/asterisk/pbx.h 297578 
>   /team/oej/pinana-initialize-devstate-1.4/main/devicestate.c 297578 
>   /team/oej/pinana-initialize-devstate-1.4/main/pbx.c 297578 
> 
> Diff: https://reviewboard.asterisk.org/r/1048/diff
> 
> 
> Testing
> -------
> 
> Testing done while testing Pinana, which adds a new device state provider for remote sip states. Without this patch, the device state provider hints would never initialize properly when ASterisk starts, since the dialplan loads before chan_sip.
> 
> 
> Thanks,
> 
> Olle E
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20101211/0871f724/attachment-0001.htm 


More information about the asterisk-dev mailing list