<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/1151/">https://reviewboard.asterisk.org/r/1151/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.orgrb/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, Russell Bryant and David Vossel.</div>
<div>By jrose.</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;">What I think is happening:
everything is in features.c unless stated otherwise
within load_config
default_parkinglot = build_parkinglot(...) is ran when there is not already a default_parkinglot, automatically creates context and extension using default data. This is bad, because a little while later...
the config file is loaded and data is populated for creating the context.
The new context is created, so we have a second context in the dialplan which depending on config files may or may not be the same context.
Oh, and also we weren't deleting the contexts/extensions when we changed them.
fix:
First, the context/extension is no longer created in the build_parkinglot method. The wrong context is no longer made and this should be safe since we'll be creating the context soon after that in load_config anyway.
Second, if the default_parkinglot is not null when load_config is invoked (as in, by reload features in CLI), the context belonging to the default_parkinglot before the config file is reparsed gets cleared.
All in all, I think that should fix the problem.
There might be some other code in build_parkinglot which could do with some disposal. I'm afraid to touch a lot of it right now since I don't know what all of it pertains to. Also, anything that just writes to the parkinglot structure should probably be ignored since this just supplies default values.</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;">I tested the code as it was changed using features.conf and played with extension and context settings. Tried a number of reload features commands and it doesn't seem to break from that. Of course, I also changed features.conf between reloads and left it alone between some other reloads to check if it would behave properly when loading the same context it just destroyed.</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/view.php?id=18801">18801</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/trunk/main/features.c <span style="color: grey">(311734)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/1151/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>