Summary:ASTERISK-07931: new standard extension 'b' to execute at the beginning of a context
Reporter:Daniel Rivard (dariva)Labels:
Date Opened:2006-10-15 17:20:02Date Closed:2006-10-29 14:25:50.000-0600
Versions:Frequency of
Environment:Attachments:( 0) begin_ext.patch
Description:You can create an extension 'b' in a context and all the operations will be executed before the real extension that was asked for.

If the channel is hung up during the execution of the 'b' extension, the 'h' extension will be executed as it would for any other extension.


exten => b,1,NoOp(Handling begin...)
exten => b,n,SET(COMMON_VAR=any_value)

exten => 1234,1,NoOp(${COMMON_VAR}) ;will show the value set in the b extension

exten => 5678,1,NoOp(${COMMON_VAR}) ;will show the value set in the b extension

exten => h,1,NoOp(Handling hangup...)


It behaves like the reverse of the 'h' extensions, allowing to do some common operations to every extension in a given context.

'b' has been chosen for 'begin' extension.

It has been tested by myself, in a non-production environment.  More tests would probably be needed.
Comments:By: Tilghman Lesher (tilghman) 2006-10-15 23:36:02

Why not just use a Gosub to a common subroutine at the beginning of each extension?  It's much less cryptic and easier to trace.

By: Tilghman Lesher (tilghman) 2006-10-15 23:36:54

BTW, we can't even begin to look at your proposed patch until you have a disclaimer on file.

By: Olle Johansson (oej) 2006-10-29 14:25:50.000-0600

No answer from reporter. Please re-open when you have a disclaimer on file. Thanks!