Hi Everyone. I am trying to integrate voice api in Node JS and successfully implemented it for calling 1 number at a time. What i want to do is to call multiple numbers. So the idea is to pass an array of numbers in the “to” parameter of the function of voice api, but this “to” isn’t allowing us to pass array directly into it. Is there any solution for this? Because calling the api each time of each number wont be a good approach.
Best regards
Wortax
Hello! SignalWire allows you to use our SDK’s or APIs to make multiple calls from an array of numbers. You will need to use the our APIs and SDKs with some code logic, similar to what is found in this blog post: Advanced communications from the source. | SignalWire
This blog post and this GitHub example (answering-machine-detect/app.py at main · shane-signalwire/answering-machine-detect · GitHub) are the two auto dialer examples I found.
Best Regards,
Chris K.
SignalWire Support Team
Hi ChrisKlacsanzky-SW, let me explain you the use case.
So we are building an application in Node JS, in which we will have multiple numbers on which we have to perform calls and when the user accepts the call we will play an audio.
This part is done programatically, pasting the code below. But the issue is it accepts a single number in 1 API call, we can not pass multiple numbers in a single API call.
We have to make calls of around 15000 perday and to call an api 15000 times for each call is not a good approach, so therefore was asking if there is an api in which we can provide multiple numbers at once.
const call = await client.dialPhone({
from: ‘+12015347157’, // Must be a number in your SignalWire Space
to:‘+13322424609’,
timeout: 30,
});
await call.playAudio({
url: 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3',
});
console.log('The call has been answered!', call.id);
} catch (e) {
console.error(e);
}
}
Thanks
Hello,
I am not sure unfortunately the code you’d have to use to accomplish your exact request, but our auto dialer example does look to help with your example. There is not a way to pass more than one phone number for the TO field in our APIs or SDKs that I see, but using a PaaS (platform as a service) provider with our SDKs seems to be the right solution to create bulk calls based on a TO number list.
The article earlier about auto dialer (Advanced communications from the source. | SignalWire) uses Dokku to process the dialing list and is a PaaS (platform as a service) provider. We don’t have an example of how to pass audio during a call when making bulk calls with an auto dialer that I found. If you created the code logic with SignalWire, you could pass this request to Dokku or another auto dialer.
If you run into further difficulties, our support team could take a closer look through a support request ticket. We have different levels of technical support to assist, and providing your code, SignalWire space resources and call examples could help us review how to accomplish your ask.
Best Regards,
Chris K.
SignalWire Support Team
Hi, let me check if i can do this will try
Hi , I m stuck in an issue, i have successfully made a call, but I want to get the information about the call like the duration of the call and status etc
Is there any webhook that I can use to fetch the status of the call? Or any api for this ?
Below is my code for making a call
const client = new Voice.Client({
project: ‘',
token: '’,
contexts: [‘office’],
});
const call = await client.dialPhone({
from: '+12015347157', // Must be a number in your SignalWire Space
to: '+13322424609',
timeout: 30,
// URL to receive status updates
});
await call.playAudio({
url: 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3',
});
console.log('The call has been answered!', call.id);
Hello,
We have received your support request ticket today, and we will follow up with you on the ticket when we have fully reviewed the issue.
Best Regards,
Chris K.
SignalWire Support Team