[Asterisk-Users] Goto invalid extension doesn't go to 'I' when in a macro.

Nick Barnes nick at bcn-it.co.uk
Tue Jan 25 08:16:14 MST 2005


Hi,

A bit of a problem here which I'd appreciate some thoughts on.

(please excuse the stray capital letters - Outlook has a habit of
capitalising where I don't want it to!)

For various reasons, I need to be able to do the following:

--------------8<--------------
[default]
Exten => s,1,Macro(dosomething,9999)
Exten => s,2,NoOp(Returned)

[macro-dosomething]
Exten => s,1,Goto(${ARG1},1)

Exten => _[123]XXX,1,NoOp(Success)

Exten => I,1,NoOp(Failure)
--------------8<--------------

Which should allow me to trap an invalid entry from the caller.

If ${ARG1} contains, say, 2000, it all works fine. However, in the above
example where ${ARG1} contains 9999, the macro just finishes and control is
returned to the calling context - i.e. the extension 'i' in
[macro-dosomething] never gets called.

This is completely different behaviour than when Goto() is used in a
non-macro context - e.g.:

--------------8<--------------
[default]
Exten => s,1,Goto(9999,1)

Exten => _[123]XXXX,1,NoOp(Success)

Exten => I,1,NoOp(Failure)
--------------8<--------------

Where control is passed to 'I' as expected.

The only way I have found around this is to include another context to allow
me to have:

Exten => _[123]XXXX,1,NoOp(Success)

And

Exten => _.,1,NoOp(Failure)

In the same context.

Is this a bug or intentional behaviour? Does anybody else have a fix for
this?

Cheers,

Nick.






More information about the asterisk-users mailing list