[Asterisk-Dev] ast_hangup

Martin Bangiev martin.bangiev at borsabg.com
Fri Apr 1 03:25:44 MST 2005


No Brian it wasn't ignored - I replyed that my X-lite client doesn't 
hang up the connection when I use the ast_softhangup function.

Brian West wrote:

> Did my email that said just that totally get ignored yesterday?
>
> http://lists.digium.com/pipermail/asterisk-dev/2005-March/010652.html
>
> /b
>
> On Mar 31, 2005, at 7:21 AM, Juan Jose Comellas wrote:
>
>> What you need to to is call ast_softhangup() on the channel and then 
>> make sure
>> that you return -1 from you application's callback function. 
>> Returning -1
>> without the ast_softhangup() call should be enough also.
>>
>>
>> On Thursday 31 March 2005 05:27, Martin Bangiev wrote:
>>
>>> So how can I hang up in my application?
>>> I tried to use ast_softhangup instead of ast_hangup but then the X-lite
>>> doesn't hangs up...
>>> I tried to comment the ast_channel_free in the ast_hangup function but
>>> there was no effect :(
>>>
>>> Juan Jose Comellas wrote:
>>>
>>>> ast_hangup() hangs up the connection and also frees all the memory
>>>> associated with the channel. You should never do that for inbound
>>>> channels because Asterisk needs to access the channel data after it
>>>> leaves your application.
>>>>
>>>> On Wednesday 30 March 2005 13:16, Martin Bangiev wrote:
>>>>
>>>>> Hi guys,
>>>>> I'm trying to write a simple application that hang's up the chanel in
>>>>> few seconds but I have a problem. When the application returns 
>>>>> asterisk
>>>>> crashes with Segmentation Fault. Here is the source (pretty simple)
>>>>>
>>>>> static int myhangup_exec(struct ast_channel *chan, void *data) {
>>>>>        struct localuser *u;
>>>>>
>>>>>        LOCAL_USER_ADD(u);
>>>>>        sleep(3);
>>>>>        ast_hangup(chan);
>>>>>        LOCAL_USER_REMOVE(u);
>>>>>        return(0);
>>>>> }
>>>>>
>>>>> Can you pelase tell me what the proper use of ast_hangup is?
>>>>> Thanks in advance.
>>>>> _______________________________________________
>>>>> Asterisk-Dev mailing list
>>>>> Asterisk-Dev at lists.digium.com
>>>>> http://lists.digium.com/mailman/listinfo/asterisk-dev
>>>>> To UNSUBSCRIBE or update options visit:
>>>>>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>>>>
>>>
>>> _______________________________________________
>>> Asterisk-Dev mailing list
>>> Asterisk-Dev at lists.digium.com
>>> http://lists.digium.com/mailman/listinfo/asterisk-dev
>>> To UNSUBSCRIBE or update options visit:
>>>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>>
>>
>> -- 
>> Juan Jose Comellas
>> (juanjo at comellas.com.ar)
>>
>> _______________________________________________
>> Asterisk-Dev mailing list
>> Asterisk-Dev at lists.digium.com
>> http://lists.digium.com/mailman/listinfo/asterisk-dev
>> To UNSUBSCRIBE or update options visit:
>>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>
>
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>
>




More information about the asterisk-dev mailing list