<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/2452/">https://reviewboard.asterisk.org/r/2452/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By Alec Davis.</div>
<p style="color: grey;"><i>Updated April 16, 2013, 9:21 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Addressed Matts request for a comment as to why I'm not using ast_event_get_ie_uint.
A much more intrusive fix would be to change the order of the ast_devstate_cache enumerations
enum ast_devstate_cache {
AST_DEVSTATE_CACHABLE, /*!< This device state is cachable, DEFAULT */
AST_DEVSTATE_NOT_CACHABLE, /*!< This device state is not cachable */
};
Instead of any tests like
if (cachable) {
...
} else {
..
}
The tests become
if (cachable==AST_DEVSTATE_CACHABLE) {
do cache routines...
} else {
..
}
Sending the IE 'cachable' in jabber and xmpp, would require logic inversion, so that on the net <state ... cachable="1"> is still emitted, even though the value of cachable is 0 or AST_DEVSTATE_CACHABLE.
Or ast_event_get_ie_uint is passed an additional parameter
'unsigned defaultval' where the value of 'defaultval' is the returned if the IE isn't found.</pre>
</td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21429">ASTERISK-21429</a>
</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The site that doesn't update it's devicestates from the remotesite is the site with ASR-2012-015 inplace.
This fixes the scenario where one site doesn't send the IE cachable=1 in the XMPP/Jabber message, to a newer system that expects to see it.
If the IE 'cachable' isn't present we need to default to AST_DEVSTATE_CACHABLE.
Assigning the cachable variable directly from ast_event_get_ie_uint is wrong, if the IE 'cachable' isn't found ast_event_get_ie_uint() will return 0, 0 = AST_DEVSTATE_NOT_CACHABLE
We need to read the 'cachable' IE into a string first, allowing us to check that it exists, if it doesn't exist then default to cachable=AST_DEVSTATE_CACHABLE.
If the 'cachable' IE does exist, then convert to a uint, validate value and go with it.
Caused by:
https://issues.asterisk.org/jira/browse/ASTERISK-20175</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Yes, change device state, at either site, and it's reflected in the other. One site is prior to ASTERISK-21075.
Tested both sites at r385594, and states correct at both sites.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> (updated)</h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>branches/11/main/devicestate.c <span style="color: grey">(385594)</span></li>
<li>branches/11/res/res_jabber.c <span style="color: grey">(385594)</span></li>
<li>branches/11/res/res_xmpp.c <span style="color: grey">(385594)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2452/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>