forked from legastero/stanza
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxep0320.ts
55 lines (50 loc) · 1.45 KB
/
xep0320.ts
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
// ====================================================================
// XEP-0320: Use of DTLS-SRTP in Jingle Sessions
// --------------------------------------------------------------------
// Source: https://xmpp.org/extensions/xep-0320.html
// Version: 0.3.1 (2015-10-15)
// ====================================================================
import { attribute, DefinitionOptions, text } from '../jxt';
import {
NS_JINGLE_DTLS_0,
NS_JINGLE_ICE_0,
NS_JINGLE_ICE_UDP_1,
NS_JINGLE_RTP_1
} from '../Namespaces';
export interface JingleDtlsFingerprint {
algorithm?: string;
setup?: string;
value?: string;
}
declare module './xep0176' {
export interface JingleIce {
fingerprints?: JingleDtlsFingerprint[];
}
}
const Protocol: DefinitionOptions = {
aliases: [
{
multiple: true,
path: 'iq.jingle.contents.transport.fingerprints',
selector: NS_JINGLE_ICE_UDP_1
},
{
multiple: true,
path: 'iq.jingle.contents.transport.fingerprints',
selector: NS_JINGLE_ICE_0
},
{
multiple: true,
path: 'iq.jingle.contents.application.encryption.dtls',
selector: NS_JINGLE_RTP_1
}
],
element: 'fingerprint',
fields: {
algorithm: attribute('hash'),
setup: attribute('setup'),
value: text()
},
namespace: NS_JINGLE_DTLS_0
};
export default Protocol;