[asterisk-dev] Arbitrary hangup handlers [patch]

Mark Murawski markm at intellasoft.net
Wed Sep 15 11:15:33 CDT 2010


On 09/15/2010 05:17 AM, Benny Amorsen wrote:
> Mark Murawski<markm at intellasoft.net>  writes:
>
>    
>> Set(CHANNEL(addhanguphandler)="callqueueHangupHandler,s,1");
>> Set(CHANNEL(addhanguphandler)="someotherHangupHandler,s,1");
>> Set(CHANNEL(addhanguphandler)="yetanotherHangupHandler,s,1");
>>      
> Wouldn't it be prettier to define a dedicated function for this?
>
> AddHandler(hangup,callqueueHangupHandler)
> RemoveHandler(hangup,callqueueHangupHandler)
> ReplaceHandler(hangup,oldhandler,newhandler)
>
> Perhaps it isn't necessary to have the first argument, if the only event
> that will ever be handled is hangup.
>
>
> /Benny
>
>
>    


I still don't know what the appropriate differentiation is for functions 
and applications.  The nice thing about functions is you get a return 
value.  With applications you have to set a channel variable with the 
contained result.  Say if a hangup handler failed to add because the 
dialplan didn't exist, it might be nice to check the return code.





More information about the asterisk-dev mailing list