On Fri, 30 Jan 2015, Paul Belanger wrote:

I'd also prefer to see the first time always a naked NoOp()

exten => 8000,1,NoOp()
    same => n,Verbose(1, "blah")

What value does noop() add?

I start my contexts with

        exten = s,1,                    
verbose(1,[${EXTEN}@${CONTEXT}!<application specific cruft>.'

(I define a template named 's' and reference it in all contexts.)

This way, you get a nice little console message saying where you are in the dialplan in a format that you can easily 'double-click-and-drag' (picking up the evaluated '${EXTEN}@${CONTEXT}') so you can type 'dialplan show ' followed by <shift><insert><enter> to display the relevant portion of the context.

While the OP's use of noop() is appropriate (a placeholder or 'no operation') the contraction may be confusing to the non-English, non-assembly language programmers among us.

Further, I find the common practice of using the 'side effect' of noop() (displaying text on the console) egregious when there are obvious and more versatile applications specifically for that purpose -- verbose() and log().

I'd like to drive a stake into the abuse of the lowly noop().

--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwa...@sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to