<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/2326/">https://reviewboard.asterisk.org/r/2326/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/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 and Matt Jordan.</div>
<div>By dkerr.</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;">Calls routed to a external trunk through SLAStation() do not maintain a CDR record for the outbound channel. Normally when an asterisk extension dials another extension (or trunk) two CDR records are maintained, one attached to each channel. However when the call is routed through SLAStation() then there is an intermediary "local" channel which initiates the Dial() to the called extension (or trunk). When it answers the originating channel and the called channel are bridged together with some do_masquerade() magic and the "local" channels go away. This occurs within a MeetMe conference and the process of bridging and masquerading messes up the CDR and in fact causes the outbound channel CDR to be marked AST_CDR_NULL which effectively neuters it.
This patch does two things...
1) When a masquerade is detected inside the conf_run() function it fixes up the CDR for the newly masqueraded channel so that it is correct.
2) When a SLA call ends in the dial_trunk() function and if the "attemptcallerid=yes" is set in sla.conf then the CDR record for the outbound channel is fixed up such that originating channel name, number, callerid, etc. is set to that of the channel that originated the SLAStation() dial request.
This ensures that accurate call duration and billing seconds can be determined from CDR records when SLA feature is used. Behavior of fixing up the outbound channels originating information can be suppressed by setting attemptcallerid=no in the sla.conf file. This configuration statement already exists, this patch expands its use.
Please also see comments in the code.</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;">Have been running this patch successfully for a couple of months on my asterisk server and routed outbound calls through both SIP and GTalk/Motif. The attached patch is for trunk, but I have tested 1.8 version and 11 versions.</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-20747">asterisk-20747</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/apps/app_meetme.c <span style="color: grey">(381255)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2326/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>