{"id":6467,"date":"2014-04-18T05:41:15","date_gmt":"2014-04-18T05:41:15","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/18\/problem-about-twilio-collection-of-common-programming-errors\/"},"modified":"2014-04-18T05:41:15","modified_gmt":"2014-04-18T05:41:15","slug":"problem-about-twilio-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/18\/problem-about-twilio-collection-of-common-programming-errors\/","title":{"rendered":"problem about twilio-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/graph.facebook.com\/568175400\/picture?type=large\" \/><br \/>\nAndrew Charlton<br \/>\nphp twilio<br \/>\nI&#8217;m trying to send a text message when a form is submitted using Twilio&#8217;s test account however I&#8217;m receiving the following error: &#8216;Fatal error: Class &#8216;Services_Twilio&#8217; not found&#8217;My code is as follows:} else{\/\/PHP nativemail( $to_guest, $subject, $html_text, $header_guest);\/\/ Outlet Admin notification emailmail( $to_admin, $subject, $notification_text, $header_admin);\/* Send an SMS using Twilio. You can run this file 3 different ways:** &#8211; Save it as sendnotifications.php and at the command line,<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1d02cce6eee50ed923a88e305c38f637?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nsomedev<br \/>\nphp curl proxy http-headers twilio<br \/>\nOur environment requires the use of an outbound proxy for offsite services. Normally this isn&#8217;t a problem. In this case with Twilio, the extra header returned breaks the client.Outgoing headers:POST \/2010-04-01\/Accounts\/FOO\/SMS\/Messages.json HTTP\/1.1 Authorization: Basic FOO== User-Agent: twilio-php\/3.10.0 Host: api.twilio.com Accept: *\/* Accept-Charset: utf-8 Content-Type: application\/x-www-form-urlencoded Content-Length: 108Response Headers:HTTP\/1.0 200 Connection establishedHTTP\/1.1 201 Creat<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/pKKdo.jpg?s=32&amp;g=1\" \/><br \/>\n2Dee<br \/>\nandroid twilio<br \/>\nI am using twilioclient-android-1.1.2-3635733 in my application, the MonkeyPhone Class file seems like &#8211; package com.twilio.example.hellomonkey;import java.util.HashMap; import java.util.Map;import android.content.Context; import android.util.Log;import com.twilio.client.Connection; import com.twilio.client.Device; import com.twilio.client.Twilio; import com.twilio.client.Connection.State;public class MonkeyPhone implements Twilio.InitListener {private static final String TAG = &#8220;MonkeyPhone&#8221;;pr<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/bc10c7edd7524e1a05de670a3f0399a4?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nWill<br \/>\nphp twilio<br \/>\nI am really frustrated as I can&#8217;t figure out why my Twilio callStatus for the REST api is not working :S&#8230;Any ideas?It makes a call at stackoverflow.php but when it hits the yournextnumber.php it doesn&#8217;t execute the if statements because most likely there is no value in the callStatus any idea why the status is not being sent?stackoverflow.php&lt;?php \/\/ Include the Twilio PHP library require &#8216;Services\/Twilio.php&#8217;;\/\/ Twilio REST API version $version = &#8220;2010-04-01&#8221;;\/\/ Set our Account SID and Aut<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4f181d67a016dc1ba2b71e32a2fff996?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nlivebanchies<br \/>\nphp const user-agent twilio<br \/>\nI have PHP 5.4.21I&#8217;m using a Twilio API that works fine from a browser but in command line mode, I get the following error:&lt;b&gt;Parse error&lt;\/b&gt;: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or &#8216;}&#8217; in &lt;b&gt;sms\/Services\/Twilio.php&lt;\/b&gt; on line &lt;b&gt;36&lt;\/b&gt;Line 36 of the specified file is part of the following class, please see my note where I specify Line 36.I added all lines of code leading up to and immediately after Line 36 for c<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/98e39ddee69b8fdb3a1375d0c71e4761?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAnn Kilzer<br \/>\njava osx ssl twilio certificates<br \/>\nI&#8217;m following the Twilio-java example from the github page. Here&#8217;s the code snippet I wrote:private boolean doSms(Notification notification) {String message = &#8220;test&#8221;;try {final MessageFactory messageFactory = mainAccount.getMessageFactory();final List&lt;NameValuePair&gt; messageParams = new ArrayList&lt;NameValuePair&gt;();messageParams.add(new BasicNameValuePair(&#8220;To&#8221;, notification.getUser().getPhoneNumber())); messageParams.add(new BasicNameValuePair(&#8220;From&#8221;, BoundaryNumber)); messageParams.add<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b024066cc072c45f3f5b810925ae9ce4?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nanks<br \/>\npython django twilio<br \/>\nI am getting an unexpected error and am unable to find out the solution to my problem.When I am submitting the form on which I am getting the following error:Traceback (most recent call last):File &#8220;\/usr\/local\/lib\/python2.6\/dist-packages\/django\/core\/handlers\/base.py&#8221;, line 111, in get_responseresponse = callback(request, *callback_args, **callback_kwargs)File &#8220;\/home\/ubuntu\/django-apps\/poive\/apps\/smsreminders\/views.py&#8221;, line 77, in cron_process_adherence_responsesresults =process_adherence_respons<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7befb4b74ecaa08e69c3e64efe58d3e0?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAshish Agarwal<br \/>\njava google-app-engine twilio<br \/>\nI am trying to create an Outbound call from google app engine using Twilio helper liabrary like below codeprivate void createcall(HttpServletRequest req, HttpServletResponse resp) {String ACCOUNT_SID = &#8220;AC69000ff19655ca86c5a4ae027b886665&#8221;;String AUTH_TOKEN = &#8220;bef9594c1e7f542b6e331bd7e50077d0&#8221;;try {TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID,AUTH_TOKEN);Map&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();params.put(&#8220;Url&#8221;, &#8220;http:\/\/demo.twilio.com\/docs\/voice.xml&#8221;);<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2dfb950fca038af2178b344a72782627?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nengineerKev<br \/>\nphp wamp twilio<br \/>\nI&#8217;ve recently taken on the task of making a quick and dirty static html page that will use php to access Twilio and reply with an SMS. I am new to Twilio, and was following this tutorial:http:\/\/www.twilio.com\/docs\/quickstart\/php\/sms\/sending-via-restWhen that failed I went back to check if I had skipped any steps after downloading the php zip and read over the content in the install page of the Twilio website, but even that didn&#8217;t make sense, since I have never herd of PEAR and simply downloaded<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1df5c8a3961671d0e0d5f4c9e5ae4e55?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nuser2706899<br \/>\nphp twilio<br \/>\nHi I keep geting the following error when I try to delete a number from my twilio subaccount using REST API in PHPmy code is;$number = $twClient-&gt;account-&gt;incoming_phone_numbers-&gt;get($number_Sid); $twClient-&gt;account-&gt;incoming_phone_numbers-&gt;delete($number-&gt;sid);The error that I am getting is;[22-Aug-2013 09:40:17 UTC] PHP Fatal error: Uncaught exception &#8216;Services_Twilio_RestException&#8217; with message &#8216;The requested resource was not found&#8217; in C:\\Program Files (x86)\\Zend\\Apa<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d99a9857128bba62d21ca699df490894?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nFrank<br \/>\nnotifications sms twilio<br \/>\nHere the piece of code\/* Send an SMS using Twilio. You can run this file 3 different ways:** &#8211; Save it as sendnotifications.php and at the command line, run * php sendnotifications.php** &#8211; Upload it to a web host and load mywebhost.com\/sendnotifications.php * in a web browser.* &#8211; Download a local server like WAMP, MAMP or XAMPP. Point the web root * directory to the folder containing this file, and load * localhost:8888\/sendnotifications.php in a web browser.*\/\/\/ Include the PHP Twi<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c34ec6f095ff32209fb2c7ab60e69c0b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser310525<br \/>\nruby-on-rails ruby twilio<br \/>\nI am using twilio client to make &amp; accept calls from a browser. But when I run the accept page, I get a javascript error on the browser -Uncaught Twilio.Exception: 401: Unable to determine account.@ line &#8211; twilio.js:2683 Here&#8217;s the code from my controlled thats gets executed when showing the accept call page\/view -def prepare_accept_call # create the twilio capability objectcapability = Twilio::Util::Capability.new TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN# guessing this is not needed for acc<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3d5d8fda9d74e8c7c0ddbef86cfd7e40?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSahin Yanlik<br \/>\nphp curl twilio<br \/>\nHi I am trying to send sms with Twilio api, It works on their web-sites but doesn&#8217;t work on my local server here is my code.&lt;?php \/\/ Get the PHP helper library from twilio.com\/docs\/php\/install require_once(&#8216;Services\/Twilio.php&#8217;); \/\/ Loads the library\/\/ Your Account Sid and Auth Token from twilio.com\/user\/account $sid = &#8220;I wrote my Sid(test sid also doesn&#8217;t work)&#8221;; $token = &#8220;my token&#8221;; $client = new Services_Twilio($sid, $token);$sms = $client-&gt;account-&gt;sms_messages-&gt;create(&#8220;From&#8221;,&#8221;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e243c267efa20cc8d317f9b73c28c7f1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nHyper Anthony<br \/>\nphp twilio<br \/>\nTrying to implement the Twilio Client Conference Call Monitor as described here: https:\/\/www.twilio.com\/docs\/howto\/twilio-client-browser-conference-call-monitorIt &#8220;sees&#8221; ongoing conferences and has output like this:Found 0 conference(s) Found 1 conference(s) etc.However, it doesn&#8217;t list the ongoing conferences as desired. No further output is given.In the ssl_error_log, I found this, which is interesting:PHP Fatal error: Uncaught exception &#8216;Exception&#8217; with message &#8216;Objectsreturned by Services_<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1617f1d4b7fa50d39823c96db3b288f4?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser2339071<br \/>\ntwilio<br \/>\nI keep getting Uncaught Twilio.Exception: Run Twilio.Device.setup() when starting a call after the page posts back.The problem is not consistent and after refreshing the page several times it goes away and i can make outbound calls again. But it happens at least once after a post back.any ideas..?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2dfb950fca038af2178b344a72782627?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nengineerKev<br \/>\nphp javascript html web-applications twilio<br \/>\nI am working on implementing a get link button that will send you a link via text once you type your phone number in the textfield. I am using Twilio to handle my SMS stuff, and I am following an app tutorial that teaches exactly what I am trying to implement. This is the tutorial and the ideal implementation of what I&#8217;d like to do, respectively:http:\/\/www.apptamin.com\/blog\/app-download-button\/http:\/\/getmaid.com\/So far I have made an easy html file that just displays the button, a message, and<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0ab28b2d96ede8696738242ebc0cf3d0?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nNateHill<br \/>\nnode.js twilio<br \/>\nTwilio has documentation\/examples on how to respond to keywords in SMS messages for php (https:\/\/www.twilio.com\/help\/faq\/sms\/how-do-i-build-a-sms-keyword-response-application) and python (https:\/\/www.twilio.com\/docs\/quickstart\/python\/sms\/replying-to-sms-messages).What&#8217;s the equivalent for grabbing the &#8216;Request Parameters&#8217; using node.js? Because I&#8217;d like to be able to respond back using information received in the sms just like in the other examples. My current thinking is that my response should<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1074f0a031cca12280359231a87662af?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nEric<br \/>\nphp drupal foreach submit twilio<br \/>\nI have a Twilio account and I am writing a mass text message module for my Drupal site. At the beginning of the module I have set up the Twilio client with the following code:$path = drupal_get_path(&#8220;library&#8221;, &#8220;twilio&#8221;); require($path . &#8220;twilio\/Services\/Twilio.php&#8221;); $accountSID = &#8220;xxxxxxxxxxxxxxxxxxxxxxxxxxxx&#8221;; $authToken = &#8220;xxxxxxxxxxxxxxxxxxxxxxxxxxxx&#8221;; $client = new Services_Twilio($accountSID, $authToken); $from = &#8220;xxxxxxxxxx&#8221;;The myModule_submit() queries the database for phone numbers and<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/41d2a772b53998ed8df06c334d9a1c04?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1903663<br \/>\nruby sinatra twilio<br \/>\nSorry this is a very basic question so it should be easy to answer!Using ruby and sinatra, I am trying to connect, via the api, to get details of my calls. The prescribed way to do this by twilio seems to be: @client = Twilio::REST::Client.new account_sid, auth_token # Loop over calls and print out a property for each one @client.account.calls.list.each do |call| puts call.sid puts call.from puts call.towhich works fine and &#8220;puts&#8221; the data in the terminal. I want to print the results on an HTML<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/eaac0e763e5e21a9ab3f1fa5b8646694?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nNar<br \/>\nruby-on-rails ruby twilio<br \/>\nI use twilio gem and I do not know how to release the phone number. I try:@client.account.incoming_phone_numbers.delete(:phone_number =&gt; phone_number)but rails say:undefined method `delete&#8217; for #&lt;Twilio::REST::IncomingPhoneNumbers:0x7f35c99e93e0&gt;How to correct release number?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e43d06ff83aa28514e8b160a68dff69e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAzoloth<br \/>\nc++ windows-7 g++ twilio<br \/>\nI am new to C++, I am trying to compile the twilio library for it on Windows.When I try to build the code I get the following errorTo give a brief overview of what I have done and what I am using.I have MinGW installed, all library files in the proper include folder under it.I am using sublime for my IDE and this is the error received upon building it.Update*I have ran the make. I am copying the output from my Cygwin, but the normal DOS prompt gave the same output. $ mingw32-makear rcs twilio-cp<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/222ef6ba0067f3fb73de48cfd25fa956?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser382318<br \/>\npython django https urllib2 twilio<br \/>\nI&#8217;m looking to send an SMS with the Twilio api, but I&#8217;m getting the following error:&#8221;unknown url type: https&#8221;I&#8217;ve recompiled python with Openssl, so my code runs fine from the python interpretor, but whenever I try to run it in one of my django views I get this error. Here is my code from my view:def send_sms(request):recipient = &#8216;1234567890&#8217;account = twilio.Account(settings.TWILIO_ID, settings.TWILIO_TOKEN)params = { &#8216;From&#8217;: settings.TWILIO_NUM, &#8216;To&#8217;: recipient, &#8216;Body&#8217;: &#8216;This is a test message.<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Andrew Charlton php twilio I&#8217;m trying to send a text message when a form is submitted using Twilio&#8217;s test account however I&#8217;m receiving the following error: &#8216;Fatal error: Class &#8216;Services_Twilio&#8217; not found&#8217;My code is as follows:} else{\/\/PHP nativemail( $to_guest, $subject, $html_text, $header_guest);\/\/ Outlet Admin notification emailmail( $to_admin, $subject, $notification_text, $header_admin);\/* Send an SMS using Twilio. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6467","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6467"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6467\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}