2
2
Make sure to check out the TwiML overview and tutorial
3
3
"""
4
4
import xml .etree .ElementTree as ET
5
- from six import iteritems
6
5
7
6
8
7
class TwimlException (Exception ):
@@ -240,13 +239,16 @@ def __init__(self, text, **kwargs):
240
239
class Play (Verb ):
241
240
"""Play DTMF digits or audio from a URL.
242
241
243
- :param str url: point to af audio file. The MIME type on the file must be
244
- set correctly. Either `url` or `digits` must be specified.
242
+ :param str url: point to an audio file. The MIME type on the file must be
243
+ set correctly. At least one of `url` and `digits` must be
244
+ specified. If both are given, the digits will play prior
245
+ to the audio from the URL.
245
246
246
247
:param str digits: a string of digits to play. To pause before playing
247
248
digits, use leading 'w' characters. Each 'w' will cause
248
249
Twilio to wait 0.5 seconds instead of playing a digit.
249
- Either `url` or `digits` must be specified.
250
+ At least one of `url` and `digits` must be specified.
251
+ If both are given, the digits will play first.
250
252
251
253
:param int loop: specifies how many times you'd like the text repeated.
252
254
Specifying '0' will cause the the :class:`Play` verb to loop
@@ -257,8 +259,6 @@ def __init__(self, url=None, digits=None, **kwargs):
257
259
raise TwimlException (
258
260
"Please specify either a url or digits to play." ,
259
261
)
260
- if url is not None and digits is not None :
261
- raise TwimlException ("Please specify only one of: (url, digits)." )
262
262
263
263
if digits is not None :
264
264
kwargs ['digits' ] = digits
0 commit comments