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

Christopher Arnold chris at terrabee.net
Wed Jun 11 08:43:56 MST 2003


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?

Pseudo example:
[macro-chat]
to_many? Macro(chat, next_room)
increase # of users in chat

meeteme(room)

exit from meetme: decrease # of users in chat then Macro(chat, next_room)

exten => h,1, decrease # of users in chat

<end example>

In this example i call the macro again and again until hangup.

Is this a good way to implement my chat functionality?
Or should i try another path?


b) How do i return from a macro?
Do i just fall out by not having any more valid extensions in the macro?
Vill execution then continue at the next priority?

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


	/Chris



More information about the asterisk-users mailing list