23
23
OTHER DEALINGS IN THE SOFTWARE.
24
24
"""
25
25
26
- __VERSION__ = "2.0.0 "
26
+ __VERSION__ = "2.0.1 "
27
27
28
28
import urllib , urllib2 , base64 , hmac
29
29
from hashlib import sha1
@@ -322,12 +322,36 @@ def __init__(self, action=None, method=None, numDigits=None, timeout=None,
322
322
class Number (Verb ):
323
323
"""Specify phone number in a nested Dial element.
324
324
325
+ number: phone number to dial
325
326
sendDigits: key to press after connecting to the number
326
327
"""
327
328
def __init__ (self , number , sendDigits = None , ** kwargs ):
328
329
Verb .__init__ (self , sendDigits = sendDigits , ** kwargs )
329
330
self .body = number
330
331
332
+ class Conference (Verb ):
333
+ """Specify conference in a nested Dial element.
334
+
335
+ name: friendly name of conference
336
+ muted: keep this participant muted (bool)
337
+ beep: play a beep when this participant enters/leaves (bool)
338
+ startConferenceOnEnter: start conf when this participants joins (bool)
339
+ endConferenceOnExit: end conf when this participants leaves (bool)
340
+ waitUrl: TwiML url that executes before conference starts
341
+ waitMethod: HTTP method for waitUrl GET/POST
342
+ """
343
+ GET = 'GET'
344
+ POST = 'POST'
345
+
346
+ def __init__ (self , name , muted = None , beep = None ,
347
+ startConferenceOnEnter = None , endConferenceOnExit = None , waitUrl = None ,
348
+ waitMethod = None , ** kwargs ):
349
+ Verb .__init__ (self , muted = muted , beep = beep , ** kwargs )
350
+ if waitMethod and (waitMethod != self .GET and waitMethod != self .POST ):
351
+ raise TwilioException ( \
352
+ "Invalid waitMethod parameter, must be GET or POST" )
353
+ self .body = name
354
+
331
355
class Dial (Verb ):
332
356
"""Dial another phone number and connect it to this call
333
357
@@ -339,7 +363,7 @@ class Dial(Verb):
339
363
340
364
def __init__ (self , number = None , action = None , method = None , ** kwargs ):
341
365
Verb .__init__ (self , action = action , method = method , ** kwargs )
342
- self .nestables = ['Number' ]
366
+ self .nestables = ['Number' , 'Conference' ]
343
367
if number and len (number .split (',' )) > 1 :
344
368
for n in number .split (',' ):
345
369
self .append (Number (n .strip ()))
0 commit comments