2

I'm trying to run the example here: https://www.twilio.com/docs/quickstart/python/client/outgoing-calls

I run the flask script on port 5000 and try loading in my browser and I see the input box for my phone number but it just says Loading Pigeons below that. I click Dial and nothing happens.

My application sid, account sid and auth_token are all present. Nothing is showing up in my Twilio debug when I try this. If I view source I can click the link to all 3 javascript files so I know the path to them is good.

My Twilio account also works ok in other applications. I also tried this in Chrome, IE and Firefox, same result in all 3.

  • Is there any errors or anything shown in the browser dev tools? – philnash Aug 26 '16 at 07:03
  • twilio.min.js:95 Uncaught Twilio.Exception: Wrong number of segments – user2845617 Aug 29 '16 at 16:13
  • Is there any more to the error than that? Which version of Twilio client are you using? Have you changed the code from the quick start at all and if so, can you share what you've done? – philnash Aug 29 '16 at 16:15
  • http://ae.saasier.com:5000/client I get the same exact error with no more detail in both Chrome and Firefox. The code is unchanged. I'm using the code from https://www.twilio.com/docs/quickstart/python/client/outgoing-calls – user2845617 Aug 29 '16 at 16:29
  • Ok, in the source of your HTML, I found this JavaScript: https://monosnap.com/file/tNoogfBbn7qJ0gxjmb7hl2ZvnVMcyI.png. So there's something up with the server generating the capability token or your template adding the token to the page. – philnash Aug 29 '16 at 16:32
  • Or indeed that's what the page in the docs says right now. Let me investigate – philnash Aug 29 '16 at 16:33

1 Answers1

1

Twilio developer evangelist here.

There appears to be an escaping issue in the Twilio client quick start documentation here.

Where the JavaScript is currently set to:

Twilio.Device.setup("{{ token }}");

It should really say:

Twilio.Device.setup("{{ token }}");

I will raise this with the team responsible and hopefully this will be fixed swiftly. In the meantime, I hope you get your Twilio Client application up and running now. Let me know if I can do anything else to help.

philnash
  • 70,667
  • 10
  • 60
  • 88
  • Thanks for this. I fixed that error. Now when I put in a phone number to dial (my cell phone) and click Dial I immediately get a brief tone and it says call ended. I put in my Twilio phone number as the caller id. I don't see any errors in the Twilio Debugger. – user2845617 Aug 29 '16 at 17:31
  • Are you seeing any errors in the browser's dev tools? – philnash Aug 29 '16 at 17:34
  • getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. 2twilio.min.js:106 WebSocket connection to 'wss://chunderw-vpc-gll.twilio.com/signal' failed: WebSocket is closed before the connection is established. – user2845617 Aug 29 '16 at 17:45
  • In Firefox I get slightly different errors: WebRTC interfaces with the "moz" prefix (mozRTCPeerConnection, mozRTCSessionDescription, mozRTCIceCandidate) have been deprecated. twilio.min.js:82:381 navigator.mozGetUserMedia has been replaced by navigator.mediaDevices.getUserMedia twilio.min.js:77:0 onaddstream is deprecated! Use peerConnection.ontrack instead. (unknown) Invalid URI. Load of media resource failed. client – user2845617 Aug 29 '16 at 17:46
  • Right, I think it might be the secure origin thing. You can't get access to a user's microphone unless you have an https site. If you are building this locally, then localhost is deemed a secure origin and this should work there. – philnash Aug 29 '16 at 17:48
  • I'm running locally now. Same result but the secure error is gone. Here are the current errors: WebRTC interfaces with the "moz" prefix (mozRTCPeerConnection, mozRTCSessionDescription, mozRTCIceCandidate) have been deprecated.twilio.min.js:82:381 navigator.mozGetUserMedia has been replaced by navigator.mediaDevices.getUserMediatwilio.min.js:77 onaddstream is deprecated! Use peerConnection.ontrack instead.twilio.min.js:69 Invalid URI. Load of media resource failed.client – user2845617 Aug 29 '16 at 19:04
  • No errors in Chrome. Just hangs up immediately and says Call ended. – user2845617 Aug 29 '16 at 19:07
  • What URL does your TwiML Application SID point to and is that accessible by Twilio? – philnash Aug 29 '16 at 19:09
  • It wasn't clear from the documentation that I needed to setup a url in the twiml app. I just tried putting in ip:5000/voice in and trying again and the call connected this time. Thanks for the help! – user2845617 Aug 29 '16 at 19:20
  • Hooray! Glad it's all fixed! – philnash Aug 29 '16 at 22:17