This PHP library is an open source tool built to simplify interaction with the TelAPI telephony platform. TelAPI makes adding voice and SMS to applications fun and easy., (*1)
For this libraries full documentation visit: http://telapi.github.com/telapi-php, (*2)
For more information about TelAPI visit: telapi.com/features or telapi.com/docs, (*3)
At the moment we don't support the PEAR package but will in the near future!, (*4)
Access terminal and run the following code:, (*5)
$ cd ~ $ git clone https://github.com/TelAPI/telapi-php.git $ cd telapi-php
Download the .zip file., (*6)
Once the .zip download is complete, extract it and get started with the examples below., (*7)
TelAPI REST API documentation, (*8)
setOptions(array( 'account_sid' => '{AccountSid}', 'auth_token' => '{AuthToken}', )); // Send the SMS $sms_message = $telapi->create('sms_messages', array( 'From' => '+12223334444', 'To' => '+15550001212', 'Body' => "This is an SMS message sent from the TelAPI PHP wrapper! Easy as 1, 2, 3!" )); print_r($sms_message); ``` ### InboundXML InboundXML is an XML dialect which enables you to control phone call flow. For more information please visit the [TelAPI InboundXML documentation](http://www.telapi.com/docs/api/inboundxml/) #####Example ```php say('Welcome to TelAPI. This is a sample InboundXML document.', array('voice' => 'man')); echo $inbound_xml; ``` will render ```xml <Response> <Say voice="man">Welcome to TelAPI. This is a sample InboundXML document.</Say> </Response>
Just host that PHP file somewhere, buy a phone number in your TelAPI Account Dashboard and assign the URL of that PHP page to your new number. Whenever you dial that number, the InboundXML this page generates will be executed and you'll hear our text-to-speech engine say welcome., (*9)
http://telapi.github.com/telapi-php, (*10)