Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Below is a quick reference that can be used to translate traditional extensions.conf dialplan concepts to their analog in extensions.lua.

Extension Patterns

Extension pattern matching syntax on logic works the same for extensions.conf and extensions.lua.

extensions.conf

extensions.lua

Context Includes

extensions.conf

extensions.lua

Loops

extensions.conf

extensions.lua

Variables

extensions.conf

extensions.lua

Applications

extensions.conf

extensions.lua

Macros/GoSub

Macros can be defined in pbx_lua by naming a context 'macro-*' just as in extensions.conf, but generally where you would use macros or gosub in extensions.conf you would simply use a function in lua.

extensions.conf

extensions.lua

Goto

While Goto is an extenstions.conf staple, it should generally be avoided in pbx_lua in favor of functions.

extensions.conf

extensions.lua

Icon

The app.goto() function will not work as expected in pbx_lua in Asterisk 1.8. If you must use app.goto() you must manually return control back to asterisk using return from the dialplan extension function, otherwise execution will continue after the call to app.goto(). Calls to app.goto() should work as expected in Asterisk 1.10 but still should not be necessary in most cases.

In Asterisk 1.8, use return
  • No labels