[Asterisk-Users] How do i make best use of Macro?

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Wed Jun 11 09:12:29 MST 2003


On Wednesday 11 June 2003 10:43 am, Christopher Arnold wrote:
> Hi,
>
> im trying to setup a chat system. And i belive the best way is
> using an macro. But a couple of questions regarding using macros
> pops up.
>
> a) Is there state building up if my macro calls itself recusivly?

A macro is NOT a function.  It simply is a shortcut to doing a
longer series of commands.  A macro cannot itself be recursive.

> b) How do i return from a macro?

One does not return from a macro.  Indeed, once the macro is
expanded, it is no longer part of the process.

> Or should i use a Goto(newcontext,s,1)?

I think you're confused as to what a macro can and cannot do.  Until
you understand that distinction, you're going to have trouble
understanding how a macro works within the system.

In any case, I'd recommend that you forget about using macros
and instead use AGI.

-Tilghman




More information about the asterisk-users mailing list