José Pablo Méndez Soto
2012-Jan-06 18:51 UTC
[asterisk-users] Why write your dialplan using Lua?
Hello, Reading through the Wiki: "Asterisk supports the ability to write dialplan instructions in the Lua programming language. This method can be used as an alternative to or in combination with extensions.conf and/or AEL. PBX lua allows users to use the full power of lua to develop telephony applications using Asterisk" My question is, what is the benefit of using Lua? I recently noticed that OpenSIPS added a compatibility module to use Lua as well. However, where is the real advantage here? I mean, you have all these pieces in Asterisk like Lego blocks: AGI Commands, AMI Actions, Dialplan Applications, Dialplan Functions which I think are the ones that really limit what the PBX can do right? What's the difference between calling them out from extensions.conf or even from extensions.ael and calling them from extensions.lua? What else can you do writing you dialplan in Lua? Could I maybe program N-Way calling* with it? Are we talking about expanding Asterisk capabilities a huge deal? Or just performance wise during dialplan execution? With OpenSIPS I understand its power because you may affect the SIP behavior based on db queries performed by Lua scripts, or modify the next message to be sent, but with Asterisk, you wouldn't be able to modify an ongoing session through Lua based on, e.g., an incoming INVITE to establish a new conference room, would you? Or tell Asterisk to save the Register-CallID of an endpoint as part of the sip peer settings in memory, like the contact ID field. Regards, *Jos? Pablo M?ndez **By N-Way calling I mean having one party on hold, calling another party, and immediate (ad-hoc) invoke a conference bridge to join the 3 parties. Just like Cisco phone systems do. * ***** -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120106/c45285d8/attachment.htm>
On Fri, 6 Jan 2012, Jos? Pablo M?ndez Soto wrote:> My question is, what is the benefit of using Lua?I've never used Lua, but I also have a curiosity about it. A couple of years ago, I wrote my first dialplan in AEL. Some bits were clumsy, minor syntax errors caused major parts of my dialplan to disappear, and I discovered a bunch of bugs*. But, many parts were elegant. Bits that would have been an ugly mess in 'plain dialplan' seemed obvious and clear. I would expect a similar experience with Lua. Kind of an opposite '1984**' experience. If you take the jump, please post your experiences. *) This was in 1.2 so there was no benefit in reporting the bugs. **) In Orwell's 1984, the 'scope' of language was reduced to eliminate the ability to express subversive thoughts. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000