-
Notifications
You must be signed in to change notification settings - Fork 704
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/*! | ||
* | ||
* SIP version 0.20.0 | ||
* Copyright (c) 2014-2021 Junction Networks, Inc <http://www.onsip.com> | ||
* Homepage: https://sipjs.com | ||
* License: https://sipjs.com/license/ | ||
* | ||
* | ||
* ~~~SIP.js contains substantial portions of JsSIP under the following license~~~ | ||
* Homepage: http://jssip.net | ||
* Copyright (c) 2012-2013 José Luis Millán - Versatica <http://www.versatica.com> | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
* a copy of this software and associated documentation files (the | ||
* "Software"), to deal in the Software without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, | ||
* distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
* ~~~ end JsSIP license ~~~ | ||
* | ||
* | ||
* | ||
* | ||
*/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { IncomingRequestMessage, IncomingAckRequest } from "../core"; | ||
/** | ||
* A request to confirm a {@link Session} (incoming ACK). | ||
* @public | ||
*/ | ||
export declare class Ack { | ||
private incomingAckRequest; | ||
/** @internal */ | ||
constructor(incomingAckRequest: IncomingAckRequest); | ||
/** Incoming ACK request message. */ | ||
get request(): IncomingRequestMessage; | ||
} | ||
//# sourceMappingURL=ack.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* A request to confirm a {@link Session} (incoming ACK). | ||
* @public | ||
*/ | ||
export class Ack { | ||
/** @internal */ | ||
constructor(incomingAckRequest) { | ||
this.incomingAckRequest = incomingAckRequest; | ||
} | ||
/** Incoming ACK request message. */ | ||
get request() { | ||
return this.incomingAckRequest.message; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { IncomingByeRequest, IncomingRequestMessage, ResponseOptions } from "../core"; | ||
/** | ||
* A request to end a {@link Session} (incoming BYE). | ||
* @public | ||
*/ | ||
export declare class Bye { | ||
private incomingByeRequest; | ||
/** @internal */ | ||
constructor(incomingByeRequest: IncomingByeRequest); | ||
/** Incoming BYE request message. */ | ||
get request(): IncomingRequestMessage; | ||
/** Accept the request. */ | ||
accept(options?: ResponseOptions): Promise<void>; | ||
/** Reject the request. */ | ||
reject(options?: ResponseOptions): Promise<void>; | ||
} | ||
//# sourceMappingURL=bye.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* A request to end a {@link Session} (incoming BYE). | ||
* @public | ||
*/ | ||
export class Bye { | ||
/** @internal */ | ||
constructor(incomingByeRequest) { | ||
this.incomingByeRequest = incomingByeRequest; | ||
} | ||
/** Incoming BYE request message. */ | ||
get request() { | ||
return this.incomingByeRequest.message; | ||
} | ||
/** Accept the request. */ | ||
accept(options) { | ||
this.incomingByeRequest.accept(options); | ||
return Promise.resolve(); | ||
} | ||
/** Reject the request. */ | ||
reject(options) { | ||
this.incomingByeRequest.reject(options); | ||
return Promise.resolve(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { IncomingInfoRequest } from "../core"; | ||
import { Info } from "./info"; | ||
/** | ||
* A DTMF signal (incoming INFO). | ||
* @deprecated Use `Info`. | ||
* @internal | ||
*/ | ||
export declare class DTMF extends Info { | ||
private _tone; | ||
private _duration; | ||
/** @internal */ | ||
constructor(incomingInfoRequest: IncomingInfoRequest, tone: string, duration: number); | ||
get tone(): string; | ||
get duration(): number; | ||
} | ||
//# sourceMappingURL=dtmf.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Info } from "./info"; | ||
/** | ||
* A DTMF signal (incoming INFO). | ||
* @deprecated Use `Info`. | ||
* @internal | ||
*/ | ||
export class DTMF extends Info { | ||
/** @internal */ | ||
constructor(incomingInfoRequest, tone, duration) { | ||
super(incomingInfoRequest); | ||
this._tone = tone; | ||
this._duration = duration; | ||
} | ||
get tone() { | ||
return this._tone; | ||
} | ||
get duration() { | ||
return this._duration; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/** | ||
* Generic observable. | ||
* @public | ||
*/ | ||
export interface Emitter<T> { | ||
/** | ||
* Sets up a function that will be called whenever the target changes. | ||
* @param listener - Callback function. | ||
* @param options - An options object that specifies characteristics about the listener. | ||
* If once true, indicates that the listener should be invoked at most once after being added. | ||
* If once true, the listener would be automatically removed when invoked. | ||
*/ | ||
addListener(listener: (data: T) => void, options?: { | ||
once?: boolean; | ||
}): void; | ||
/** | ||
* Removes from the listener previously registered with addListener. | ||
* @param listener - Callback function. | ||
*/ | ||
removeListener(listener: (data: T) => void): void; | ||
/** | ||
* Registers a listener. | ||
* @param listener - Callback function. | ||
* @deprecated Use addListener. | ||
*/ | ||
on(listener: (data: T) => void): void; | ||
/** | ||
* Unregisters a listener. | ||
* @param listener - Callback function. | ||
* @deprecated Use removeListener. | ||
*/ | ||
off(listener: (data: T) => void): void; | ||
/** | ||
* Registers a listener then unregisters the listener after one event emission. | ||
* @param listener - Callback function. | ||
* @deprecated Use addListener. | ||
*/ | ||
once(listener: (data: T) => void): void; | ||
} | ||
/** | ||
* An {@link Emitter} implementation. | ||
* @internal | ||
*/ | ||
export declare class EmitterImpl<T> implements Emitter<T> { | ||
private listeners; | ||
/** | ||
* Sets up a function that will be called whenever the target changes. | ||
* @param listener - Callback function. | ||
* @param options - An options object that specifies characteristics about the listener. | ||
* If once true, indicates that the listener should be invoked at most once after being added. | ||
* If once true, the listener would be automatically removed when invoked. | ||
*/ | ||
addListener(listener: (data: T) => void, options?: { | ||
once?: boolean; | ||
}): void; | ||
/** | ||
* Emit change. | ||
* @param data - Data to emit. | ||
*/ | ||
emit(data: T): void; | ||
/** | ||
* Removes all listeners previously registered with addListener. | ||
*/ | ||
removeAllListeners(): void; | ||
/** | ||
* Removes a listener previously registered with addListener. | ||
* @param listener - Callback function. | ||
*/ | ||
removeListener(listener: (data: T) => void): void; | ||
/** | ||
* Registers a listener. | ||
* @param listener - Callback function. | ||
* @deprecated Use addListener. | ||
*/ | ||
on(listener: (data: T) => void): void; | ||
/** | ||
* Unregisters a listener. | ||
* @param listener - Callback function. | ||
* @deprecated Use removeListener. | ||
*/ | ||
off(listener: (data: T) => void): void; | ||
/** | ||
* Registers a listener then unregisters the listener after one event emission. | ||
* @param listener - Callback function. | ||
* @deprecated Use addListener. | ||
*/ | ||
once(listener: (data: T) => void): void; | ||
} | ||
//# sourceMappingURL=emitter.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/** | ||
* An {@link Emitter} implementation. | ||
* @internal | ||
*/ | ||
export class EmitterImpl { | ||
constructor() { | ||
this.listeners = new Array(); | ||
} | ||
/** | ||
* Sets up a function that will be called whenever the target changes. | ||
* @param listener - Callback function. | ||
* @param options - An options object that specifies characteristics about the listener. | ||
* If once true, indicates that the listener should be invoked at most once after being added. | ||
* If once true, the listener would be automatically removed when invoked. | ||
*/ | ||
addListener(listener, options) { | ||
const onceWrapper = (data) => { | ||
this.removeListener(onceWrapper); | ||
listener(data); | ||
}; | ||
(options === null || options === void 0 ? void 0 : options.once) === true ? this.listeners.push(onceWrapper) : this.listeners.push(listener); | ||
} | ||
/** | ||
* Emit change. | ||
* @param data - Data to emit. | ||
*/ | ||
emit(data) { | ||
this.listeners.slice().forEach((listener) => listener(data)); | ||
} | ||
/** | ||
* Removes all listeners previously registered with addListener. | ||
*/ | ||
removeAllListeners() { | ||
this.listeners = []; | ||
} | ||
/** | ||
* Removes a listener previously registered with addListener. | ||
* @param listener - Callback function. | ||
*/ | ||
removeListener(listener) { | ||
this.listeners = this.listeners.filter((l) => l !== listener); | ||
} | ||
/** | ||
* Registers a listener. | ||
* @param listener - Callback function. | ||
* @deprecated Use addListener. | ||
*/ | ||
on(listener) { | ||
return this.addListener(listener); | ||
} | ||
/** | ||
* Unregisters a listener. | ||
* @param listener - Callback function. | ||
* @deprecated Use removeListener. | ||
*/ | ||
off(listener) { | ||
return this.removeListener(listener); | ||
} | ||
/** | ||
* Registers a listener then unregisters the listener after one event emission. | ||
* @param listener - Callback function. | ||
* @deprecated Use addListener. | ||
*/ | ||
once(listener) { | ||
return this.addListener(listener, { once: true }); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Exception } from "../../core"; | ||
/** | ||
* An exception indicating an unsupported content type prevented execution. | ||
* @public | ||
*/ | ||
export declare class ContentTypeUnsupportedError extends Exception { | ||
constructor(message?: string); | ||
} | ||
//# sourceMappingURL=content-type-unsupported.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Exception } from "../../core"; | ||
/** | ||
* An exception indicating an unsupported content type prevented execution. | ||
* @public | ||
*/ | ||
export class ContentTypeUnsupportedError extends Exception { | ||
constructor(message) { | ||
super(message ? message : "Unsupported content type."); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export * from "./content-type-unsupported"; | ||
export * from "./request-pending"; | ||
export * from "./session-description-handler"; | ||
export * from "./session-terminated"; | ||
export * from "./state-transition"; | ||
//# sourceMappingURL=index.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export * from "./content-type-unsupported"; | ||
export * from "./request-pending"; | ||
export * from "./session-description-handler"; | ||
export * from "./session-terminated"; | ||
export * from "./state-transition"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Exception } from "../../core"; | ||
/** | ||
* An exception indicating an outstanding prior request prevented execution. | ||
* @public | ||
*/ | ||
export declare class RequestPendingError extends Exception { | ||
/** @internal */ | ||
constructor(message?: string); | ||
} | ||
//# sourceMappingURL=request-pending.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Exception } from "../../core"; | ||
/** | ||
* An exception indicating an outstanding prior request prevented execution. | ||
* @public | ||
*/ | ||
export class RequestPendingError extends Exception { | ||
/** @internal */ | ||
constructor(message) { | ||
super(message ? message : "Request pending."); | ||
} | ||
} |