<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/3326/">https://reviewboard.asterisk.org/r/3326/</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.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By Mark Michelson.</div>
<p style="color: grey;"><i>Updated March 15, 2014, 5:29 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;">One final change.
I was having trouble from a test because res_mwi_external was failing to load because ast_sorcery_apply_default() was returning an error. This is because for my test, I had a sorcery.conf that had a "res_mwi_external" section. The default "astdb" wizard could not be applied because the object type the wizard was being applied to had already been added to sorcery when the config had been applied.
I've adjusted the return type of ast_sorcery_apply_config and ast_sorcery_apply_default to return an enum that indicates more accurately what happened. The return values are backwards compatible with old code that may have been checking for success or failure, but it also now can return more specific values for cases where "success" and "failure" are not as well defined.
All unit tests still pass.</pre>
</td>
</tr>
</table>
<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;">When performing some realtime tests, I noticed that the AMI command PJSIPShowEndpoints was listing all of my endpoints twice. This is because ast_sorcery_apply_config() was being called twice from res_pjsip code, once when initializing system configuration, and once again when initializing the rest of the configuration data. This patch aims to fix the problem on two fronts:
1) Remove the ast_sorcery_apply_config() calls from the PJSIP code entirely in favor of having sorcery automatically apply configuration for the module when sorcery is opened. This reduces the chance of accidentally attempting to apply the same configuration twice. I also removed the call to ast_sorcery_apply_config from res_mwi_external since it is no longer necessary either.
2) Adjust sorcery_apply_wizard_mapping() not to apply the same wizard to an object type more than once, just in case someone does make the error of calling ast_sorcery_apply_config() multiple times for the same object type.</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;">My tests of retrieving data from realtime now get the expected objects. I don't have any automated tests to post yet because the realtime testsuite is a work in progress.</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/12/tests/test_sorcery_realtime.c <span style="color: grey">(410625)</span></li>
<li>/branches/12/tests/test_sorcery_astdb.c <span style="color: grey">(410606)</span></li>
<li>/branches/12/tests/test_sorcery.c <span style="color: grey">(410606)</span></li>
<li>/branches/12/res/res_pjsip/pjsip_configuration.c <span style="color: grey">(410606)</span></li>
<li>/branches/12/res/res_pjsip/config_system.c <span style="color: grey">(410606)</span></li>
<li>/branches/12/res/res_mwi_external.c <span style="color: grey">(410606)</span></li>
<li>/branches/12/main/sorcery.c <span style="color: grey">(410606)</span></li>
<li>/branches/12/include/asterisk/sorcery.h <span style="color: grey">(410606)</span></li>
<li>/branches/12/configs/sorcery.conf.sample <span style="color: grey">(410606)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/3326/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>