I'm coding a Click-to-Call app using Twilio with Node.js. The app works, and it's functional, but I'm having some issues when ending calls.
I've tryed to retrive all calls and updated their status to "completed". And the calls seem to have ended, BUT on my phone, I still hear the disconnect tones (Tu-tu-tu tu-tu-tu tu-tu-tu...).
This is executed when one of both phones manually hangs up the call:
client.calls.list(function(err, data) {
data.calls.forEach(function(call) {
client.calls(call.sid).update({
status: "completed"
}, function(err, call) {
});
});
});
I'm aware it's kinda exagerated, but I'm a little frustrated.
So my question is, is it possible to absolutely hangup both click-to-call calls so I don't have to press the button on my actual phone?