1
votes

I am trying twilio to make phone calls from my browser to mobile numbers but unsuccessful. Following are the steps i followed:

  1. Downloaded twilio-php api: https://github.com/twilio/twilio-php

  2. Downloaded twilio browser-phone code: https://www.twilio.com/docs/tutorials/twilio-client-browser-soft-phone

  3. Created a twilio account, selected a number and updated this code: https://gist.github.com/anonymous/8eed141b1b4214110592

Now when i dial any real phone number, i get the message: "..Configure your numbers voice url to change this message..." and "Call ended".

Appreciate clear guidance on how to get this work (call from browser to a real number).

1
Can you help me out how you develop this to make calls from browsers?Mohsin Abbas

1 Answers

0
votes

You need to create a TwiML app and provide the voice url over there. Create a php file and provide the url in the twiml app and place the twiml app sid to your browser phone code.

$token->allowClientOutgoing('AP19471819473945b0d234ba2007a351c4'); //twiml appsid

and this php code in voice url

<?php
header('Content-type: text/xml');
?>
<Response>
<Dial callerId="+17067487754"><?php echo htmlspecialchars($_REQUEST["tocall"]); ?></Dial>
</Response>