Monday, January 2, 2012

Twilio try-out and cURL error

I was using skype and I finding it expensive. Why $30 a year for a service plus $60 for a phone number? That's $90 dollars for an voip service a year! So I went looking for other services and found twilio. I will testing in the following days.

I was testing how to send sms messages via twilio API and ran into error. Below is how I fixed it

Error1:
undefined constant CURLOPT_USERAGENT
Solution:
check your php.ini file and uncomment the line (remove ;): extension=php_curl.dll
restart your apache server.
resource:
http://drupal.org/node/1044216

Error2:
SSL certificate problem, verify that the CA cert is OK
Solution:
Added the line of code
        //this is a temporary fix for 
//Uncaught exception 'Services_Twilio_TinyHttpException' with message 'SSL certificate problem, verify that the CA cert is OK
//this may have a security flaw
//resources: https://github.com/twilio/twilio-php/issues/18 http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/
$http = new Services_Twilio_TinyHttp('https://api.twilio.com', array('curlopts' => array(
CURLOPT_SSL_VERIFYPEER => false
)));
Resource:
https://github.com/twilio/twilio-php/issues/18

1 comment: