title: using twilio php library in mobile devices (ios and android)?
body: <p>I'm working on a simple application using twlio php library to make out going calls.</p>
  
  <p>everything seems to be working as it should in web browser. However, when i test the simple php page in a mobile device (iphone for example), nothing works! I get the page loaded but I cannot make any outgoing calls!</p>
  
  <p>this is my code:</p>
  
  <pre><code>&lt;?php
  include 'Services/Twilio/Capability.php';
  
  // put your Twilio API credentials here
  $accountSid = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
  $authToken  = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
  
  // put your Twilio Application Sid here
  $appSid     = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
  
  $capability = new Services_Twilio_Capability($accountSid, $authToken);
  $capability-&gt;allowClientOutgoing($appSid);
  $capability-&gt;allowClientIncoming('jenny');
  $token = $capability-&gt;generateToken();
  ?&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Hello Client Monkey 4&lt;/title&gt;
      &lt;script type="text/javascript"
        src="//static.twilio.com/libs/twiliojs/1.2/twilio.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"
        src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;
      &lt;/script&gt;
  
      &lt;script type="text/javascript"&gt;
  
        Twilio.Device.setup("&lt;?php echo $token; ?&gt;");
  
        Twilio.Device.ready(function (device) {
          $("#log").text("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 to connect the call to
          params = {"PhoneNumber": $("#number").val()};
          Twilio.Device.connect(params);
        }
  
        function hangup() {
          Twilio.Device.disconnectAll();
        }
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;button class="call" onclick="call();"&gt;
        Call
      &lt;/button&gt;
  
      &lt;button class="hangup" onclick="hangup();"&gt;
        Hangup
      &lt;/button&gt;
  
      &lt;input type="text" id="number" name="number"
        value="Phone Number/&gt;
  
      &lt;div id="log"&gt;Loading pigeons...&lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Could someone please advise on this issue? am I missing something?</p>