Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@bandwidth/bxml
Advanced tools
This package is a Bandwidth BXML builder written for NodeJS
Version | Notes |
---|---|
2.0.0 | Renamed toXml() to toBxml() |
2.1.0 | Added support for Record verb, and SSML in SpeakSentence |
2.2.0 | Added StartRecording, PauseRecording, ResumeRecording, and StopRecording verbs |
2.3.0 | Added support for transcriptions to Record and StartRecording verbs |
2.3.1 | Fixed startRecording init |
2.4.0 | Added transferDisconnectUrl and transferDisconnectMethod to PhoneNumber |
2.5.0 | Updated Pause (changed code comment to floats instead of ints), SendDtmf (added toneInterval and toneDuration attributes), and Record (added silenceTimeout attribute) verbs |
2.6.0 | Multiple nested verbs with Gather verb |
2.7.0 | Added Conference verb |
2.8.0 | Added Bridge verb |
2.9.0 | Added fallback urls and Ring verb |
npm install @bandwidth/bxml
var BandwidthBxml = require("@bandwidth/bxml");
var hangup = new BandwidthBxml.Verbs.Hangup();
var response = new BandwidthBxml.Response();
response.addVerb(hangup);
console.log(response.toBxml());
var playAudio = new BandwidthBxml.Verbs.PlayAudio();
playAudio.setUrl("https:###test.com");
playAudio.setUsername("user");
playAudio.setPassword("pass");
var response = new BandwidthBxml.Response();
response.addVerb(playAudio);
console.log(response.toBxml());
var speakSentence = new BandwidthBxml.Verbs.SpeakSentence();
speakSentence.setSentence("test");
speakSentence.setVoice("susan");
speakSentence.setGender("female");
speakSentence.setLocale("en_US");
var response = new BandwidthBxml.Response();
response.addVerb(speakSentence);
console.log(response.toBxml());
var sendDtmf = new BandwidthBxml.Verbs.SendDtmf();
sendDtmf.setDtmf("123");
var response = new BandwidthBxml.Response();
response.addVerb(sendDtmf);
console.log(response.toBxml());
var forward = new BandwidthBxml.Verbs.Forward();
forward.setTo("+18888888888");
forward.setFrom("+19999999999");
forward.setCallTimeout(3);
forward.setDiversionTreatment("none");
forward.setDiversionReason("away");
var response = new BandwidthBxml.Response();
response.addVerb(forward);
console.log(response.toBxml());
var pause = new BandwidthBxml.Verbs.Pause();
pause.setDuration(3);
var response = new BandwidthBxml.Response();
response.addVerb(pause);
console.log(response.toBxml());
var redirect = new BandwidthBxml.Verbs.Redirect();
redirect.setUsername("user");
redirect.setPassword("pass");
redirect.setRedirectUrl("https:###test.com");
redirect.setRedirectMethod("GET");
redirect.setTag("tag");
var response = new BandwidthBxml.Response();
response.addVerb(redirect);
console.log(response.toBxml());
var speakSentence = new BandwidthBxml.Verbs.SpeakSentence();
speakSentence.setSentence("test");
speakSentence.setVoice("susan");
speakSentence.setGender("female");
speakSentence.setLocale("en_US");
var gather = new BandwidthBxml.Verbs.Gather();
gather.setGatherUrl("https:###test.com");
gather.setGatherMethod("GET");
gather.setUsername("user");
gather.setPassword("pass");
gather.setTag("tag");
gather.setTerminatingDigits("123");
gather.setMaxDigits(3);
gather.setInterDigitTimeout(4);
gather.setFirstDigitTimeout(5);
gather.setSpeakSentence(speakSentence);
var response = new BandwidthBxml.Response();
response.addVerb(gather);
console.log(response.toBxml());
var playAudio = new BandwidthBxml.Verbs.PlayAudio();
playAudio.setUrl("https:###test.com");
playAudio.setUsername("user");
playAudio.setPassword("pass");
var gather = new BandwidthBxml.Verbs.Gather();
gather.setGatherUrl("https:###test.com");
gather.setGatherMethod("GET");
gather.setUsername("user");
gather.setPassword("pass");
gather.setTag("tag");
gather.setTerminatingDigits("123");
gather.setMaxDigits(3);
gather.setInterDigitTimeout(4);
gather.setFirstDigitTimeout(5);
gather.setPlayAudio(playAudio);
var response = new BandwidthBxml.Response();
response.addVerb(gather);
console.log(response.toBxml());
var playAudio = new BandwidthBxml.Verbs.PlayAudio();
playAudio.setUrl("https:###test.com");
playAudio.setUsername("user");
playAudio.setPassword("pass");
var speakSentence = new BandwidthBxml.Verbs.SpeakSentence();
speakSentence.setSentence("test");
speakSentence.setVoice("susan");
speakSentence.setGender("female");
speakSentence.setLocale("en_US");
var gather = new BandwidthBxml.Verbs.Gather();
gather.setGatherUrl("https:###test.com");
gather.setGatherMethod("GET");
gather.setUsername("user");
gather.setPassword("pass");
gather.setTag("tag");
gather.setTerminatingDigits("123");
gather.setMaxDigits(3);
gather.setInterDigitTimeout(4);
gather.setFirstDigitTimeout(5);
gather.setPlayAudio(playAudio);
gather.setSpeakSentence(speakSentence);
var response = new BandwidthBxml.Response();
response.addVerb(gather);
console.log(response.toBxml());
var gather = new BandwidthBxml.Verbs.Gather();
gather.setGatherUrl("https:###test.com");
gather.setGatherMethod("GET");
gather.setUsername("user");
gather.setPassword("pass");
gather.setTag("tag");
gather.setTerminatingDigits("123");
gather.setMaxDigits(3);
gather.setInterDigitTimeout(4);
gather.setFirstDigitTimeout(5);
gather.setRepeatCount(6);
var response = new BandwidthBxml.Response();
response.addVerb(gather);
console.log(response.toBxml());
var number1 = new BandwidthBxml.Verbs.PhoneNumber();
number1.setNumber("+17777777777");
number1.setTransferAnswerUrl("https:###test.com");
number1.setTransferAnswerMethod("GET");
number1.setUsername("user");
number1.setPassword("pass");
number1.setTag("tag");
var number2 = new BandwidthBxml.Verbs.PhoneNumber();
number2.setNumber("+17777777779");
number2.setTransferAnswerUrl("https:###test2.com");
number2.setTransferAnswerMethod("POST");
number2.setUsername("user2");
number2.setPassword("pass2");
number2.setTag("tag2");
var transfer = new BandwidthBxml.Verbs.Transfer();
transfer.setTransferCallerId("+18888888888");
transfer.setCallTimeout(3);
transfer.setTag("tagTransfer");
transfer.setTransferCompleteUrl("https:###testtransfer.com");
transfer.setTransferCompleteMethod("GET");
transfer.setUsername("usertransfer");
transfer.setPassword("passtransfer");
transfer.setDiversionTreatment("none");
transfer.setDiversionReason("away");
transfer.addPhoneNumber(number1);
transfer.addPhoneNumber(number2);
var response = new BandwidthBxml.Response();
response.addVerb(transfer);
console.log(response.toBxml());
var playAudio = new BandwidthBxml.Verbs.PlayAudio();
playAudio.setUrl("https:###test.com");
playAudio.setUsername("user");
playAudio.setPassword("pass");
var speakSentence = new BandwidthBxml.Verbs.SpeakSentence();
speakSentence.setSentence("test");
speakSentence.setVoice("susan");
speakSentence.setGender("female");
speakSentence.setLocale("en_US");
var response = new BandwidthBxml.Response();
response.addVerb(playAudio);
response.addVerb(speakSentence);
console.log(response.toBxml());
var record = new BandwidthBxml.Verbs.Record();
record.setRecordCompleteUrl("https://url.com");
record.setRecordCompleteMethod("POST");
record.setRecordingAvailableUrl("https://url.com");
record.setRecordingAvailableMethod("POST");
record.setUsername("user");
record.setPassword("pass");
record.setTag("tag");
record.setTerminatingDigits("123");
record.setMaxDuration(3);
record.setFileFormat("wav");
record.setTranscribe(true);
record.setTranscriptionAvailableUrl("https://test.com");
record.setTranscriptionAvailableMethod("POST");
var response = new BandwidthBxml.Response();
response.addVerb(record);
console.log(response.toBxml());
var startRecording = new BandwidthBxml.Verbs.StartRecording();
startRecording.setRecordingAvailableUrl("https://url.com");
startRecording.setRecordingAvailableMethod("POST");
startRecording.setUsername("user");
startRecording.setPassword("pass");
startRecording.setTag("tag");
startRecording.setFileFormat("wav");
startRecording.setMultiChannel(false);
startRecording.setTranscribe(true);
startRecording.setTranscriptionAvailableUrl("https://test.com");
startRecording.setTranscriptionAvailableMethod("POST");
var response = new BandwidthBxml.Response();
response.addVerb(startRecording);
console.log(response.toBxml());
var stopRecording = new BandwidthBxml.Verbs.StopRecording();
var response = new BandwidthBxml.Response();
response.addVerb(stopRecording);
console.log(response.toBxml());
var pauseRecording = new BandwidthBxml.Verbs.PauseRecording();
var response = new BandwidthBxml.Response();
response.addVerb(pauseRecording);
console.log(response.toBxml());
var resumeRecording = new BandwidthBxml.Verbs.ResumeRecording();
var response = new BandwidthBxml.Response();
response.addVerb(resumeRecording);
console.log(response.toBxml());
var conference = new BxmlBuilder.Verbs.Conference();
conference.setHold(true);
conference.setMute(true);
conference.setTag('tag1');
conference.setUsername('username');
conference.setPassword('pswd');
conference.setCallIdsToCoach('id1,id2');
conference.setConferenceEventMethod('POST');
conference.setConferenceEventUrl('https://example.com');
conference.setName('my-conference');
var response = new BxmlBuilder.Response();
response.addVerb(conference);
console.log(response.toBxml());
var bridge = new BandwidthBxml.Verbs.Bridge();
bridge.setCallId("c-95ac8d6e-1a31c52e-b38f-4198-93c1-51633ec68f8d");
bridge.setBridgeCompleteUrl("https://test.com");
bridge.setBridgeCompleteMethod("GET");
bridge.setBridgeTargetCompleteUrl("https://test2.com");
bridge.setBridgeTargetCompleteMethod("POST");
bridge.setUsername("user");
bridge.setPassword("pass");
bridge.setTag("custom tag");
var response = new BandwidthBxml.Response();
response.addVerb(bridge);
console.log(response.toBxml());
Tests can be run by executing
npm test
The dependency for XSD validation (xsd-schema-validator
) requires the environment variable JAVA_HOME
to be set. More information can be found on that package's github page
Bandwidth's BXML documentation can be found on the Bandwidth Developer Docs BXML page
FAQs
Generator for Bandwidth's BXML
We found that @bandwidth/bxml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.