-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathStartStream.java
More file actions
125 lines (106 loc) · 4.94 KB
/
StartStream.java
File metadata and controls
125 lines (106 loc) · 4.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/**
* The {@code <StartStream>} verb allows a segment of a call to be sent off to another destination for additional processing.
*/
package com.bandwidth.sdk.model.bxml;
import static com.bandwidth.sdk.model.bxml.utils.BxmlConstants.DEFAULT_CALLBACK_METHOD;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlElements;
import jakarta.xml.bind.annotation.XmlType;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Builder.Default;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = StartStream.TYPE_NAME)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Getter
@EqualsAndHashCode
/**
*
* @param name (str, optional): A name to refer to this stream by.
* Used when sending <StopStream>. If not provided, it
* will default to the generated stream id as sent in
* the Media Stream Started webhook.
* @param mode (str, optional): The mode to use for the stream.
* unidirectional or bidirectional. Specifies whether
* the audio being streamed over the WebSocket is
* bidirectional (the service can both read and write
* audio over the WebSocket) or unidirectional
* (one-way, read-only). Default is unidirectional.
* @param tracks (str, optional): The part of the call to send a
* stream from. inbound, outbound or both. Default is
* inbound.
* @param destination (str, optional): A websocket URI to send the stream
* to. The audio from the specified tracks will be sent
* via websocket to this URL as base64-encoded
* PCMU/G711 audio. See below for more details on the
* websocket packet format.
* @param destinationUsername (str, optional): The username to send in the
* `Authorization` header of the initial websocket
* connection to the `destination` URL.
* @param destinationPassword (str, optional): The password to send in the
* `Authorization` header of the initial websocket
* connection to the `destination` URL.
* @param streamEventUrl (str, optional): URL to send the associated Webhook
* events to during this stream's lifetime. Does not
* accept BXML. May be a relative URL.
* @param streamEventMethod (str, optional): The HTTP method to use for the
* request to streamEventUrl. GET or POST. Default
* value is POST.
* @param username (str, optional): The username to send in the HTTP
* request to streamEventUrl. If specified, the URLs
* must be TLS-encrypted (i.e., https).
* @param password (str, optional): The password to send in the HTTP
* request to streamEventUrl. If specified, the URLs
* must be TLS-encrypted (i.e., https).
*
* Nested Verbs:
* @param StreamParam: (optional) You may specify up to 12 <StreamParam/>
* elements nested within a <StartStream> tag.
* These elements define optional user specified
* parameters that will be sent to the destination URL
* when the stream is first started.
*
*/
public class StartStream implements Verb {
public static final String TYPE_NAME = "StartStream";
@XmlAttribute
protected String name;
@XmlAttribute
protected String mode;
@XmlAttribute
@Default
protected TracksEnum tracks = TracksEnum.inbound;
@XmlAttribute
protected String destination;
@XmlAttribute
protected String destinationUsername;
@XmlAttribute
protected String destinationPassword;
@XmlAttribute
@Getter
protected String streamEventUrl;
@XmlAttribute
@Default
protected String streamEventMethod = DEFAULT_CALLBACK_METHOD;
@XmlAttribute
protected String username;
@XmlAttribute
protected String password;
@XmlElements({
@XmlElement(name = StreamParam.TYPE_NAME, type = StreamParam.class)
})
protected List<StreamParam> streamParams;
@Override
public String getVerbName() {
return TYPE_NAME;
}
}