From d982753553a37e94a2bf8c82e37ed59324ce5ca9 Mon Sep 17 00:00:00 2001 From: Sanyam Jain Plivo <99676817+sanyamjain-plivo@users.noreply.github.com> Date: Thu, 19 Sep 2024 19:32:10 +0530 Subject: [PATCH] chore(2.2.14): updated version to 2.2.14 --- CHANGELOG.md | 5 +++++ lib/managers/incomingCall.ts | 3 +++ lib/managers/outgoingCall.ts | 3 +++ package.json | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75e213e..910ed41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ 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.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** diff --git a/lib/managers/incomingCall.ts b/lib/managers/incomingCall.ts index 8a49b31..d0395fe 100644 --- a/lib/managers/incomingCall.ts +++ b/lib/managers/incomingCall.ts @@ -314,6 +314,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); } diff --git a/lib/managers/outgoingCall.ts b/lib/managers/outgoingCall.ts index 0950315..5e3f0a7 100644 --- a/lib/managers/outgoingCall.ts +++ b/lib/managers/outgoingCall.ts @@ -422,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); } diff --git a/package.json b/package.json index 49d31af..10d1060 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "plivo-browser-sdk", "title": "plivo-browser-sdk", - "version": "2.2.13", + "version": "2.2.14", "description": "This library allows you to connect with plivo's voice enviroment from browser", "main": "./dist/plivobrowsersdk.js", "types": "index.d.ts",