Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
FreeSWITCH 1.8

You're reading from   FreeSWITCH 1.8 Get to grips with VoIP and WebRTC communication and quickly build robust telephony systems with FreeSWITCH

Arrow left icon
Product type Paperback
Published in Jul 2017
Publisher Packt
ISBN-13 9781785889134
Length 434 pages
Edition 1st Edition
Concepts
Arrow right icon
Authors (2):
Arrow left icon
Anthony Minessale II Anthony Minessale II
Author Profile Icon Anthony Minessale II
Anthony Minessale II
Giovanni Maruzzelli Giovanni Maruzzelli
Author Profile Icon Giovanni Maruzzelli
Giovanni Maruzzelli
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Architecture of FreeSWITCH FREE CHAPTER 2. Building and Installation 3. Test Driving the Example Configuration 4. User Directory, SIP, and Verto 5. WebRTC, SIP, and Verto 6. XML Dialplan 7. Phrase Macros and XML IVRs 8. Lua FreeSWITCH Scripting 9. Dialplan in Deep 10. Dialplan, Directory, and ALL via XML_CURL and Scripts 11. ESL - FreeSWITCH Controlled by Events 12. HTTAPI - FreeSWITCH Asks Webserver Next Action 13. Conferencing and WebRTC Video-Conferencing 14. Handling NAT 15. VoIP Security 16. Troubleshooting, Asking for Help, and Reporting Bugs

Lua and FreeSWITCH


Calling a Lua script from FreeSWITCH makes one object available: the "freeswitch" object (from which you can create other basic FreeSWITCH-related objects).

You can execute a Lua script from FreeSWITCH console in two ways: lua and luarun. If you execute the script with lua, it will block your console until the script returns, as though it was the console thread itself to execute the script. Only after the script has exited will you see console messages. If instead you use luarun, a new thread will be created that will run the script (in this case the script will have no access to the stream object) completely independently from the console.

If the Lua script has been called from dialplan (an incoming call matches an extension where a lua action is executed), then an additional object is automatically already available: session. The object session represents the call leg and lets you interact with it (answer, play media, get DTMFs, hangup, and so on).

Let's play a little with...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at R$50/month. Cancel anytime