[Asterisk-Dev] Problem with hanging up a SIP channel

imran ahmed codentest at gmail.com
Wed Nov 23 10:24:48 MST 2005


I have seen in app_dial.c and even in pbx.c that ast_hangup is called
after the channel is done with. app_dial.c calls ast_hangup only on
those channels that are not in the dialplan and those in the dialplan
are hungup by the ast_hangup call in __ast_pbx_run() call in pbx.c
I also see that the channels hangup routine itself is called in
ast_hangup and If what you say is true then this would be turn to a
recursive call.
Please correct me!
Thanks
Imran

On 11/23/05, Tilghman Lesher <tilghman at mail.jeffandtilghman.com> wrote:
> On Wednesday 23 November 2005 10:45, imran ahmed wrote:
> > You need to use ast_hangup on channels that are not in the dialplan.
> > May be you are holding the channel lock before calling ast_hangup in
> > this case.
>
> ast_hangup() should only ever be called by a channel driver on its own
> channel (and even then, only in the channel's hangup routine).  For all
> other cases, you need to request the hangup via ast_softhangup() and
> let the channel process the hangup when it is ready.
>
> --
> Tilghman
> _______________________________________________
> 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