Skip to content

Commit

Permalink
chore(2.2.15-beta.0): version updated to 2.2.15 beta.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sanyamjain-plivo authored Sep 20, 2024
1 parent 57bd912 commit 6499d24
Show file tree
Hide file tree
Showing 21 changed files with 114 additions and 60 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ All notable GA release changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## v2.2.15-beta.0 (released@ 20-09-2024)

**Bug Fixes**
* Fixed the error occurring when answer() and hangup() are called simultaneously.

## v2.2.14 (released@ 19-09-2024)

**Feature**
* A new event named `onCallConnected` has been introduced, which is triggered when the PSTN callee starts ringing.

## v2.2.13 (released@ 22-08-2024)

**Bug Fixes**
* Removed unnecessary dependency.

## v2.2.12 (released@ 24-07-2024)

**Bug Fixes**
* Renamed `DOMError` to `DOMException` in the underlying JSSIP library to support latest Typescript versions.

## v2.2.12-beta.0 (released@ 08-07-2024)

**Features**
Expand Down
25 changes: 14 additions & 11 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ declare module 'plivo-browser-sdk/client' {
*/
timeDiff: number;
/**
* Holds the incoming or outgoing JSSIP RTCSession(WebRTC media session)
* Holds the incoming or outgoing JsSIP RTCSession(WebRTC media session)
* @private
*/
callSession: null | RTCSession;
Expand All @@ -169,7 +169,7 @@ declare module 'plivo-browser-sdk/client' {
* speech when the user speaks on mute
* @private
*/
speechRecognition: SpeechRecognition;
speechRecognition: any;
/**
* Holds the loggerUtil instance which keeps the
* value of username and sipCallID to attached to each log
Expand Down Expand Up @@ -369,7 +369,7 @@ declare module 'plivo-browser-sdk/client' {
*/
statsSocket: null | StatsSocket;
/**
* Contains available audio devices.This is done for backward compatiblity
* Contains available audio devices.This is done for backward compatibility
* @private
*/
audioDevDic: any;
Expand Down Expand Up @@ -834,7 +834,7 @@ declare module 'plivo-browser-sdk/managers/callSession' {
*/
stirShakenState: string;
/**
* Identifier generated by JSSIP when a new RTCSession is created for the call
* Identifier generated by JsSIP when a new RTCSession is created for the call
* @private
*/
sipCallID: string | null;
Expand Down Expand Up @@ -864,7 +864,7 @@ declare module 'plivo-browser-sdk/managers/callSession' {
*/
isCallTerminatedDuringRinging: boolean;
/**
* Holds the current status of speechrecgnition
* Holds the current status of speech recognition
* @private
*/
speech_state: string;
Expand Down Expand Up @@ -1256,7 +1256,7 @@ declare module 'plivo-browser-sdk/managers/workerManager' {
/**
* Start the network check timer.
* @param {number} networkCheckInterval - time interval at which the timer is to be executed.
* @param {any} callback - callback to be trigerred when the timer executes.
* @param {any} callback - callback to be triggered when the timer executes.
*/
startNetworkCheckTimer: (networkCheckInterval: number, callback: any, responseCallback: any) => void;
/**
Expand Down Expand Up @@ -1633,12 +1633,12 @@ declare module 'plivo-browser-sdk/stats/rtpStats' {
*/
xcallUUID: string;
/**
* Identifier generated by JSSIP when a new RTCSession is created for the call
* Identifier generated by JsSIP when a new RTCSession is created for the call
* @private
*/
callUUID: string;
/**
* Identifier generated by JSSIP when a new RTCSession is created for the call
* Identifier generated by JsSIP when a new RTCSession is created for the call
* @private
*/
corelationId: string;
Expand Down Expand Up @@ -1763,6 +1763,7 @@ declare module 'plivo-browser-sdk/stats/nonRTPStats' {
sdkVersionMajor: number;
sdkVersionMinor: number;
sdkVersionPatch: number;
sdkVersionPre: any;
devicePlatform: string;
deviceOs: string;
setupOptions: ConfiguationOptions;
Expand Down Expand Up @@ -1791,6 +1792,7 @@ declare module 'plivo-browser-sdk/stats/nonRTPStats' {
sdkVersionMajor: number;
sdkVersionMinor: number;
sdkVersionPatch: number;
sdkVersionPre: any;
clientName: string;
devicePlatform: string;
deviceOs: string;
Expand All @@ -1813,6 +1815,7 @@ declare module 'plivo-browser-sdk/stats/nonRTPStats' {
sdkVersionMajor: number;
sdkVersionMinor: number;
sdkVersionPatch: number;
sdkVersionPre: any;
clientName: string;
devicePlatform: string;
deviceOs: string;
Expand Down Expand Up @@ -1905,11 +1908,11 @@ declare module 'plivo-browser-sdk/stats/nonRTPStats' {

declare module 'plivo-browser-sdk/media/audioLevel' {
/**
* Analyse the audio level for a stream(local/remote).
* Analyze the audio level for a stream(local/remote).
*/
export class AudioLevel {
/**
* Audio volume in decibles
* Audio volume in decibels
* @private
*/
volumeLevel: number;
Expand All @@ -1934,7 +1937,7 @@ declare module 'plivo-browser-sdk/media/audioLevel' {
*/
sourceNode: MediaStreamAudioSourceNode;
/**
* Get audio level in decibles.
* Get audio level in decibels.
*/
getAudioLevel: () => number;
/**
Expand Down
9 changes: 5 additions & 4 deletions lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export class Client extends EventEmitter {
timeDiff: number;

/**
* Holds the incoming or outgoing JSSIP RTCSession(WebRTC media session)
* Holds the incoming or outgoing JsSIP RTCSession(WebRTC media session)
* @private
*/
callSession: null | RTCSession;
Expand All @@ -220,7 +220,7 @@ export class Client extends EventEmitter {
* speech when the user speaks on mute
* @private
*/
speechRecognition: SpeechRecognition;
speechRecognition: any;

/**
* Holds the loggerUtil instance which keeps the
Expand Down Expand Up @@ -463,7 +463,7 @@ export class Client extends EventEmitter {
statsSocket: null | StatsSocket;

/**
* Contains available audio devices.This is done for backward compatiblity
* Contains available audio devices.This is done for backward compatibility
* @private
*/
audioDevDic: any;
Expand Down Expand Up @@ -910,6 +910,7 @@ export class Client extends EventEmitter {
captureSDKCrashOnly: _options.captureSDKCrashOnly,
permOnClick: _options.permOnClick,
stopAutoRegisterOnConnect: _options.stopAutoRegisterOnConnect,
registrationRefreshTimer: _options.registrationRefreshTimer,
};
Plivo.log.info(`${C.LOGCAT.INIT} | Plivo SDK initialized successfully with options:- `, JSON.stringify(data), `in ${Plivo.log.level()} mode`);
// instantiates event emitter
Expand Down Expand Up @@ -1525,7 +1526,7 @@ export class Client extends EventEmitter {
this.loggerUtil.setSipCallID(incomingCall.sipCallID ?? "");
Plivo.log.debug(`${LOGCAT.CALL} | reject - ${incomingCall.callUUID}`);
if (incomingCall.session && incomingCall.session.isEstablished()) {
Plivo.log.warn(`${LOGCAT.CALL} |call already answerd, please use hangup() method`);
Plivo.log.warn(`${LOGCAT.CALL} | Call already answered, please use hangup() method`);
return false;
}
if (incomingCall) {
Expand Down
4 changes: 2 additions & 2 deletions lib/managers/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ class Account {
// NOTE: This event is not documented by JsSIP.
// Should be used to just record the timestamp of invite received only
// Do not have any other logic here
// Invite Server Trasaction(ist) gives us the incoming invite timestamp.
// Invite Server Transaction(ist) gives us the incoming invite timestamp.
if (evt.transaction.type === 'ist') {
const callID = evt.transaction.request.getHeader('Call-ID') ?? "";
Plivo.log.info(`${C.LOGCAT.LOGIN} | new Transaction created, incoming call received callUUID: ${callID}`);
Expand Down Expand Up @@ -576,7 +576,7 @@ class Account {
this._tiggerNetworkChangeEvent(fetchIpCount);
}, fetchIpCount * 200);
} else {
Plivo.log.warn(`${C.LOGCAT.NETWORK_CHANGE} | Could not retreive ipaddress`);
Plivo.log.warn(`${C.LOGCAT.NETWORK_CHANGE} | Could not retrieve IP address`);
fetchIpCount = 0;
}
});
Expand Down
4 changes: 2 additions & 2 deletions lib/managers/callSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class CallSession {
stirShakenState: string;

/**
* Identifier generated by JSSIP when a new RTCSession is created for the call
* Identifier generated by JsSIP when a new RTCSession is created for the call
* @private
*/
sipCallID: string | null;
Expand Down Expand Up @@ -171,7 +171,7 @@ export class CallSession {
isCallTerminatedDuringRinging: boolean;

/**
* Holds the current status of speechrecgnition
* Holds the current status of speech recognition
* @private
*/
speech_state: string;
Expand Down
12 changes: 10 additions & 2 deletions lib/managers/incomingCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ const updateSessionInfo = (evt: UserAgentNewRtcSessionEvent, call: CallSession):
if (call.callUUID) {
cs.incomingInvites.set(call.callUUID, call);
cs.lastIncomingCall = call;
// Storing these info for backward compatiblity, in case user used these non-document variables.
// Storing these info for backward compatibility,
// In case user used these non-document variables.
if (!cs.options.allowMultipleIncomingCalls) {
cs.callSession = call.session;
cs.callUUID = call.callUUID;
Expand Down Expand Up @@ -345,6 +346,9 @@ const newDTMF = (evt: SessionNewDtmfEvent): void => {
*/
const newInfo = (evt: SessionNewInfoEvent): void => {
Plivo.log.info(`${LOGCAT.CALL} | Incoming Call | ${evt.originator} INFO packet with body : ${evt.info.body}`);
if (cs._currentSession && evt.info.body === "remote-party-ringing") {
cs.emit('onCallConnected', cs._currentSession.getCallInfo(evt.originator));
}
if (evt.info.body === 'no-remote-audio') {
cs.emit('remoteAudioStatus', false);
}
Expand Down Expand Up @@ -593,7 +597,11 @@ export const answerIncomingCall = function (
Plivo.log.debug(`${LOGCAT.CALL} | CallUUID is ${cs.callUUID}`);
cs.callDirection = cs._currentSession.direction;
getAnswerOptions().then((options) => {
curIncomingCall.session.answer(options);
if (cs.getCurrentSession()) {
curIncomingCall.session.answer(options);
} else {
Plivo.log.info(`${LOGCAT.CALL} | No Call session exists to answer the incoming call`);
}
});
} catch (err) {
Plivo.log.error(`${LOGCAT.CALL} | error in answering incoming call : `, err.message);
Expand Down
8 changes: 5 additions & 3 deletions lib/managers/outgoingCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ const onSDP = (evt: SessionSdpEvent): void => {
* @param {SessionProgressEvent} evt - rtcsession progress information
*/
const handleProgressTone = (evt: SessionProgressEvent): void => {
Plivo.log.debug(`${LOGCAT.CALL} | ringback tone enabled : ${cs.ringToneBackFlag} audioPaused: ${cs.connectToneView.paused}`);
Plivo.log.debug(`${LOGCAT.CALL} | Ringback Tone Enabled : ${cs.ringToneBackFlag} | Audio Paused: ${cs.connectToneView.paused}`);
if (!cs.connectToneView.paused) {
stopAudio(CONNECT_TONE_ELEMENT_ID);
}
Expand Down Expand Up @@ -237,7 +237,6 @@ const OnProgress = (evt: SessionProgressEvent): void => {
cs._currentSession.onRinging(cs);
const callUUID = evt.response.getHeader('X-Calluuid');
cs._currentSession.setCallUUID(callUUID);
Plivo.log.info(`${LOGCAT.CALL} | Outgoing call Ringing`);
cs._currentSession.setState(cs._currentSession.STATE.RINGING);
cs.callUUID = callUUID;
Plivo.log.info(`${LOGCAT.CALL} | Outgoing call Ringing, CallUUID: ${cs.callUUID}`);
Expand Down Expand Up @@ -265,7 +264,7 @@ const OnProgress = (evt: SessionProgressEvent): void => {
cs.mute();
}
} else {
Plivo.log.debug(`${LOGCAT.CALL} | inavlid response received, while call in progress`);
Plivo.log.debug(`${LOGCAT.CALL} | Invalid response received, while call in progress`);
}
};

Expand Down Expand Up @@ -423,6 +422,9 @@ const newDTMF = (evt: SessionNewDtmfEvent): void => {
*/
const newInfo = (evt: SessionNewInfoEvent): void => {
Plivo.log.info(`${LOGCAT.CALL} | Outgoing Call | ${evt.originator} INFO packet with body : ${evt.info.body}`);
if (cs._currentSession && evt.info.body === "remote-party-ringing") {
cs.emit('onCallConnected', cs._currentSession.getCallInfo(evt.originator));
}
if (evt.info.body === 'no-remote-audio') {
cs.emit('remoteAudioStatus', false);
}
Expand Down
9 changes: 5 additions & 4 deletions lib/managers/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
getSDKVersion,
getOS,
SemverParserVersion,
getSdkVersionPre,
} from '../utils/device';
import {
sendEvents,
Expand Down Expand Up @@ -61,6 +62,7 @@ const getSummaryEvent = async function (client: Client): Promise<SummaryEvent> {
sdkVersionMajor: sdkVersionParse.major,
sdkVersionMinor: sdkVersionParse.minor,
sdkVersionPatch: sdkVersionParse.patch,
sdkVersionPre: getSdkVersionPre(sdkVersionParse),
clientName: getBrowserDetails().browser,
devicePlatform: navigator.platform,
deviceOs,
Expand All @@ -72,7 +74,6 @@ const getSummaryEvent = async function (client: Client): Promise<SummaryEvent> {
isAudioDeviceToggled: client.deviceToggledInCurrentSession,
isNetworkChanged: client.networkChangeInCurrentSession,
jsFramework: client.jsFramework,

};
if (client._currentSession) {
summaryEvent.signalling = client._currentSession.signallingInfo;
Expand Down Expand Up @@ -219,7 +220,7 @@ const applyStatsSettings = function (): boolean {
};

/**
* Initialise callstats storage.
* Initialize callstats storage.
*/
export const callStart = function (): void {
const client: Client = this;
Expand Down Expand Up @@ -470,7 +471,7 @@ const calcConnStage = function (obj: string[]): string {
export const clearSessionInfo = function (session: CallSession): void {
const client: Client = this;
if (session === client._currentSession) {
// audio element clearence
// audio element clearance
if (client.remoteView) {
client.remoteView.pause();
}
Expand Down Expand Up @@ -653,7 +654,7 @@ export const addCallstatsIOFabric = function (
};

/**
* Send error to stats wahen media error occurs.
* Send error to stats when media error occurs.
* @param {SessionFailedEvent} evt - rtcsession failed information
* @param {CallSession} callSession - call session information
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/managers/workerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class WorkerManager {
/**
* Start the network check timer.
* @param {number} networkCheckInterval - time interval at which the timer is to be executed.
* @param {any} callback - callback to be trigerred when the timer executes.
* @param {any} callback - callback to be triggered when the timer executes.
*/
startNetworkCheckTimer = (networkCheckInterval: number, callback: any, responseCallback: any) => {
Plivo.log.debug(`${LOGCAT.NIMBUS} | starting the network check timer`);
Expand Down
Loading

0 comments on commit 6499d24

Please sign in to comment.