Skip to main content

DevStack, Messaging, Voice

Unleash the power of Bandwidth with BXML

Bandwidth Bandwidth
Bandwidth
Share
elderly woman lifting weights

Bandwidth provides an API to programmatically control phone numbers. What started as a fun idea, has grown into a massive service powering all sorts of businesses.

Traditionally, you would have to control each and every leg of a call flow with the REST API. While this is approach is incredibly powerful and flexible, you probably don’t need to manage all that yourself.

The REST API — Great power = Great Responsibility

1*8jtguXvXtX7wfOGWKBoVRw
Traditional Call Forward Flow with REST

Enter BXML (Bandwidth XML)

BXML is simply an XML document generated by your server (or you for simple use-cases) that instructs the Bandwidth Servers on how to handle your call/sms. BXML is almost always going to reduce your complexity and in some cases improve performance.

When the XML document is retrieved by Bandwidth, sll of the actionable contacts are handled by Bandwidth internally. This results in an decreased latency which makes the customer interactions more ‘snappy.’

1*tjaM-2D_w-W4Mv4vrYIhgg
Traditional Call Forward with BXML

Where BXML Really Shines

BXML can potentially make any call flow more straightforward. But it really shines when managing conference calls and simulring (ringing multiple phones and connecting the first to answer). Simulring via the REST API can ring unlimited phones and connect the first to answer. However, making each call, waiting for an answer event, answering the call, ending the other calls, bridging the two call legs, hanging up the calls when conversation is over, and ending the bridge is ALL handled in your application. If you only need to simulring a few phones, BXML is your new best friend!

16662971058_3c4d94d597_z
You and BXML

All of that above complexitiy can be contained in a single BXML document.

+15552221234
+15552221233
This call has been forwarded.

Hacking up BXML with Github Gists

To demonstrate just HOW easy BXML can be. You don’t even need a server to get started with Bandwidth any more. You can hack up a simple call flow using Github Gists and BXML.

  1. Create a new Bandwidth Phone Number
1*LVkUAIbIx3LDRHvw-77QRQ
How to order a new number

2. Create a new Gist similar to the one below. Set the ‘transferCallerId’ value to the phone number you just ordered, set the ‘transferTo’ value to your cell phone, and name the end the file name with ‘.xml.’

Transferring your call, please wait.  
Someone is calling you.

3. Copy the RAW XML location from Github

1*te6Q9ZRLpKrRjpi9KYZG_g
Make sure the file ends in .xml

4. Create a new application with the new phone number in the Bandwidth Console. Set the CALL URL to the RAW XML location from github. Set the HTTP method to GET and make sure that Auto-Answer is set to True. Then assign the newly ordered number to the Application.

1*MM1FAazYAgmoUkInT5lLUg
Create new application with Raw Gist location and set the HTTP Method to GET. Keep Auto-answer enabled

5. Call your new Bandwidth number and watch your cell phone ring! Woah!

Learn More

So by now you’re thinking: “Wow, that’s totally easy! Where can I learn more?” Just head over to our ‘How-to’ Guides to get started easily.