forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sipml.d.ts
150 lines (117 loc) · 4.32 KB
/
sipml.d.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
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
// Type definitions for SIPml5
// Project: http://sipml5.org/
// Definitions by: A. Groenenboom <https://github.com/chookies>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module SIPml {
class Event {
public description: string;
public type: string;
public getContent(): Object;
public getContentString(): string;
public getContentType(): Object;
public getSipResponseCode(): number;
}
class EventTarget {
public addEventListener(type: any, listener: Function): void;
public removeEventListener(type: any): void;
}
class Session extends EventTarget {
public accept(configuration?: Session.Configuration): number;
public getId(): number;
public getRemoteFriendlyName(): string;
public getRemoteUri(): string;
public reject(configuration?: Session.Configuration): number;
public setConfiguration(configuration?: Session.Configuration): void;
}
export module Session {
interface Configuration {
audio_remote?: HTMLElement;
bandwidth?: Object;
expires?: number;
from?: string;
sip_caps?: Object[];
sip_headers?: Object[];
video_local?: HTMLElement;
video_remote?: HTMLElement;
video_size?: Object;
}
class Call extends Session {
public acceptTransfer(configuration?: Session.Configuration): number;
public call(to: string, configuration?: Session.Configuration): number;
public dtmf(): number;
public hangup(configuration?: Session.Configuration): number;
public hold(configuration?: Session.Configuration): number;
public info(): number;
public rejectTransfer(): number;
public resume(): number;
public transfer(): number;
}
class Event extends SIPml.Event {
public session: Session;
public getTransferDestinationFriendlyName(): string;
}
class Message extends Session {
public send(to: string, content?: any, contentType?: string, configuration?: Session.Configuration): number;
}
class Publish extends Session {
public publish(content?: any, contentType?: string, configuration?: Session.Configuration): number;
public unpublish(configuration?: Session.Configuration): void;
}
class Registration extends Session {
public register(configuration?: Session.Configuration): void;
public unregister(configuration?: Session.Configuration): void;
}
class Subscribe extends Session {
public subscribe(to: string, configuration?: Session.Configuration): number;
public unsubscribe(configuration?: Session.Configuration): number;
}
}
class Stack extends EventTarget {
public constructor(configuration?: Stack.Configuration);
public setConfiguration(configuration: Stack.Configuration): number;
public newSession(type: string, configuration?: Session.Configuration): any;
public start(): number;
public stop(timeout?: number): number;
}
export module Stack {
interface Configuration {
bandwidth?: Object;
display_name?: string;
enable_click2call?: boolean;
enable_early_ims?: boolean;
enable_media_stream_cache?: boolean;
enable_rtcweb_breaker?: boolean;
events_listener?: Object;
ice_servers?: Object[];
impi?: string;
impu?: string;
outbound_proxy_url?: string;
password?: string;
realm?: string;
sip_headers?: Object[];
video_size?: Object;
websocket_proxy_url?: string;
}
class Event extends SIPml.Event {
public description: string;
public newSession: Session;
public type: string;
}
}
function getNavigatorFriendlyName(): string;
function getNavigatorVersion(): string;
function getSystemFriendlyName(): string;
function getWebRtc4AllVersion(): string;
function haveMediaStream(): boolean;
function init(readyCallback?: (e:any) => any, errorCallback?: (e:any) => any): boolean;
function isInitialized(): boolean;
function isNavigatorOutdated(): boolean;
function isReady(): boolean;
function isScreenShareSupported(): boolean;
function isWebRtcPluginOutdated(): boolean;
function isWebRtc4AllSupported(): boolean;
function isWebRtcSupported(): boolean;
function isWebSocketSupported(): boolean;
function setDebugLevel(level: string): void;
function setWebRtcType(type: string): boolean;
}