<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
With endbeforehexten=no I actually get two CDR entries. One for the
call and a second one for the "h" extension.<br>
<tt>"","13","10","sip-locals","""13""
<13>","SIP/13-00000006","SIP/10-00000007","Dial","SIP/10","2015-08-04
06:28:44","2015-08-04 06:28:45","2015-08-04
06:28:47",3,1,"ANSWERED","DOCUMENTATION","1438669724.6","empty"</tt><tt><br>
</tt><tt>"","13","h","sip-locals","""13""
<13>","SIP/13-00000006","","NoOp","changed","2015-08-04
06:28:47","2015-08-04 06:28:47","2015-08-04
06:28:47",0,0,"ANSWERED","DOCUMENTATION","1438669724.6","changed"</tt><br>
The first one contains the call itself. There are durations, CDR
variables set during the call, etc.<br>
The second one contains only things configured in the "h" extension.<br>
<br>
With endbeforehexten=yes, the cdr contains:<br>
<tt>"","13","10","sip-locals","""13""
<13>","SIP/13-00000006","SIP/10-00000007","Dial","SIP/10","2015-08-04
06:28:44","2015-08-04 06:28:45","2015-08-04
06:28:47",3,1,"ANSWERED","DOCUMENTATION","1438669724.6","empty"</tt><br>
There is only the call, nothing from the "h" extension.<br>
<br>
I forgot to mention that I'm using Asterisk 13.1-cert2. Modifying
CDR records in the "h" extension used to work fine with Asterisk
1.8.<br>
<br>
By analyzing the code I must confirm that the endbeforehexten option
behaves exactly according to its description: <br>
<tt> As each CDR for a channel is finished, its end time is updated</tt><tt><br>
</tt><tt> and the CDR is finalized. When a channel is hung up and
hangup</tt><tt><br>
</tt><tt> logic is present (in the form of a hangup handler or the</tt><tt><br>
</tt><tt> <literal>h</literal> extension), a new CDR is
generated for the</tt><tt><br>
</tt><tt> channel. Any statistics are gathered from this new CDR. By
enabling</tt><tt><br>
</tt><tt> this option, no new CDR is created for the dialplan logic
that is</tt><tt><br>
</tt><tt> executed in <literal>h</literal> extensions or
attached hangup handler</tt><tt><br>
</tt><tt> subroutines. The default value is
<literal>yes</literal>, indicating</tt><tt><br>
</tt><tt> that a CDR will be generated during hangup
logic.</para></tt><br>
<br>
I tried to delay the "h" extension by several seconds and I found
out, that the CDR record is sent to the cdr backend later.
Unfortunately, it is not modifiable from the "h" extension, because
the cdr_object is already in the finalized table.<br>
<br>
Is there a way how to modify the CDR without hacking the code?<br>
<br>
How bad idea is it to comment the (it_cdr->fn_table ==
&finalized_state_fn_table) tests in ast_cdr_setuserfield and
ast_cdr_setvar and thus allow the "h" extension write to a finalized
CDR?<br>
<br>
Is there any chance the feature was left out by an accident and if
so, is there a plan to add it again?<br>
<br>
<br>
My extensions.conf: <br>
<tt>exten => h,1,NoOp(${CDR(userfield)})</tt><tt><br>
</tt><tt>exten => h,n,Set(CDR(userfield)=changed)</tt><tt><br>
</tt><tt>exten => h,n,NoOp(${CDR(userfield)})</tt><tt><br>
</tt><tt>exten => h,n,System(sleep 5)</tt><tt><br>
</tt><tt>exten => h,n,NoOp(${CDR(userfield)})</tt><tt><br>
</tt><tt>exten => 10,1,Set(CDR(userfield)=empty) </tt><tt><br>
</tt><tt>exten => 10,n,Dial(SIP/10)</tt><br>
<br>
Detailed log:<br>
<a class="moz-txt-link-freetext" href="http://pastebin.com/fZ9RAhL4">http://pastebin.com/fZ9RAhL4</a><br>
<br>
<br>
<div class="moz-cite-prefix">On 08/03/2015 04:36 PM, jg wrote:<br>
</div>
<blockquote cite="mid:55BF7C73.20107@jgoettgens.de" type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
<div class="moz-cite-prefix"><br>
</div>
<blockquote cite="mid:55BF7AB0.2050507@kerio.com" type="cite">I'm
trying to migrate from Asterisk 1.8 to Asterisk 13 and can't
figure this one out. I'm pretty sure the question has been
already asked, but I failed to find a solution. <br>
<br>
Can you modify CDR values in an h-extension? <br>
<br>
My cdr.conf contains: <br>
[general] <br>
enable=yes <br>
unanswered=yes <br>
endbeforehexten=yes <br>
initiatedseconds=no <br>
batch=no <br>
<br>
The diaplan contains a simple "h" extension <br>
exten => h,1,NoOp(${CDR(userfield)}) <br>
exten => h,n,Set(CDR(userfield)=changed) <br>
exten => h,n,NoOp(${CDR(userfield)}) <br>
<br>
In the same context I execute: <br>
exten => 10,1,Set(CDR(userfield)=empty) <br>
exten => 10,n,Dial(SIP/10) <br>
<br>
The "h" extension outputs two lines with userfield set to
"empty". I would expect the second one to be "changed". It seems
that I can read the CDR values, but I can't change them. Is it a
bug or a design thing? Am I missing something? <br>
</blockquote>
I am not working with h-extensions myself, but the docs (<a
moz-do-not-send="true" class="moz-txt-link-freetext"
href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Configuration_cdr"><a class="moz-txt-link-freetext" href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Configuration_cdr">https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Configuration_cdr</a></a>)
say something like this:<br>
<br>
<table class="confluenceTable tablesorter" style="color: rgb(51,
51, 51); border-collapse: collapse; margin: 0px; overflow-x:
auto; font-family: 'Helvetica Neue', Helvetica, Arial,
sans-serif; font-size: 14px; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal;
line-height: 20px; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);">
<tbody>
<tr style="color: rgb(51, 51, 51);">
<td class="confluenceTd" style="color: rgb(51, 51, 51);
border: 1px solid rgb(221, 221, 221); padding: 7px 10px;
vertical-align: top; text-align: left;">
<p style="margin: 0px; padding: 0px; color: rgb(51, 51,
51); background-color: transparent;"><a
moz-do-not-send="true"
href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Configuration_cdr#Asterisk13Configuration_cdr-general_endbeforehexten"
style="color: rgb(25, 46, 132); text-decoration:
none;"><code style="font-family: monospace;">endbeforehexten</code></a></p>
</td>
<td class="confluenceTd" style="color: rgb(51, 51, 51);
border: 1px solid rgb(221, 221, 221); padding: 7px 10px;
vertical-align: top; text-align: left;">
<p style="margin: 0px; padding: 0px; color: rgb(51, 51,
51); background-color: transparent;"><code
style="font-family: monospace;">Boolean</code></p>
</td>
<td class="confluenceTd" style="color: rgb(51, 51, 51);
border: 1px solid rgb(221, 221, 221); padding: 7px 10px;
vertical-align: top; text-align: left;">
<p style="margin: 0px; padding: 0px; color: rgb(51, 51,
51); background-color: transparent;"><code
style="font-family: monospace;">1</code></p>
</td>
<td class="confluenceTd" style="color: rgb(51, 51, 51);
border: 1px solid rgb(221, 221, 221); padding: 7px 10px;
vertical-align: top; text-align: left;">
<p style="margin: 0px; padding: 0px; color: rgb(51, 51,
51); background-color: transparent;"><code
style="font-family: monospace;">false</code></p>
</td>
<td class="confluenceTd" style="color: rgb(51, 51, 51);
border: 1px solid rgb(221, 221, 221); padding: 7px 10px;
vertical-align: top; text-align: left;">
<p style="margin: 0px; padding: 0px; color: rgb(51, 51,
51); background-color: transparent;">Don't produce CDRs
while executing hangup logic</p>
</td>
</tr>
</tbody>
</table>
<br>
This would indicate that at least writing is disabled.<br>
<br>
jg<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
</body>
</html>