[asterisk-users] Reuse h extension?
Stefan at WPF
stefan.at.wpf at googlemail.com
Sun Sep 30 02:44:02 CDT 2012
Thank you all guys, should be enough to get me doing this :-)
2012/9/29 Matthew Jordan <mjordan at digium.com>
>
>
> ----- Original Message -----
> > From: "Steve Edwards" <asterisk.org at sedwards.com>
> > To: "Asterisk Users Mailing List - Non-Commercial Discussion" <
> asterisk-users at lists.digium.com>
> > Sent: Saturday, September 29, 2012 10:44:25 AM
> > Subject: Re: [asterisk-users] Reuse h extension?
> >
> > On Sat, 29 Sep 2012, Stefan at WPF wrote:
> >
> > > I have 2 contexts, however both have the same h extension.
> > > Currently I am doing copy&paste for the h extension - is there a
> > > better way?
> > > Can I somehow reference a h extension, so I have to create/modify
> > > it only once?
>
> In addition to Steve's approach using templates, in Asterisk 11, you'll be
> able
> to use hangup handlers. These are subroutines that can be attached to a
> channel
> and are executed after the channel is hung up.
>
> [hangup_handler]
>
> exten => my_handler,1,NoOp()
> same => n,Verbose(Execute your normal 'h' extension logic here)
> same => n,Return()
>
> [context_1]
>
> exten => 123,1,NoOp()
> same => n,Set(CHANNEL(hangup_handler_push)=hangup_handler,my_handler,1)
> same => n,Verbose(do stuff)
>
> [context_2]
>
> exten => 123,1,NoOp()
> same => n,Set(CHANNEL(hangup_handler_push)=hangup_handler,my_handler,1)
> same => n,Verbose(do stuff)
>
>
> More on hangup handlers is available here:
>
> https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers
>
> --
> Matthew Jordan
> Digium, Inc. | Engineering Manager
> 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
> Check us out at: http://digium.com & http://asterisk.org
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
> http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120930/7538aba5/attachment.htm>
More information about the asterisk-users
mailing list