<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Consolas",serif;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>You can use this<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>exten => h,1,Set(CDR(userfield)=Hangupcause:${HANGUPCAUSE})<o:p></o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] <b>On Behalf Of </b>Ross Beer<br><b>Sent:</b> Friday, October 9, 2015 1:52 PM<br><b>To:</b> Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users@lists.digium.com><br><b>Subject:</b> Re: [asterisk-users] Storing HANGUPCAUSE in CDR<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'>This was always possible in the past, however does not work in the current release.<br> <br>I believe this is a bug.<br> <o:p></o:p></span></p><div><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Calibri",sans-serif'><hr size=2 width="100%" align=center id=stopSpelling></span></div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-family:"Calibri",sans-serif'>To: <a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a><br>From: <a href="mailto:cervajs@fpf.slu.cz">cervajs@fpf.slu.cz</a><br>Date: Fri, 9 Oct 2015 10:04:47 +0200<br>Subject: Re: [asterisk-users] Storing HANGUPCAUSE in CDR<o:p></o:p></span></p><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'>search in archives<br>save the records to another table like cdr_extended<br><br><br>Dne 7.10.2015 v 15:26 Ross Beer napsal(a):<o:p></o:p></span></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'>Hi, <o:p></o:p></span></p><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'>I have the following code that operates when a channel is hung-up:<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'><o:p> </o:p></span></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt;border:currentColor'><div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'>[record-hangupcause]<o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'>exten => 1,n,Set(CDR(hangupcause)=${HANGUPCAUSE})<o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'>exten => s,n,Return()<o:p></o:p></span></p></div></div></blockquote><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'>Before the dial a hangup handler is registered:<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'><o:p> </o:p></span></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt;border:currentColor'><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'>Set(CHANNEL(hangup_handler_push)=record-hangupcause,s,1)<o:p></o:p></span></p></div></blockquote><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'>The routine is called and the variables are being set, however not on the channel's CDR which made the call. I believe this is due to the CDR being closes as soon as the dial returns. <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'>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.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'>Is there a way to update the CDR so that a result can be stored per dial?<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'>Thank you in advance,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'>Ross<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'><o:p> </o:p></span></p></div></div><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'><br><br><o:p></o:p></span></p></blockquote><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><pre>-- <o:p></o:p></pre><pre>---------------------------------------<o:p></o:p></pre><pre>Marek Cervenka<o:p></o:p></pre><pre>=======================================<o:p></o:p></pre><p class=MsoNormal><span style='font-family:"Calibri",sans-serif'><br>-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com">http://www.api-digital.com</a> -- New to Asterisk? Join us for a live introductory webinar every Thurs: <a href="http://www.asterisk.org/hello">http://www.asterisk.org/hello</a> asterisk-users mailing list To UNSUBSCRIBE or update options visit: <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><o:p></o:p></span></p></div></div></div></body></html>