[asterisk-dev] SIP channel/owner question
Miguel Molina
mmolina at millenium.com.co
Fri Jan 23 10:27:45 CST 2009
Klaus Darilion escribió:
> Russell Bryant schrieb:
>
>> On Jan 21, 2009, at 4:32 AM, Klaus Darilion wrote:
>>
>>
>>> In SIP channel I have an struct ast_channel *ast. So, what is the
>>> difference between:
>>>
>>> ast->hangupcause
>>> and
>>> ast->tech_pvt->owner->hangupcause
>>>
>> 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.
>>
>
> 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
>
>
>
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:
...
03593
03594 /* Disconnect */
03595 if (p->vad <http://www.asterisk.org/doxygen/1.4/structsip__pvt.html#a62a1382425913a43d6111e71b9fa019>)
03596 ast_dsp_free <http://www.asterisk.org/doxygen/1.4/dsp_8c.html#0a57a1e374549eb2705068688f4046db>(p->vad <http://www.asterisk.org/doxygen/1.4/structsip__pvt.html#a62a1382425913a43d6111e71b9fa019>);
03597
03598 p->owner <http://www.asterisk.org/doxygen/1.4/structsip__pvt.html#9241175b397dfd032c4cadbc8c9c2d05> = NULL;
03599 ast->tech_pvt <http://www.asterisk.org/doxygen/1.4/structast__channel.html#19aa04db5508cf9496602e694dc69e2f> = NULL;
03600
...
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.
Regards,
>
>> --
>> Russell Bryant
>> Digium, Inc. | Senior Software Engineer, Open Source Team Lead
>> 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
>> Check us out at: www.digium.com & www.asterisk.org
>>
>>
>>
>>
>>
>> _______________________________________________
>> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>>
>> asterisk-dev mailing list
>> To UNSUBSCRIBE or update options visit:
>> http://lists.digium.com/mailman/listinfo/asterisk-dev
>>
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
>
--
Ing. Miguel Molina
Grupo de Tecnología
Millenium Phone Center
PBX: (+57 1)6500800 ext. 1201
Fax: (+57 1)6500816
Móvil: (+57)3138873587
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20090123/f5ed5407/attachment.htm
More information about the asterisk-dev
mailing list