You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SWI-2787 Add Support for StartTranscription and StopTranscription (#154)
* SWI-2787 Add Support for `StartTranscription` and `StopTranscription` BXML
* Ignore 404s from GET Call in tests due to API Bug
* Update bandwidth/tests/test_api.py
Co-authored-by: Cameron Koegel <53310569+ckoegel@users.noreply.github.com>
---------
Co-authored-by: Cameron Koegel <53310569+ckoegel@users.noreply.github.com>
Representation of Bandwidth's StartTranscription BXML verb
5
+
6
+
@license MIT
7
+
"""
8
+
9
+
fromtypingimportList
10
+
11
+
fromlxmlimportetree
12
+
13
+
from .base_verbimportAbstractBxmlVerb
14
+
from .custom_paramimportCustomParam
15
+
16
+
START_TRANSCRIPTION_TAG="StartTranscription"
17
+
18
+
19
+
classStartTranscription(AbstractBxmlVerb):
20
+
21
+
def__init__(
22
+
self,
23
+
name: str=None,
24
+
tracks: str=None,
25
+
transcription_event_url: str=None,
26
+
transcription_event_method: str=None,
27
+
username: str=None,
28
+
password: str=None,
29
+
destination: str=None,
30
+
stabilized: bool=None,
31
+
custom_params: List[CustomParam] =None,
32
+
):
33
+
"""
34
+
Initializes the StartTranscription class
35
+
:param name: A name to refer to this transcription by. Used when sending <StopTranscription>. If not provided, it will default to the generated transcription id as sent in the Real-Time Transcription Started webhook.
36
+
:param tracks: The part of the call to send a transcription from. inbound, outbound or both. Default is inbound.
37
+
:param transcription_event_url: URL to send the associated Webhook events to during this real-time transcription's lifetime. Does not accept BXML. May be a relative URL.
38
+
:param transcription_event_method: The HTTP method to use for the request to transcriptionEventUrl. GET or POST. Default value is POST.
39
+
:param username: The username to send in the HTTP request to transcriptionEventUrl. If specified, the transcriptionEventUrl must be TLS-encrypted (i.e., https).
40
+
:param password: The password to send in the HTTP request to transcriptionEventUrl. If specified, the transcriptionEventUrl must be TLS-encrypted (i.e., https).
41
+
:param destination: A websocket URI to send the transcription to. A transcription of the specified tracks will be sent via websocket to this URL as a series of JSON messages. See below for more details on the websocket packet format.
42
+
:param stabilized: Whether to send transcription update events to the specified destination only after they have become stable. Requires destination. Defaults to true.
43
+
:param custom_params: These elements define optional user specified parameters that will be sent to the destination URL when the real-time transcription is first started.
Representation of Bandwidth's StartTranscription BXML verb
5
+
6
+
@license MIT
7
+
"""
8
+
9
+
fromlxmlimportetree
10
+
11
+
from .base_verbimportAbstractBxmlVerb
12
+
13
+
STOP_TRANSCRIPTION_TAG="StopTranscription"
14
+
15
+
16
+
classStopTranscription(AbstractBxmlVerb):
17
+
18
+
def__init__(
19
+
self,
20
+
name: str=None
21
+
):
22
+
"""
23
+
Initializes the StopTranscription class
24
+
:param name: The name of the real-time transcription to stop. This is either the user selected name when sending the <StartTranscription> verb, or the system generated name returned in the Real-Time Transcription Started webhook if <StartTranscription> was sent with no name attribute. If no name is specified, then all active call transcriptions will be stopped.
0 commit comments