Skip to content

Commit 9c5bbb6

Browse files
committed
Deploy
1 parent a6396e3 commit 9c5bbb6

27 files changed

+1118
-247
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The package is compatible with Python versions ```2 >=2.7.9``` and ```3 >=3.4```
88
Install the package from PyPi using the following pip command:
99

1010
```python
11-
pip install bandwidth-sdk==5.1.1
11+
pip install bandwidth-sdk==5.2.0
1212
```
1313

1414
You can also view the package at:

bandwidth/voice/bxml/verbs/record.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
class Record(AbstractBxmlVerb):
1717

1818
def __init__(self, tag=None, username=None, password=None, record_complete_url=None, record_complete_method=None,
19-
recording_available_url=None, recording_available_method=None, terminating_digits=None, max_duration=None, file_format=None):
19+
recording_available_url=None, recording_available_method=None, terminating_digits=None, max_duration=None,
20+
file_format=None, transcribe=None, transcription_available_url=None, transcription_available_method=None):
2021
"""
2122
Initializes the Record class with the following parameters
2223
@@ -30,6 +31,9 @@ def __init__(self, tag=None, username=None, password=None, record_complete_url=N
3031
:param str terminating_digits: Digits to terminate the recording
3132
:param int max_duration: Max duration to record in seconds
3233
:param str file_format: The file format to save the recording in
34+
:param bool transcribe: True to transcribe the recording on completion, False otherwise
35+
:param str transcription_available_url: URL to send the transcriptionAvailable event to.
36+
:param str transcription_available_method: The HTTP method to use for the request to transcriptionAvailableUrl. GET or POST
3337
"""
3438
self.tag = tag
3539
self.username = username
@@ -41,6 +45,9 @@ def __init__(self, tag=None, username=None, password=None, record_complete_url=N
4145
self.terminating_digits = terminating_digits
4246
self.max_duration = max_duration
4347
self.file_format = file_format
48+
self.transcribe = transcribe
49+
self.transcription_available_url = transcription_available_url
50+
self.transcription_available_method = transcription_available_method
4451

4552
def to_bxml(self):
4653
root = etree.Element(RECORD_TAG)
@@ -64,4 +71,12 @@ def to_bxml(self):
6471
root.set("maxDuration", str(self.max_duration))
6572
if self.file_format is not None:
6673
root.set("fileFormat", self.file_format)
74+
if self.transcribe is not None:
75+
#Convert True to "true", or False to "false"
76+
strn = "true" if self.transcribe else "false"
77+
root.set("transcribe", strn)
78+
if self.transcription_available_url is not None:
79+
root.set("transcriptionAvailableUrl", self.transcription_available_url)
80+
if self.transcription_available_method is not None:
81+
root.set("transcriptionAvailableMethod", self.transcription_available_method)
6782
return etree.tostring(root).decode()

bandwidth/voice/bxml/verbs/start_recording.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class StartRecording(AbstractBxmlVerb):
1717

1818
def __init__(self, tag=None, username=None, password=None, recording_available_url=None, recording_available_method=None,
19-
file_format=None, multi_channel=None):
19+
file_format=None, multi_channel=None, transcribe=None, transcription_available_url=None, transcription_available_method=None):
2020
"""
2121
Initializes the Record class with the following parameters
2222
@@ -27,6 +27,9 @@ def __init__(self, tag=None, username=None, password=None, recording_available_u
2727
:param str recording_available_method: HTTP method for record available callback
2828
:param str file_format: The file format to save the recording in
2929
:param bool multi_channel: Whether or not to record the channels separately (default is false, 1 recording)
30+
:param bool transcribe: True to transcribe the recording on completion, False otherwise
31+
:param str transcription_available_url: URL to send the transcriptionAvailable event to.
32+
:param str transcription_available_method: The HTTP method to use for the request to transcriptionAvailableUrl. GET or POST
3033
"""
3134
self.tag = tag
3235
self.username = username
@@ -35,6 +38,9 @@ def __init__(self, tag=None, username=None, password=None, recording_available_u
3538
self.recording_available_method = recording_available_method
3639
self.file_format = file_format
3740
self.multi_channel = multi_channel
41+
self.transcribe = transcribe
42+
self.transcription_available_url = transcription_available_url
43+
self.transcription_available_method = transcription_available_method
3844

3945
def to_bxml(self):
4046
root = etree.Element(START_RECORDING_TAG)
@@ -54,4 +60,12 @@ def to_bxml(self):
5460
#Convert True to "true", or False to "false"
5561
strn = "true" if self.multi_channel else "false"
5662
root.set("multiChannel", strn)
63+
if self.transcribe is not None:
64+
#Convert True to "true", or False to "false"
65+
strn = "true" if self.transcribe else "false"
66+
root.set("transcribe", strn)
67+
if self.transcription_available_url is not None:
68+
root.set("transcriptionAvailableUrl", self.transcription_available_url)
69+
if self.transcription_available_method is not None:
70+
root.set("transcriptionAvailableMethod", self.transcription_available_method)
5771
return etree.tostring(root).decode()

0 commit comments

Comments
 (0)