0.0.9 • Published 3 months ago

signalwireml v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

SignalWireML

Provides a convenient way to create SignalWire Markup Language documents for controlling call flows.

Installation

You can install the SignalWireML library via npm. Open your terminal or command prompt and run the following command:

npm install signalwireml

Usage

Follow these steps to create a SWML document using the SignalWireML library:

  1. Import SignalWireML:
import { SignalWireML } from "signalwireml";
  1. Start a new SWML document:
let swml = new SignalWireML();
  1. Add a new section to the document. A section allows you to group instructions together:
let mainSection = swml.addSection('main');
  1. Add instructions to the section. Instructions define actions to be performed during a call:
mainSection.addInstruction('answer');

mainSection.addInstruction({
    play: {
        urls: [
            'say:Hello from SignalWire!'
        ],
        say_voice: 'en-US-Neural2-A'
    }
});
  1. Once you have added all the desired sections and instructions, you can get the full JSON document:
const json = swml.toJSON();

Alternatively, you can get the YAML version instead:

const yaml = swml.toYAML();

If you wish, you can set up a web server and respond to SignalWire's HTTP requests using valid SWML in JSON/YAML format.

Contributing

We welcome contributions to the SignalWireML library. If you find any issues or want to add new features, please open an issue or submit a pull request.

License

This library is licensed under the MIT License.


Feel free to reach out to us if you have any questions or need further assistance. Happy coding!

0.0.9

3 months ago

0.0.8

3 months ago

0.0.7

3 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.6

6 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago