By John Foland, Developer Evangelist
The Bigger Picture
It's no secret that we're busy developing the world's most advanced cloud communications platform. Our infinitely scaling elastic infrastructure, coupled with elite messaging, voice, and video technologies, is best exposed through our exclusive real-time RELAY APIs.
In this guide, however, I'll be covering another facet of our effort to democratize complex communications tech, because our mission doesn't stop at developing advanced functionality that will move the space forward: We also make it ridiculously easy to switch from inferior API providers and immediately cut costs that act as a barrier to innovation.
Before SignalWire began the software-defined telecom revolution, there weren't many choices out there and price gougers took advantage of this. As a result, developers have been stranded on backward-looking platforms and paying outrageous mark-ups for basic carrier services.
SignalWire services are priced to disrupt this model, allowing customers to shift valuable resources to where it matters: developing the bad-ass comms tools of the 21st century.
What LāML is and Does
In order to smooth the transition to our advanced cloud platform, we've developed a backward-compatible language that easily allows coders to switch from Twilio to SignalWire: LāML (read: lame-uhl) - Legacy Antiquated Markup Language. With LāML, anyone can convert their existing TwiML projects in a matter of seconds.
At their core, LāML documents are just basic XML that give instructions for programmable voice and messaging. These documents can be connected via webhooks to voice and/or messaging on any phone number, and they can even be stored serverlessly in LāML bins.
When conditional logic is needed, or when building your own complex application is required, this is where the LāML REST API comes into play. Simply code in your preferred programming language and organize your projects into reusable LāML apps within the SignalWire interface.
Two Simple Ways to Switch
Transferring a TwiML bin to a LāML bin requires absolutely no modifications to code (except perhaps any <Redirect>s within the XML that may point back to Twilio resources). Here are step-by-step instructions:
1. Open a browser tab and access your existing TwiML bins.
2. In a second browser tab, head to your SignalWire space. Once there, select your project, then navigate to LāML > Bins (unique_space.url/laml-bins). Click the button to Create a LāML Bin.
3. For each TwiML bin you wish to migrate, simply copy the bin's XML from your TwiML bin repository and paste it into a fresh LāML bin. Give each bin a friendly name so they're easy to identify.
4. Each LāML bin you've created is now listed with a request URL. Use the copy URL function to get the link into your clipboard.
You may now use your bin request URL anywhere within your apps or by specifying it for use with a specific phone number. To perform that latter, edit settings for a phone number, then simply specify the handling of voice or message by LāML Webhooks, then paste the URL in the appropriate fields.
Migrating your TwiML app to use the LāML REST API is almost just as easy, but is specific to your preferred programming language. Detailed information is available within our documentation. Below is an outline of all the necessary steps:
1. From within any project in your SignalWire space, go to the API page and create a new token.
2. Armed with your new token, your project key and your space URL, visit our LāML REST API documentation and select your preferred programming language to the right.
3. Modify your application accordingly. This will include changing your credentials and specifying your project name to import into your project. Depending on your language, you'll only have a few lines to edit at most; All the application logic stays the same!
You may now use your application URLs by specifying the handling of voice or message by LāML Webhooks within any phone number's settings, or you can create a reusable "LāML app" in the SignalWire interface for shared use with multiple phone numbers.
Need additional help or have questions? Come and talk to us on our community Slack channel! A SignalWire OG will be happy to assist you in switching over to our platform.
Developer documentation for SIP: https://docs.signalwire.com/topics/relay-rest/#resources-sip-endpoints
Main developer documentation site: https://docs.signalwire.com/