1

Twilio voice call got error "The server was not able to find the TwiML application associated with the App SID"

followed step

1 - create the twiml app in console
2 - generated api keys
3 - integrated with code

var identity = req.body.identity;

const voiceGrant = new VoiceGrant({
   outgoingApplicationSid: config.twilio.twiml_voice_sid,
   pushCredentialSid: config.twilio.PUSH_SID
 });
 const token = new AccessToken(config.twilio.accountSid, config.twilio.API_KEY, config.twilio.API_KEY_SECRET);

 token.addGrant(voiceGrant);
 token.identity = identity;

 res.send({
     identity: identity,
     token: token.toJwt()
});

Token generated successfully but when I try to use that token from ios side

I got following error in ios sdk

Error: Error Domain=com.twilio.voice.error Code=21218 "Application not found." UserInfo={NSLocalizedDescription=Application not found., NSLocalizedFailureReason=The server was not able to find the TwiML application associated with the App SID}

Thanks in advance

1 Answers1

1

Got the solutions... I forgot to add callback URL in TwiML app

I just created a POST URL in my app and added that URL in TWIML App

Here is the code for POST URL

exports.makeCall = function (req, res) {
  const VoiceResponse = require('twilio').twiml.VoiceResponse;
  const response = new VoiceResponse();
  const dial = response.dial();
  dial.client(req.body.To);
  res.send(response.toString()); 
};