Bandwidth XML (BXML)
Bandwidth XML allows you to create a voice application as easily as you create a Web application. Using Bandwidth XML (or BXML) your application handles incoming call events using standard action verbs that are described in XML.
Before we begin creating a new BXML application you’ll need two things initially setup:
A phone number that is allocated to your Bandwidth Application Platform account and is configured to an application. See here on how to do that. Note that when you create the application you’ll need to make sure that the Callback HTTP method is set to
A public Web site that you can create content on and will handle the requests for BXML. Note that the endpoint for this site should be used to create the application in you setup above.
The maximum size of a BXML document is 16 KB.
Understanding BXML Callback Events
The events sent are the events from Bandwidth Application Platform, with only two exceptions:
- transferComplete: sent to the original BXML call when the transferred call hangs up
- redirect: sent when the verb redirect is in action
BXML callbacks perform HTTP GET requests to the requestUrl when the notification intends to retrieve a new BXML document.
||The Gather verb is used to collect digits for some period of time.|
||The Hangup verb is used to hangup current call.|
||The PlayAudio verb is used to play an audio file in the call.|
||The Pause verb is used to pause the execution of an ongoing BXML document.|
||The Record verb allows call recording. At the end of the call, a call recording event containing the media with recorded audio URL is generated|
||The Redirect verb is used to redirect the current XML execution to another URL.|
||The SendDtmf verb is used to is used to send digits on a live call.|
||The SpeakSentence verb is used to convert any text into speak for the caller.|
||The Transfer verb is used to transfer the call to another number.|
BXML events are HTTP messages that are sent to your application server to notify you of activity related to your Bandwidth resources during a BXML usage.
|Answer Event||Bandwidth API sends this message to the application when the call is answered.|
|Gather event||Bandwidth API generates a gather event when the gather command completes in a call.|
|Hangup Event||Bandwidth API sends this message to the application when the call ends.|
|Recording event||Bandwidth API sends this event to the application when an the recording media file is saved or an error occurs while saving it.|
|Transcription event||Bandwidth API sends this event to the application when the recording media file is transcribed if requested.|
|Redirect event||Bandwidth API sends this event to the application when a
|Transfer Complete Event||Bandwidth API sends this event to the application when the