-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathREADME.webrtc
200 lines (135 loc) · 5.79 KB
/
README.webrtc
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
SylkServer WebRTC gateway
-------------------------
The WebRTC gateway application enables web based clients to communicate
transparently with SIP endpoints using WebRTC suite of standards and
protocols.
To perform this function SylkServer must run on a computer with a public
reachable IP adddress.
A ready to go client is available, see Sylk WebRTC client for more
information.
Architecture
------------
+--------+ +---------+ +-------------+ +----------+
| | | | | Janus | RTP | SIP |
| WebRTC | SylkRTC | Sylk | | SFU +<----->| A/V |
| client +<-------->+ Server | | Server | | client |
| | WebAPI | webrtc | +-------------+ +----------+
+--------+ | gateway | SIP +----------+
+---->| app | <---------------------| SIP |
| | | <---+ | Message |
| +---------+ | | client |
| +---------------+-----+ MSRP +----------+
SIP | | Sylk MSRP switch |<------+ +----------+
| | Conference | | | SIP |
| | application |<--+ +---+ Chat |
| +---------------------+ | | client |
+--------+ | +---------------------+ | MUC +----------+
| XMPP | +-----| Sylk XMPP |---+ +----------+
| chat | XMPP | Server 2 Server | SIP | SIP |
| client |--------->| gateway application |---------->| Message |
+--------+ +---------------------+ +----------+
End-point requirements
----------------------
WebRTC gateway doesn't do media transcoding, so after taking care of the
WebRTC-specific media features (ICE and DTLS mainly), endpoints will
exchange plain RTP media between them, therefore SIP end-points must have a
set of compatible audio (Opus) and video codecs (H.264 and VP8).
As a WebRTC client, a standard browser with WebRTC support can be used
(e.g. Firefox or Google Chrome).
Features
--------
* SIP account registration
* One-to-One Audio / video calling between SIP and Web clients
* Multi-party conferencing (WebRTC end-points only)
* One-to-one messaging between end-points
* Real time message synchronization between multiple devices
* Offline storage for messaging
* Codec agnostic
SylkRTC API
-----------
Desktop API
A JavaScript library implementing SylkRTC API is available at:
https://github.com/AGProjects/sylkrtc.js
Mobile API
A React native API is available at:
https://github.com/AGProjects/react-native-sylkrtc.js
SIP Proxy
---------
A SIP Proxy is required for one-to-one calls and messages.
A guide for setting up a SIP Proxy is available here:
https://sylkserver.com/download/#sip-proxy-setup
To benefit of offline messaging functions, the SIP Proxy must fork all SIP
Messages to SylkServer.
SIP Messaging
-------------
External SIP devices can be synchronized in real time with webrtc end-points.
The devices can poll a web server resource served by SylkServer web server
component. The web server will return a journal with all messages and
operations related to them since the timestamp of a given message id.
Authorization is performed by the means of a token generated by SylkServer
for each SIP client. To request an authorization token and the
correspondent web server address, a SIP device must send via the trusted SIP
Proxy, a SIP Message with the Content Type application/sylk-api-token to
SylkServer. A message will be returned back with the token and URL, that
can be stored and used for future requests.
Several operations are available like, message deletion, delivery and
display information.
See Blink SIP client implementation as an example:
https://github.com/AGProjects/blink-cocoa/blob/master/SMSWindowManager.py
Janus
-----
For implementing WebRTC capabilities, SylkServer uses an external component
called Janus.
https://github.com/meetecho/janus-gateway
Janus can be installed by following the instructions on its README file:
https://github.com/meetecho/janus-gateway/blob/master/README.md
The only requirement is that Janus is compiled with WebSocket supports,
since that's the transport SylkServer uses in order to communicate with
Janus.
To configure janus the following settings are relevant for WebRTC gateway
(read their description in the janus configuration files):
1. janus.cfg
[general]
api_secret = some_secret_key_shared_with_sylkserver
;debug_level = 5
[nat]
ice_lite = true
ice_tcp = true
;ice_enforce_list = ip_or_interface
;ice_ignore_list = vmnet
[media]
force-bundle = true
force-rtcp-mux = true
[plugins]
disable = libjanus_voicemail.so,libjanus_recordplay.so,libjanus_streaming.so,libjanus_echotest.so,libjanus_videocall.so,libjanus_textroom.so
[transports]
disable = libjanus_http.so,libjanus_rabbitmq.so,libjanus_pfunix.so
2. janus.plugin.sip.cfg
[general]
;local_ip = ip_for_sip
keepalive_interval = 0
user_agent = SylkServer (WebRTC gateway)
register_ttl = 600
;rtp_port_range = 20000-40000
3. janus.plugin.videoroom.cfg
; comment out the rooms defined in this file to prevent janus from
; creating some static rooms (having an empty file for it is fine)
4. janus.transport.websockets.cfg
[general]
ws = yes
ws_interface = lo
ws_port = 8188
wss = no
[admin]
admin_ws = no
Running
-------
After installing SylkServer with WebRTC capability, start the server and
point your web browser to:
https://hostname:10888/webrtcgateway/
It's recommended to change the API secret used between SylkServer and Janus,
check the webrtcgateway.ini and janus.cfg configuration files.
Configuration
-------------
See webrtcgateway.ini.sample sample file for available options and their
meaning.