Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error - 12100 in placeCall #9

Open
alexanderkhitev opened this issue Mar 31, 2018 · 12 comments
Open

Error - 12100 in placeCall #9

alexanderkhitev opened this issue Mar 31, 2018 · 12 comments
Assignees

Comments

@alexanderkhitev
Copy link

I try SwiftVoiceQuickstart when I call from the first device to the second one, after I heard the welcome phrase on the first device, on the second I see Alert with the ability to answer the call, but the first device receives Error - 12100 if the second device answers the call , then I hear the phrase with congratulations. I use node.js server. Please, tell me, how can I fix this?

async function placeCall(request, response) {
  // The recipient of the call, a phone number or a client
  var to = null;
  var from = null;
  if (request.method == 'POST') {
    to = request.body.to;
      from = request.body.from;
  } else {
    to = request.query.to;
      from = request.query.from;
  }
  console.log(to);
  // The fully qualified URL that should be consulted by Twilio when the call connects.
  var url = request.protocol + '://' + request.get('host') + '/incoming';
  console.log(url);
  const accountSid = process.env.ACCOUNT_SID;
  const apiKey = process.env.API_KEY;
  const apiSecret = process.env.API_KEY_SECRET;
  const client = require('twilio')(apiKey, apiSecret, { accountSid: accountSid } );

  if (!to) {
    console.log("Calling default client:" + defaultIdentity);
    call = await client.api.calls.create({
      url: url,
      to: 'client:' + defaultIdentity,
      from: 'client:' + from,
    });
  } else if (isNumber(to)) {
    console.log("Calling number:" + to);
    call = await client.api.calls.create({
      url: url,
      to: to,
      from: callerNumber,
    });
  } else {
    console.log("Calling client:" + to);
    call =  await client.api.calls.create({
      url: url,
      to: 'client:' + to,
        from: 'client:' + from,
    });
  }
  console.log(call.sid)
  //call.then(console.log(call.sid));
  return response.send(call.sid);
}

My goal is to make a full-fledged call between two users.

@bobiechen-twilio
Copy link

Hi @alexanderkhitev

When making direct call between clients you will not need the url parameter in the client.api.calls.create method call.
The 12100 error code usually means something incorrect with the TwiML response. Could you help us check the Programmable Voice Dashboard and see what is the error being logged when you see the error?

Thanks
-bobie

@alexanderkhitev
Copy link
Author

Hi @bchen-twilio

Error - 12100

Document parse failure

Twilio was unable to parse the provided XML Document.

Msg ""
parserMessage "Error on line 1 of document : Content is not allowed in prolog. "
ErrorCode "12100"
LogLevel "ERROR"

@kbagchiGWC kbagchiGWC self-assigned this Apr 2, 2018
@kbagchiGWC
Copy link
Collaborator

kbagchiGWC commented Apr 2, 2018

@alexanderkhitev

Have you created an application sid and followed the instructions provided https://github.com/twilio/voice-quickstart-swift#11-make-client-to-client-call?

When you make a call using the voice-quickstart-server-node server code, https://github.com/twilio/voice-quickstart-server-node/blob/master/src/server.js#L88 should print the TwiML the server is generating in the console. Can you share that here? It should look something like this if you are calling a client device2.

<?xml version="1.0" encoding="UTF-8"?>
    <Response>
        <Dial callerId="client:quick_start">
            <Client>device2</Client>
        </Dial>
    </Response>

@AntonAdamkovich
Copy link

@kbagchiGWC am I right6 that If i want to make call between 2 clients I need to delete url parameter to stop invoke incoming() function
image
Or i have to implement connection between 2 clients inside this function?

@kbagchiGWC
Copy link
Collaborator

kbagchiGWC commented Dec 2, 2019

@AntonAdamkovich
To be able to make client to client calls - you can follow the code in makeCall function.

You are correct the required params to make client to client calls are to and callerid, url is not required.

placeCall function uses Twilio REST API to make calls where url param is required. This endpoint is used in our mobile quickstart README to demonstrate incoming push notification.

@wertpoiu
Copy link

Msg ""
parserMessage "Error on line 1 of document : Content is not allowed in prolog. "
ErrorCode "12100"
url "http://fbdb80f65544.ngrok.io/placeCall"
LogLevel "ERROR"

@wertpoiu
Copy link

wertpoiu commented Oct 23, 2020

Msg ""
parserMessage "Error on line 1 of document : Content is not allowed in prolog. "
ErrorCode "12100"
url "http://fbdb80f65544.ngrok.io/placeCall"
LogLevel "ERROR"

I am getting this error. no twiml in response.

@wertpoiu
Copy link

Msg ""
parserMessage "Error on line 1 of document : Content is not allowed in prolog. "
ErrorCode "12100"
url "http://fbdb80f65544.ngrok.io/placeCall"
LogLevel "ERROR"

fixed this error, but not getting below error

<!doctype html5><style type="text/css">

    strong { font-weight: bold; }
    hr { -moz-box-sizing: content-box; box-sizing: content-box; height: 0; }
    html { font-family: sans-serif;   -ms-text-size-adjust: 100%;   -webkit-text-size-adjust: 100%;   } body { margin: 0; }
    a { background-color: transparent; }
    a:active, a:hover { outline: 0; }
    </style><style type="text/css">
        body { background-color: #f5f5f5; }
        .container { width: 500px; margin: auto; color: #444; padding: 5px; }
        a, strong { color: purple; text-decoration: none; }
        a:hover { text-decoration: underline; }
        h2 { text-align: center; color: #000; }
        p { line-height: 20px; }
    </style></head><body><div class="container"><h2>Failed to complete tunnel connection</h2><hr /><p>
The connection to <strong><a href="http://02e4bd391c04.ngrok.io">http://02e4bd391c04.ngrok.io</a></strong>
was successfully tunneled to your ngrok client,
but the client failed to establish a connection to
the local address <strong><a href="http://localhost:3000">localhost:3000</a></strong>.

Make sure that a web service is running on localhost:3000 and that it is a valid address.

The error encountered was: dial tcp [::1]:3000: connect: connection refused

@wertpoiu
Copy link

MESSAGE
An attempt to retrieve content from http://fb0c8be7eb47.ngrok.io/placeCall returned the HTTP status code 502

@bobiechen-twilio
Copy link

Hi @wertpoiu

To return a TwiML response, you will need to use the /makeCall endpoint and make sure you are returning a valid response.

@ismailkhan89
Copy link

I removed url then below error occurred
RestException [Error]: Url parameter is required.
status: 400,
code: 21205,
moreInfo: 'https://www.twilio.com/docs/errors/21205',
details: undefined

@ismailkhan89
Copy link

I want to make a simple call without greetings messages etc.
where i will provide "To" number and twilio will call on that number like alex said above
My goal is to make a full-fledged call between two users.

can any one share your code because i tried multiple ways

like called placeCall from my app and created Twiml app in which callback url defined to /makeCall call so it just say "Congratulations! You have received your first inbound call! Good bye." greetings from incoming function instead of communication between 2 users

function incoming() { const voiceResponse = new VoiceResponse(); voiceResponse.say("Congratulations! You have received your first inbound call! Good bye."); console.log('Response:' + voiceResponse.toString()); return voiceResponse.toString(); }

other two functions are as below.

`function makeCall(request, response) {
// The recipient of the call, a phone number or a client
var to = null;
if (request.method == 'POST') {
to = request.body.to;
} else {
to = request.query.to;
}

const voiceResponse = new VoiceResponse();

if (!to) {
voiceResponse.say("Congratulations! You have made your first call! Good bye.");
} else if (isNumber(to)) {
const dial = voiceResponse.dial({callerId : callerNumber});
dial.number(to);
} else {
const dial = voiceResponse.dial({callerId : callerId});
dial.client(to);
}
console.log('Response:' + voiceResponse.toString());
return response.send(voiceResponse.toString());
}`

`async function placeCall(request, response) {
// The recipient of the call, a phone number or a client
var to = null;
if (request.method == 'POST') {
to = request.body.to;
} else {
to = request.query.to;
}
console.log(to);
// The fully qualified URL that should be consulted by Twilio when the call connects.
var url = request.protocol + '://' + request.get('host') + '/incoming';
console.log(url);
const accountSid = process.env.ACCOUNT_SID;
const apiKey = process.env.API_KEY;
const apiSecret = process.env.API_KEY_SECRET;
const client = require('twilio')(apiKey, apiSecret, { accountSid: accountSid } );

if (!to) {
console.log("Calling default client:" + defaultIdentity);
call = await client.api.calls.create({
url: url,
to: 'client:' + defaultIdentity,
from: callerId,
});
} else if (isNumber(to)) {
console.log("Calling number:" + to);
call = await client.api.calls.create({
url: url,
to: to,
from: callerNumber,
});
} else {
console.log("Calling client:" + to);
call = await client.api.calls.create({
url: url,
to: 'client:' + to,
from: callerId,
});
}
console.log(call.sid)
//call.then(console.log(call.sid));
return response.send(call.sid);
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants