File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -334,12 +334,13 @@ def test_bridge(self):
334334
335335 def test_ring (self ):
336336 ring = Ring (
337- duration = 5
337+ duration = 5 ,
338+ answer_call = False
338339 )
339340
340341 response = Response ()
341342 response .add_verb (ring )
342- expected_bxml = '<?xml version="1.0" encoding="UTF-8"?><Response><Ring duration="5"/></Response>'
343+ expected_bxml = '<?xml version="1.0" encoding="UTF-8"?><Response><Ring duration="5" answerCall="False" /></Response>'
343344 assert (response .to_bxml () == expected_bxml )
344345
345346 def test_start_gather (self ):
Original file line number Diff line number Diff line change 1515
1616class Ring (AbstractBxmlVerb ):
1717
18- def __init__ (self , duration ):
18+ def __init__ (self , duration = None , answer_call = None ):
1919 """
2020 Initializes the Ring class with the duration parameter
2121
2222 :param float duration: The time in seconds to ring
23+ :param boolean answer_call: Whether or not to accept the incoming call while playing the ring
2324 """
2425 self .duration = duration
26+ self .answer_call = answer_call
2527
2628 def to_bxml (self ):
2729 root = etree .Element (RING_TAG )
2830 if self .duration is not None :
2931 root .set ("duration" , str (self .duration ))
32+ if self .answer_call is not None :
33+ root .set ("answerCall" , str (self .answer_call ))
3034 return etree .tostring (root ).decode ()
You can’t perform that action at this time.
0 commit comments