famfamfam
famfamfam

Reputation: 536

Vonage developer voice call make a call return 400 error

I am learning Sip call using Vonage, after register free account at developer.vonage.com, I am following guide from Vonage document to make a call

Here is my code:

const vonage = new Vonage({
    apiKey: '***',
    apiSecret: '***',
    applicationId: '****',
    privateKey: './private.key'
})

vonage.applications.listApplications() => this worked

vonage.voice.createOutboundCall({
    to: [{
      type: 'phone',
      number: '6286660016'
    }],
    ncco: [{
      action: 'talk',
      text: 'Hello! This is a test call from Vonage.'
    }],
  }, (err, result) => {
    if (err) {
      console.error('Error:', err);
    } else {
      console.log('Call UUID:', result.uuid);
    }
  })

Here is the error log:

throw new vetch_1.VetchError(`Request failed with status code ${response.status}`, request, response);
                  ^

VetchError: Request failed with status code 400

Upvotes: 0

Views: 61

Answers (0)

Related Questions