Skip to content

Commit e96c363

Browse files
committed
Add SMS support
Summary: Provides a working SMS implementation with support for Twilio. This version doesn't really retry if we get any gruff at all. Future versions should retry. Test Plan: used bin/sms to send messages and look at them. Reviewers: chad, epriestley Reviewed By: epriestley Subscribers: aurelijus, epriestley, Korvin Maniphest Tasks: T920 Differential Revision: https://secure.phabricator.com/D8930
1 parent e6aff10 commit e96c363

File tree

168 files changed

+15598
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+15598
-0
lines changed

bin/sms

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../scripts/sms/manage_sms.php

externals/twilio-php/AUTHORS.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Authors
2+
=======
3+
4+
A huge thanks to all of our contributors:
5+
6+
7+
- =noloh
8+
- Adam Ballai
9+
- Alex Chan
10+
- Alex Rowley
11+
- Brett Gerry
12+
- Bulat Shakirzyanov
13+
- Chris Barr
14+
- D Keith Casey Jr
15+
- D. Keith Casey, Jr.
16+
- Doug Black
17+
- John Britton
18+
- Jordi Boggiano
19+
- Keith Casey
20+
- Kevin Burke
21+
- Kyle
22+
- Kyle Conroy
23+
- Luke Waite
24+
- Neuman
25+
- Neuman Vong
26+
- Peter Meth
27+
- Ryan Brideau
28+
- Sam Kimbrel
29+
- Shawn Parker
30+
- Stuart Langley
31+
- Taichiro Yoshida
32+
- Trenton McManus
33+
- aaronfoss
34+
- sashalaundy
35+
- till

externals/twilio-php/CHANGES.md

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
twilio-php Changelog
2+
====================
3+
4+
Version 3.12.4
5+
--------------
6+
7+
Released on January 30, 2014
8+
9+
- Fix incorrect use of static:: which broke compatibility with PHP 5.2.
10+
11+
Version 3.12.3
12+
--------------
13+
14+
Released on January 28, 2014
15+
16+
- Add link from recordings to associated transcriptions.
17+
- Document how to debug requests, improve TwiML generation docs.
18+
19+
Version 3.12.2
20+
--------------
21+
22+
Released on January 5, 2014
23+
24+
- Fixes string representation of resources
25+
- Support PHP 5.5
26+
27+
Version 3.12.1
28+
--------------
29+
30+
Released on October 21, 2013
31+
32+
- Add support for filtering by type for IncomingPhoneNumbers.
33+
- Add support for searching for mobile numbers for both
34+
IncomingPhoneNumbers and AvailablePhoneNumbers.
35+
36+
Version 3.12.0
37+
--------------
38+
39+
Released on September 18, 2013
40+
41+
- Support MMS
42+
- Support SIP In
43+
- $params arrays will now turn lists into multiple HTTP keys with the same name,
44+
45+
array("Twilio" => array('foo', 'bar'))
46+
47+
will turn into Twilio=foo&Twilio=bar when sent to the API.
48+
49+
- Update the documentation to use php-autodoc and Sphinx.
50+
51+
Version 3.11.0
52+
--------------
53+
54+
Released on June 13
55+
56+
- Support Streams when curl is not available for PHP installations
57+
58+
Version 3.10.0
59+
--------------
60+
61+
Released on February 2, 2013
62+
63+
- Uses the [HTTP status code for error reporting][http], instead of the
64+
`status` attribute of the JSON response. (Reporter: [Ruud Kamphuis](/ruudk))
65+
66+
[http]: https://github.com/twilio/twilio-php/pull/116
67+
68+
Version 3.9.1
69+
-------------
70+
71+
Released on December 30, 2012
72+
73+
- Adds a `$last_response` parameter to the `$client` object that can be
74+
used to [retrieve the raw API response][last-response]. (Reporter: [David
75+
Jones](/dxjones))
76+
77+
[last-response]: https://github.com/twilio/twilio-php/pull/112/files
78+
79+
Version 3.9.0
80+
-------------
81+
82+
Released on December 20, 2012
83+
84+
- [Fixes TwiML generation to handle non-ASCII characters properly][utf-8]. Note
85+
that as of version 3.9.0, **the library requires PHP version 5.2.3, at least
86+
for TwiML generation**. (Reporter: [Walker Hamilton](/walker))
87+
88+
[utf-8]: https://github.com/twilio/twilio-php/pull/111
89+
90+
Version 3.8.3
91+
-------------
92+
93+
Released on December 15, 2012
94+
95+
- [Fixes the ShortCode resource][shortcode] so it is queryable via the PHP library.
96+
97+
[shortcode]: https://github.com/twilio/twilio-php/pull/108
98+
99+
Version 3.8.2
100+
-------------
101+
102+
Released on November 26, 2012
103+
104+
- Fixes an issue where you [could not iterate over the members in a
105+
queue][queue-members]. (Reporter: [Alex Chan](/alexcchan))
106+
107+
[queue-members]: https://github.com/twilio/twilio-php/pull/107
108+
109+
Version 3.8.1
110+
-------------
111+
112+
Released on November 23, 2012
113+
114+
- [Implements the Countable interface on the ListResource][countable], so you
115+
can call count() on any resource.
116+
- [Adds a convenience method for retrieving a phone number object][get-number],
117+
so you can retrieve all of a number's properties by its E.164 representation.
118+
119+
Internally:
120+
121+
- Adds [unit tests for url encoding of Unicode characters][unicode-tests].
122+
- Updates [Travis CI configuration to use Composer][travis-composer],
123+
shortening build time from 83 seconds to 21 seconds.
124+
125+
[countable]: https://twilio-php.readthedocs.org/en/latest/usage/rest.html#retrieving-the-total-number-of-resources
126+
[get-number]: https://twilio-php.readthedocs.org/en/latest/usage/rest/phonenumbers.html#retrieving-all-of-a-number-s-properties
127+
[unicode-tests]: https://github.com/twilio/twilio-php/commit/6f8aa57885796691858e460c8cea748e241c47e3
128+
[travis-composer]: https://github.com/twilio/twilio-php/commit/a732358e90e1ae9a5a3348ad77dda8cc8b5ec6bc
129+
130+
Version 3.8.0
131+
-------------
132+
133+
Released on October 17, 2012
134+
135+
- Support the new Usage API, with Usage Records and Usage Triggers. Read the
136+
PHP documentation for [usage records][records] or [usage triggers][triggers]
137+
138+
[records]: https://twilio-php.readthedocs.org/en/latest/usage/rest/usage-records.html
139+
[triggers]: https://twilio-php.readthedocs.org/en/latest/usage/rest/usage-triggers.html
140+
141+
Version 3.7.2
142+
-------------
143+
144+
- The library will now [use a standard CA cert whitelist][whitelist] for SSL
145+
validation, replacing a file that contained only Twilio's SSL certificate.
146+
(Reporter: [Andrew Benton](/andrewmbenton))
147+
148+
[whitelist]: https://github.com/twilio/twilio-php/issues/88
149+
150+
Version 3.7.1
151+
-------------
152+
153+
Released on August 16, 2012
154+
155+
- Fix a bug in the 3.5.0 release where [updating an instance
156+
resource would cause subsequent updates to request an incorrect
157+
URI](/twilio/twilio-php/pull/82).
158+
(Reporter: [Dan Bowen](/crucialwebstudio))
159+
160+
Version 3.7.0
161+
-------------
162+
163+
Released on August 6, 2012
164+
165+
- Add retry support for idempotent HTTP requests that result in a 500 server
166+
error (default is 1 attempt, however this can be configured).
167+
- Throw a Services_Twilio_RestException instead of a DomainException if the
168+
response content cannot be parsed as JSON (usually indicates a 500 error)
169+
170+
Version 3.6.0
171+
-------------
172+
173+
Released on August 5, 2012
174+
175+
- Add support for Queues and Members. Includes tests and documentation for the
176+
new functionality.
177+
178+
Version 3.5.2
179+
-------------
180+
181+
Released on July 23, 2012
182+
183+
- Fix an issue introduced in the 3.5.0 release where updating or muting
184+
a participant would [throw an exception instead of muting the
185+
participant][mute-request].
186+
(Reporter: [Alex Chan](/alexcchan))
187+
188+
- Fix an issue introduced in the 3.5.0 release where [filtering an iterator
189+
with parameters would not work properly][paging-request] on subsequent HTTP
190+
requests. (Reporters: [Alex Chan](/alexcchan), Ivor O'Connor)
191+
192+
[mute-request]: /twilio/twilio-php/pull/74
193+
[paging-request]: /twilio/twilio-php/pull/75
194+
195+
Version 3.5.1
196+
-------------
197+
198+
Released on July 2, 2012
199+
200+
- Fix an issue introduced in the 3.5.0 release that would cause a second HTTP
201+
request for an instance resource [to request an incorrect URI][issue-71].
202+
203+
[issue-71]: https://github.com/twilio/twilio-php/pull/71
204+
205+
Version 3.5.0
206+
-------------
207+
208+
Released on June 30, 2012
209+
210+
- Support paging through resources using the `next_page_uri` parameter instead
211+
of manually constructing parameters using the `Page` and `PageSize` parameters.
212+
Specifically, this allows the library to use the `AfterSid` parameter, which
213+
leads to improved performance when paging deep into your resource list.
214+
215+
This involved a major refactor of the library. The documented interface to
216+
twilio-php will not change. However, some undocumented public methods are no
217+
longer supported. Specifically, the following classes are no longer available:
218+
219+
- `Services/Twilio/ArrayDataProxy.php`
220+
- `Services/Twilio/CachingDataProxy.php`
221+
- `Services/Twilio/DataProxy.php`
222+
223+
In addition, the following public methods have been removed:
224+
225+
- `setProxy`, in `Services/Twilio/InstanceResource.php`
226+
- `getSchema`, in `Services/Twilio/ListResource.php`,
227+
`Services/Twilio/Rest/AvailablePhoneNumbers.php`,
228+
`Services/Twilio/Rest/SMSMessages.php`
229+
230+
- `retrieveData`, in `Services/Twilio/Resource.php`
231+
- `deleteData`, in `Services/Twilio/Resource.php`
232+
- `addSubresource`, in `Services/Twilio/Resource.php`
233+
234+
Please check your own code for compatibility before upgrading.
235+
236+
Version 3.3.2
237+
-------------
238+
239+
Released on May 3, 2012
240+
241+
- If you pass booleans in as TwiML (ex transcribe="true"), convert them to
242+
the strings "true" and "false" instead of outputting the incorrect values
243+
1 and "".
244+
245+
Version 3.3.1
246+
-------------
247+
248+
Released on May 1, 2012
249+
250+
- Use the 'Accept-Charset' header to specify we want to receive UTF-8 encoded
251+
data from the Twilio API. Remove unused XML parsing logic, as the library never
252+
requests XML data.
253+
254+
Version 3.2.4
255+
-------------
256+
257+
Released on March 14, 2012
258+
259+
- If no version is passed to the Services_Twilio constructor, the library will
260+
default to the most recent API version.
261+

externals/twilio-php/LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (C) 2011, Twilio, Inc. <help at twilio dot com>
4+
Copyright (C) 2011, Neuman Vong <neuman at twilio dot com>
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of
7+
this software and associated documentation files (the "Software"), to deal in
8+
the Software without restriction, including without limitation the rights to
9+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10+
of the Software, and to permit persons to whom the Software is furnished to do
11+
so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

externals/twilio-php/Makefile

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Twilio API helper library.
2+
# See LICENSE file for copyright and license details.
3+
4+
define LICENSE
5+
<?php
6+
7+
/**
8+
* Twilio API helper library.
9+
*
10+
* @category Services
11+
* @package Services_Twilio
12+
* @author Neuman Vong <neuman@twilio.com>
13+
* @license http://creativecommons.org/licenses/MIT/ MIT
14+
* @link http://pear.php.net/package/Services_Twilio
15+
*/
16+
endef
17+
export LICENSE
18+
19+
COMPOSER = $(shell which composer)
20+
ifeq ($(strip $(COMPOSER)),)
21+
COMPOSER = php composer.phar
22+
endif
23+
24+
all: test
25+
26+
clean:
27+
@rm -rf dist venv
28+
29+
PHP_FILES = `find dist -name \*.php`
30+
dist: clean
31+
@mkdir dist
32+
@git archive master | (cd dist; tar xf -)
33+
@for php in $(PHP_FILES); do\
34+
echo "$$LICENSE" > $$php.new; \
35+
tail -n+2 $$php >> $$php.new; \
36+
mv $$php.new $$php; \
37+
done
38+
39+
test-install:
40+
# Composer: http://getcomposer.org/download/
41+
$(COMPOSER) install
42+
43+
install:
44+
pear channel-discover twilio.github.com/pear
45+
pear install twilio/Services_Twilio
46+
47+
# if these fail, you may need to install the helper library - run "make
48+
# test-install"
49+
test:
50+
@PATH=vendor/bin:$(PATH) phpunit --strict --colors --configuration tests/phpunit.xml;
51+
52+
venv:
53+
virtualenv venv
54+
55+
docs-install: venv
56+
. venv/bin/activate; pip install -r docs/requirements.txt
57+
58+
docs:
59+
. venv/bin/activate; cd docs && make html
60+
61+
release-install:
62+
pear channel-discover twilio.github.com/pear || true
63+
pear channel-discover pear.pirum-project.org || true
64+
pear install pirum/Pirum || true
65+
pear install XML_Serializer-0.20.2 || true
66+
pear install PEAR_PackageFileManager2 || true
67+
68+
authors:
69+
echo "Authors\n=======\n\nA huge thanks to all of our contributors:\n\n" > AUTHORS.md
70+
git log --raw | grep "^Author: " | cut -d ' ' -f2- | cut -d '<' -f1 | sed 's/^/- /' | sort | uniq >> AUTHORS.md
71+
72+
.PHONY: all clean dist test docs docs-install test-install authors

0 commit comments

Comments
 (0)