Twilio project quick_start not working

I am following Twilio Quickstart to get Twilio up and running for the first time. I have deployed Twilio to Heroku using this link . Give it the required parameters like twilio_account_sid, twilio_auth_token, twilio_caller_id and twilio_app_id . I created a TwiML app and entered my app's url deployed to Heroku and set its GET method.

Then import your Twilio Quickstart project into Android Studio and set TOKEN_SERVICE_URL to my Heroku app url. I ran the app, got no error, but this is the message on logcat Device has stopped listening for incoming connections

.

I am running an app on two devices, registering one name and trying to invoke it. I get the capability token , but nothing happens. No beeb, no sound and nothing, but when I try to call using the app url in the browser, a trial warning sound plays and I see the message "Call Foundreished Successfully" and then ends immediately without connecting. My account has its own initial credit; about $ 11.0.

I also see a warning about XML - 12200 validation in the Twilio debugger. I tried and searched many times after four days. Please help me figure out the problem and solve it. I'm waiting for you guys.

Thanks in Advance.

Edit: Here is my body response that I get in the Twilio debug console:

    <!DOCTYPE html>
<html>
    <head>
        <title>Hello Client Monkey Quicker Starter'</title>
        <script type="text/javascript"
      src="//media.twiliocdn.com/sdk/js/client/v1.3/twilio.min.js"></script>
        <script type="text/javascript"
      src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <link href="//static0.twilio.com/packages/quickstart/client.css"
      type="text/css" rel="stylesheet" />
        <script type="text/javascript">

    Twilio.Device.setup("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzY29wZSI6InNjb3BlOmNsaWVudDppbmNvbWluZz9jbGllbnROYW1lPWNoYXJsZXMgc2NvcGU6Y2xpZW50Om91dGdvaW5nP2FwcFNpZD1BUDNhYWVlYmVmYWUwMDEyZmVlZGRlOTU3N2FkYzdkNDUxJmNsaWVudE5hbWU9Y2hhcmxlcyIsImlzcyI6IkFDM2UyOGQ0OGRjOWExM2NlMzIzNjZmY2M1OTU1ZmI5OWMiLCJleHAiOjE0OTIzMjc0MzR9.WdnE5GRkM9--MRj9MZlEIjTvGb5U7XXWQj2rBDaj2uE", {debug: true});

      Twilio.Device.ready(function (device) {
        $("#log").text("Client 'charles' is ready");
      });

      Twilio.Device.error(function (error) {
        $("#log").text("Error: " + error.message);
      });

      Twilio.Device.connect(function (conn) {
        $("#log").text("Successfully established call");
      });

      Twilio.Device.disconnect(function (conn) {
        $("#log").text("Call ended");
      });

      Twilio.Device.incoming(function (conn) {
        $("#log").text("Incoming connection from " + conn.parameters.From);
        // accept the incoming connection and start two-way audio
        conn.accept();
      });

      function call() {
        // get the phone number or client to connect the call to
        params = {"PhoneNumber": $("#number").val()};
        Twilio.Device.connect(params);
      }

      function hangup() {
        Twilio.Device.disconnectAll();
      }
    </script>
    </head>
    <body>
        <button class="call" onclick="call();">
      Call
    </button>
        <button class="hangup" onclick="hangup();">
      Hangup
    </button>
        <input type="text" id="number" name="number"
      placeholder="Enter a phone number or

      

+3


source to share


1 answer


Twilio developer evangelist is here.



So the problem is that your TwiML application is pointing to the wrong path in your application. You are currently pointing to the root path /

, which actually returns the front end of the application. You need to update your TwiML application with the URL you deployed it to and the path /voice

.

0


source







All Articles