Thank you all guys, should be enough to get me doing this :-)<br><br><div class="gmail_quote">2012/9/29 Matthew Jordan <span dir="ltr"><<a href="mailto:mjordan@digium.com" target="_blank">mjordan@digium.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<br>
----- Original Message -----<br>
> From: "Steve Edwards" <<a href="mailto:asterisk.org@sedwards.com">asterisk.org@sedwards.com</a>><br>
> To: "Asterisk Users Mailing List - Non-Commercial Discussion" <<a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a>><br>
> Sent: Saturday, September 29, 2012 10:44:25 AM<br>
> Subject: Re: [asterisk-users] Reuse h extension?<br>
><br>
> On Sat, 29 Sep 2012, Stefan at WPF wrote:<br>
><br>
> > I have 2 contexts, however both have the same h extension.<br>
> > Currently I am doing copy&paste for the h extension - is there a<br>
> > better way?<br>
> > Can I somehow reference a h extension, so I have to create/modify<br>
> > it only once?<br>
<br>
</div>In addition to Steve's approach using templates, in Asterisk 11, you'll be able<br>
to use hangup handlers. These are subroutines that can be attached to a channel<br>
and are executed after the channel is hung up.<br>
<br>
[hangup_handler]<br>
<br>
exten => my_handler,1,NoOp()<br>
same => n,Verbose(Execute your normal 'h' extension logic here)<br>
same => n,Return()<br>
<br>
[context_1]<br>
<br>
exten => 123,1,NoOp()<br>
same => n,Set(CHANNEL(hangup_handler_push)=hangup_handler,my_handler,1)<br>
same => n,Verbose(do stuff)<br>
<br>
[context_2]<br>
<br>
exten => 123,1,NoOp()<br>
same => n,Set(CHANNEL(hangup_handler_push)=hangup_handler,my_handler,1)<br>
same => n,Verbose(do stuff)<br>
<br>
<br>
More on hangup handlers is available here:<br>
<br>
<a href="https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers</a><br>
<br>
--<br>
Matthew Jordan<br>
Digium, Inc. | Engineering Manager<br>
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA<br>
Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> & <a href="http://asterisk.org" target="_blank">http://asterisk.org</a><br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</div></div></blockquote></div><br>