<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div class="c-ReadMessagePartBody" data-link="class{getClass:IsBodyExpanded}"><div class="ClearBoth">Hi,</div><div class="readMsgBody"><div class="ExternalClass MsgBodyContainer" id="bodyreadMessagePartBodyControl2101f"><div dir="ltr"><div> </div><div>I am having an issue setting custom variables in a CDR record for a call once it has hung up. Setting variables before a dial are inserted into the CDR correctly. I am using the following hangup_handler as per previous versions: <br><br></div><blockquote style="margin-right: 0px;" dir="ltr"><div>[record-hangupcause]</div></blockquote><blockquote style="padding: 0px; border: currentColor;"><div>exten => s,1,Set(CDR(hangupcause)=${HANGUPCAUSE})</div><div><div>exten => s,n,Return()</div></div></blockquote><div><br></div><div>Before the dial a hangup handler is registered:</div><div><br></div><blockquote style="padding: 0px; border: currentColor;"><div>Set(CHANNEL(hangup_handler_push)=record-hangupcause,s,1)</div></blockquote><div><br></div><div>The routine is called and the variables are being set, however not on the channel's CDR which made the call.</div><div><br>By changing the cdr option 'endbeforehexten=no' this should keep the CDR accessible, however all this does is cause another CDR to be created for the 'h' extension.</div><div><br>Is there currently a bug with accessing CDR data for a channel that has been hung-up? It looks to me that the CDR is closed before the hangup_handler is called. However this shouldn't be the case!<br></div><div>I would be grateful for any feedback you can offer!</div><div> </div><div>I am happy to open a bug report, but I would prefer to have this acknowledged before doing so.<br></div><div>Ross</div></div></div></div></div>                                      </div></body>
</html>