diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d4de9c1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (C) 2012, TelTech Systems, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index a34088d..a568dc2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +**PLEASE NOTE THAT THIS LIBRARY IS NOT ACTIVELY MAINTAINED BY TELAPI** + telapi-python ============= diff --git a/telapi/__init__.py b/telapi/__init__.py index f2df2ef..35ad414 100644 --- a/telapi/__init__.py +++ b/telapi/__init__.py @@ -1,2 +1,2 @@ __all__ = ['rest', 'inboundxml', 'utils', 'schema'] -VERSION = '0.2.3' +VERSION = '0.2.5.2' diff --git a/telapi/data/telapi.json b/telapi/data/telapi.json index 8dc24ca..42f6954 100644 --- a/telapi/data/telapi.json +++ b/telapi/data/telapi.json @@ -229,7 +229,7 @@ "url": "Url", "method" : "Method", "timeout" : "Timeout", - "send_digits" : "SendDigits", + "send_digits" : "PlayDtmf", "status_callback" : "StatusCallback", "status_callback_method" : "StatusCallbackMethod", "fallback_url" : "FallbackUrl", @@ -409,7 +409,13 @@ "update_params": { "voice_url": "VoiceUrl", "voice_url": "VoiceUrl" - } + }, + "filter_params": [ + "Contains", + "AreaCode", + "InRegion", + "InPostalCode" + ] }, "available_phone_numbers": { "name": "AvailablePhoneNumber", @@ -610,7 +616,7 @@ "Ping", "PlayLastRecording" ], - "docs_url": "http: //www.telapi.com/docs/api/inboundxml/voice/response/", + "docs_url": "http://www.telapi.com/docs/api/inboundxml/voice/response/", "blank": false }, "Say": { @@ -620,7 +626,7 @@ "language" ], "nesting": [], - "docs_url": "http: //www.telapi.com/docs/api/inboundxml/voice/say/", + "docs_url": "http://www.telapi.com/docs/api/inboundxml/voice/say/", "blank": false }, "Play": { @@ -628,7 +634,7 @@ "loop" ], "nesting": [], - "docs_url": "http: //www.telapi.com/docs/api/inboundxml/voice/play/", + "docs_url": "http://www.telapi.com/docs/api/inboundxml/voice/play/", "blank": false }, "Gather": { @@ -644,7 +650,7 @@ "Play", "Pause" ], - "docs_url": "http: //www.telapi.com/docs/api/inboundxml/voice/gather/", + "docs_url": "http://www.telapi.com/docs/api/inboundxml/voice/gather/", "blank": true }, "Record": { @@ -662,7 +668,7 @@ "fileFormat" ], "nesting": [], - "docs_url": "http: //www.telapi.com/docs/api/inboundxml/voice/record/", + "docs_url": "http://www.telapi.com/docs/api/inboundxml/voice/record/", "blank": true }, "Dial": { @@ -693,7 +699,7 @@ "Conference", "Sip" ], - "docs_url": "http: //www.telapi.com/docs/api/inboundxml/voice/dial/", + "docs_url": "http://www.telapi.com/docs/api/inboundxml/voice/dial/", "blank": false }, "Number": { @@ -703,7 +709,7 @@ "url" ], "nesting": [], - "docs_url": "http: //www.telapi.com/docs/api/inboundxml/voice/dial/number/", + "docs_url": "http://www.telapi.com/docs/api/inboundxml/voice/dial/number/", "blank": false }, "Conference": { @@ -723,7 +729,7 @@ "stayAlone" ], "nesting": [], - "docs_url": "http: //www.telapi.com/docs/api/inboundxml/voice/dial/conference/", + "docs_url": "http://www.telapi.com/docs/api/inboundxml/voice/dial/conference/", "blank": false }, "Sip": { @@ -732,7 +738,7 @@ "method" ], "nesting": [], - "docs_url": "http: //www.telapi.com/docs/api/inboundxml/voice/dial/sip/", + "docs_url": "http://www.telapi.com/docs/api/inboundxml/voice/dial/sip/", "blank": false }, "Hangup": { @@ -740,7 +746,7 @@ "schedule" ], "nesting": [], - "docs_url": "http: //www.telapi.com/docs/api/inboundxml/voice/hangup/", + "docs_url": "http://www.telapi.com/docs/api/inboundxml/voice/hangup/", "blank": false }, "Redirect": { @@ -748,7 +754,7 @@ "method" ], "nesting": [], - "docs_url": "http: //www.telapi.com/docs/api/inboundxml/voice/redirect/", + "docs_url": "http://www.telapi.com/docs/api/inboundxml/voice/redirect/", "blank": true }, "Reject": { @@ -756,7 +762,7 @@ "reason" ], "nesting": [], - "docs_url": "http: //www.telapi.com/docs/api/inboundxml/voice/reject/", + "docs_url": "http://www.telapi.com/docs/api/inboundxml/voice/reject/", "blank": true }, "Pause": { @@ -764,7 +770,7 @@ "length" ], "nesting": [], - "docs_url": "http: //www.telapi.com/docs/api/inboundxml/voice/pause/", + "docs_url": "http://www.telapi.com/docs/api/inboundxml/voice/pause/", "blank": true }, "Sms": { @@ -777,7 +783,7 @@ "statusCallbackMethod" ], "nesting": [], - "docs_url": "http: //www.telapi.com/docs/api/inboundxml/sms/sms/", + "docs_url": "http://www.telapi.com/docs/api/inboundxml/sms/sms/", "blank": false }, "Ping": { @@ -785,13 +791,13 @@ "method" ], "nesting": [], - "docs_url": "http: //www.telapi.com/docs/api/inboundxml/voice/ping/", + "docs_url": "http://www.telapi.com/docs/api/inboundxml/voice/ping/", "blank": false }, "PlayLastRecording": { "attributes": [], "nesting": [], - "docs_url": "http: //www.telapi.com/docs/api/inboundxml/voice/playlastrecording/", + "docs_url": "http://www.telapi.com/docs/api/inboundxml/voice/playlastrecording/", "blank": true } } diff --git a/telapi/inboundxml/__init__.py b/telapi/inboundxml/__init__.py index 9076e26..dee6775 100644 --- a/telapi/inboundxml/__init__.py +++ b/telapi/inboundxml/__init__.py @@ -2,6 +2,7 @@ from new import classobj from telapi.schema import SCHEMA + class Element(object): """Root XML element. Also, base class for all other InboundXML elements""" @@ -18,7 +19,7 @@ def __init__(self, *args, **kwargs): self._children = [] for i, arg in enumerate(args): - if i == 0 and isinstance(arg, str): + if i == 0 and isinstance(arg, basestring): self._body = arg elif isinstance(arg, Element): self._children.append(arg) @@ -31,7 +32,7 @@ def __str__(self): def __unicode__(self): attribute_string = '' - body_string = ''.join([unicode(child) for child in self._children]) or self._body + body_string = ''.join([unicode(child) for child in self._children]) or escape(unicode(self._body)) if not self._allow_blank and not body_string.strip(): raise ValueError('The "%s" element cannot be blank!' %