<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Klaus Darilion escribió:
<blockquote cite="mid:4979E7D9.608@pernau.at" type="cite">
<pre wrap="">
Russell Bryant schrieb:
</pre>
<blockquote type="cite">
<pre wrap="">On Jan 21, 2009, at 4:32 AM, Klaus Darilion wrote:
</pre>
<blockquote type="cite">
<pre wrap="">In SIP channel I have an struct ast_channel *ast. So, what is the
difference between:
ast->hangupcause
and
ast->tech_pvt->owner->hangupcause
</pre>
</blockquote>
<pre wrap="">Assuming you're talking about "ast" as a parameter to a channel
technology callback, ast and ast->tech_pvt->owner should be the same
thing.
</pre>
</blockquote>
<pre wrap=""><!---->
When is the owner set?
When an incoming INVITE is rejected with Hangup(1); ast->hangupcause is
set. But the function __transmit_response adds X-Asterisk-Hangupcause
according to ast->tech_pvt->owner->hangupcause. But as owner=NULL, the
header will not be added.
At least this is the behavior of 1.4.23. Should I open a bug report?
klaus
</pre>
</blockquote>
I checked this once some time ago, and I saw that on chan_sip.c, the
pvt structure is destroyed before sending the BYE message, and you
would be right, the owner is NULL so no HangupCause Header added:<br>
<br>
...<br>
<pre class="fragment">03593
<a name="l03594"></a>03594 <span class="comment">/* Disconnect */</span>
<a name="l03595"></a>03595 <span class="keywordflow">if</span> (p-><a
class="code"
href="http://www.asterisk.org/doxygen/1.4/structsip__pvt.html#a62a1382425913a43d6111e71b9fa019">vad</a>)
<a name="l03596"></a>03596 <a class="code"
href="http://www.asterisk.org/doxygen/1.4/dsp_8c.html#0a57a1e374549eb2705068688f4046db">ast_dsp_free</a>(p-><a
class="code"
href="http://www.asterisk.org/doxygen/1.4/structsip__pvt.html#a62a1382425913a43d6111e71b9fa019">vad</a>);
<a name="l03597"></a>03597
<a name="l03598"></a>03598 p-><a class="code"
href="http://www.asterisk.org/doxygen/1.4/structsip__pvt.html#9241175b397dfd032c4cadbc8c9c2d05">owner</a> = NULL;
<a name="l03599"></a>03599 ast-><a class="code"
href="http://www.asterisk.org/doxygen/1.4/structast__channel.html#19aa04db5508cf9496602e694dc69e2f"
title="Private data used by the technology driver.">tech_pvt</a> = NULL;
<a name="l03600"></a>03600
</pre>
...<br>
<br>
<br>
So doing something like Hangup(17) on the dialplan using SIP channels
would not set a busy HangupCause on the SIP header. For me this is a
bug. Please correct me if I am wrong.<br>
<br>
Regards,<br>
<br>
<blockquote cite="mid:4979E7D9.608@pernau.at" type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">--
Russell Bryant
Digium, Inc. | Senior Software Engineer, Open Source Team Lead
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: <a class="moz-txt-link-abbreviated" href="http://www.digium.com">www.digium.com</a> & <a class="moz-txt-link-abbreviated" href="http://www.asterisk.org">www.asterisk.org</a>
_______________________________________________
--Bandwidth and Colocation Provided by <a class="moz-txt-link-freetext" href="http://www.api-digital.com">http://www.api-digital.com</a>--
asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
<a class="moz-txt-link-freetext" href="http://lists.digium.com/mailman/listinfo/asterisk-dev">http://lists.digium.com/mailman/listinfo/asterisk-dev</a>
</pre>
</blockquote>
<pre wrap=""><!---->
_______________________________________________
--Bandwidth and Colocation Provided by <a class="moz-txt-link-freetext" href="http://www.api-digital.com">http://www.api-digital.com</a>--
asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
<a class="moz-txt-link-freetext" href="http://lists.digium.com/mailman/listinfo/asterisk-dev">http://lists.digium.com/mailman/listinfo/asterisk-dev</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Ing. Miguel Molina
Grupo de Tecnología
Millenium Phone Center
PBX: (+57 1)6500800 ext. 1201
Fax: (+57 1)6500816
Móvil: (+57)3138873587
</pre>
</body>
</html>