我无法使用nodejs sdk从美国号码向阿联酋号码发送来自twilio API的消息

f0brbegy  于 9个月前  发布在  Node.js
关注(0)|答案(1)|浏览(154)

我无法从美国twilio号码发送短信到阿联酋twilio号码。此外,在地理设置中,发送短信到阿联酋号码是启用的。
我在这里粘贴代码:

const accountSid = '<account-sid>';
const authToken = '<auth-token>';
const client = require('twilio')(accountSid, authToken);

client.m
  .create({
     body: 'This is the ship that made the Kessel Run in fourteen parsecs?',
     from: '<us-number>', // example: +12345678901  country code is +1
      to: '<uae-number>' // example: '+971123456789' country code is +971 (also i tried different uae numbers, didn't work)
   })
  .then(message => console.log(message.sid)).catch(error => console.log(error.message));

字符串
我收到错误文本:Message cannot be sent with the current combination of 'To' (+97112345XXXX) and/or 'From' (+12345678901) parameters
但是如果我用相同的fromto参数点击twilio语音调用API,它就像一个魅力。见下面的例子:

client.calls
   .create({
     twiml: '<Response><Say>Hello, this is a test voice call from Twilio.</Say></Response>',
     from: '<us-number>', // same us number
     to: '<uae-number>',  // same uae number,
   })
   .then(call => console.log(`Call SID: ${call.sid}`))
   .catch(error => console.error(`Error making voice call: ${error.message}`));


它将成功返回一个调用SID。
我很不知道这里的信息有什么问题,任何人都面临着类似的问题,同时我已经发送支持twilio和等待他们的答复,因为小时!

相关问题