[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 15:01:33 UTC 2010



> On 2010-12-11 06:43:31, Russell Bryant wrote:
> > /team/oej/pinana-initialize-devstate-1.4/main/pbx.c, line 2341
> > <https://reviewboard.asterisk.org/r/1048/diff/1/?file=14327#file14327line2341>
> >
> >     Is AST_MAX_EXTENSION used somewhere else that makes this the right constant to use?  The label in devicestate.c appears to have a hard coded max length of 40.

I will check.


> 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.

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... :-)


- 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/870c8eb2/attachment.htm 


More information about the asterisk-dev mailing list