<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>
<div>
<div>Ok, yes I find that strange as well. I will perform some tests on another server.</div>
</div>
</div>
<div><br>
</div>
<div>/Henrik</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">Från: </span>Gareth Blades &lt;<a href="mailto:mailinglist&#43;asterisk@dns99.co.uk">mailinglist&#43;asterisk@dns99.co.uk</a>&gt;<br>
<span style="font-weight:bold">Svara till: </span>Asterisk Users Mailing List - Non-Commercial Discussion &lt;<a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a>&gt;<br>
<span style="font-weight:bold">Datum: </span>fredag 13 september 2013 13:53<br>
<span style="font-weight:bold">Till: </span>Asterisk Users Mailing List - Non-Commercial Discussion &lt;<a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a>&gt;<br>
<span style="font-weight:bold">Ämne: </span>Re: [asterisk-users] executing the h extension at the real hangup of the call<br>
</div>
<div><br>
</div>
<div>
<div text="#000000" bgcolor="#FFFFFF">On 13/09/13 12:31, Henrik Westerberg wrote:
<blockquote cite="mid:CE58C440.4161E%25henrik.westerberg@ain.se" type="cite">
<div>Hi,</div>
<div><br>
</div>
<div>I am running Asterisk 11.3 with both SIP and ISDN. When dialing out (always over SIP) I want to keep track of who answered and of the length of the call.</div>
<div><br>
</div>
<div>
<div>[outgoing-dev2]</div>
<div>exten =&gt; h,1,Agi(agi://localhost/ajpbxtest.agi?status=finished)</div>
<div><br>
</div>
<div>exten =&gt; _X.,1,NoOp(Will send call to ${CC_DIALSTRING})</div>
<div>exten =&gt; _X.,n,Dial(${CC_DIALSTRING}, 60, M(uploadpeer-dev2^${CC_CALLID})em)</div>
<div>exten =&gt; _X.,n,Agi(agi://localhost/ajpbxtest.agi?status=failed&amp;dialstatus=${DIALSTATUS})</div>
</div>
<div>
<div style="font-family: Consolas; font-size: medium; "><br>
</div>
<div style="font-family: Consolas; font-size: medium; ">The h extension is called correctly when the call comes in over IP and when I record the call. But when the call has come in over SIP the h extension is called directly after the call is answered so all
 the call gets length 0 in my own database.</div>
<div style="font-family: Consolas; font-size: medium; "><br>
</div>
<div style="font-family: Consolas; font-size: medium; ">I guess that I could record the calls and throw away the recordings afterwards. In this way the RTP would stay on the server. But is there not a cleaner way to get Asterisk to execute the h extension (or
 another possibility to fix a callback somewhere) when the the Disconnect comes in over SIP?</div>
</div>
</blockquote>
<br>
I have no idea why you are seeing the h extension being run before the call ends. Its not something I have ever seen happen.<br>
Whether or not Asterisk stays in the RTP media path makes no difference as it will always stay in the SIP signalling path and its that which controls the call establishment and termination.<br>
<br>
</div>
</div>
</span>
</body>
</html>