@@ -367,20 +367,20 @@ class Dial(Verb):
367
367
368
368
:param action: submit the result of the dial to this URL
369
369
:param method: submit to 'action' url using GET or POST
370
- :param int timeout: The number of seconds to waits for the called
370
+ :param int timeout: The number of seconds to waits for the called
371
371
party to answer the call
372
- :param bool hangupOnStar: Allow the calling party to hang up on the
372
+ :param bool hangupOnStar: Allow the calling party to hang up on the
373
373
called party by pressing the '*' key
374
374
:param int timeLimit: The maximum duration of the Call in seconds
375
375
:param callerId: The caller ID that will appear to the called party
376
376
:param bool record: Record both legs of a call within this <Dial>
377
377
"""
378
378
GET = 'GET'
379
379
POST = 'POST'
380
- nestables = ['Number' , 'Conference' , 'Client' ]
380
+ nestables = ['Number' , 'Conference' , 'Client' , 'Queue' ]
381
381
382
382
def __init__ (self , number = None , ** kwargs ):
383
- super (Dial , self ).__init__ (** kwargs )
383
+ super (Dial , self ).__init__ (** kwargs )
384
384
if number and len (number .split (',' )) > 1 :
385
385
for n in number .split (',' ):
386
386
self .append (Number (n .strip ()))
@@ -396,13 +396,32 @@ def number(self, number, **kwargs):
396
396
def conference (self , name , ** kwargs ):
397
397
return self .append (Conference (name , ** kwargs ))
398
398
399
+ def queue (self , name , ** kwargs ):
400
+ return self .append (Queue (name , ** kwargs ))
401
+
399
402
def addNumber (self , * args , ** kwargs ):
400
403
return self .number (* args , ** kwargs )
401
404
402
405
def addConference (self , * args , ** kwargs ):
403
406
return self .conference (* args , ** kwargs )
404
407
405
408
409
+ class Queue (Verb ):
410
+ """Specify queue in a nested Dial element.
411
+
412
+ :param name: friendly name for the queue
413
+ :param url: url to a twiml document that executes after a call is dequeued
414
+ and
8047
before the call is connected
415
+ :param method: HTTP method for url GET/POST
416
+ """
417
+ GET = 'GET'
418
+ POST = 'POST'
419
+
420
+ def __init__ (self , name , ** kwargs ):
421
+ super (Queue , self ).__init__ (** kwargs )
422
+ self .body = name
423
+
424
+
406
425
class Record (Verb ):
407
426
"""Record audio from caller
408
427
0 commit comments