diff --git a/CHANGELOG.md b/CHANGELOG.md index 11b46837..927f26a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,16 @@ # Change Log +## [v4.23.1](https://github.com/plivo/plivo-node/tree/v4.23.1) (2021-10-13) +**Bug Fix** + - LiveCallInterface. + - [Buy Number API](https://www.plivo.com/docs/numbers/api/phone-number#buy-a-phone-number) to support app_id + ## [v4.23.0](https://github.com/plivo/plivo-node/tree/v4.23.0) (2021-10-11) **Features - Messaging** - This version includes advancements to the Messaging Interface that deals with the [Send SMS/MMS](https://www.plivo.com/docs/sms/api/message#send-a-message) interface, Creating a standard structure for `request/input` arguments to make implementation easier and incorporating support for the older interface. Example for [send SMS](https://github.com/plivo/plivo-node#send-a-message) - + ## [v4.22.4](https://github.com/plivo/plivo-node/tree/v4.22.4) (2021-09-27) **Bug Fix** - Handle invalid destination number API response for send [SMS API](https://www.plivo.com/docs/sms/api/message/send-a-message/). diff --git a/lib/resources/call.js b/lib/resources/call.js index d4f4c011..b4c19446 100644 --- a/lib/resources/call.js +++ b/lib/resources/call.js @@ -920,8 +920,8 @@ class LiveCallInterface extends PlivoResourceInterface { if (action !== '' && !id) { reject(new Error(this[idKey] + ' must be set')); } - client('GET', action + (id ? id + '/?status=live' : '') , { - isVoiceRequest: 'true' + client('GET', action + id, { + isVoiceRequest: 'true', status: 'live' }) .then(response => { resolve(new GetLiveCallResponse(response.body, client)); @@ -941,7 +941,7 @@ class LiveCallInterface extends PlivoResourceInterface { params.status = 'live' params.isVoiceRequest = 'true'; return new Promise((resolve, reject) => { - client('GET', action+'?status=live', params) + client('GET', action, params) .then(response => { let calls = []; response.body.calls.forEach(callUuid => { @@ -997,8 +997,8 @@ class QueuedCallInterface extends PlivoResourceInterface { reject(new Error(this[idKey] + ' must be set')); } - client('GET', action + (id ? id + '/?status=queued' : ''), { - isVoiceRequest: 'true' + client('GET', action + id, { + isVoiceRequest: 'true', status: 'queued' }) .then(response => { resolve(new GetQueuedCallResponse(response.body, client)); @@ -1015,8 +1015,8 @@ class QueuedCallInterface extends PlivoResourceInterface { let client = this[clientKey]; return new Promise((resolve, reject) => { - client('GET', action+'?status=queued', { - isVoiceRequest: 'true' + client('GET', action, { + isVoiceRequest: 'true', status: 'queued' }) .then(response => { let calls = []; diff --git a/lib/resources/numbers.js b/lib/resources/numbers.js index 33b5a603..49b22e8a 100644 --- a/lib/resources/numbers.js +++ b/lib/resources/numbers.js @@ -80,10 +80,10 @@ export class PhoneNumber extends PlivoResource { * @promise {@link PlivoGenericResponse} return PlivoGenericResponse Object if success * @fail {Error} return Error */ - buy(appId) { + buy(number,appId) { return new PhoneNumberInterface(this[clientKey], { id: this.id - }).buy(appId); + }).buy(number,appId); } } diff --git a/lib/rest/request-test.js b/lib/rest/request-test.js index abd32ec9..3f0abe0a 100644 --- a/lib/rest/request-test.js +++ b/lib/rest/request-test.js @@ -36,7 +36,7 @@ export function Request(config) { return new Promise((resolve, reject) => { // LiveCall - needs to be at top - if (method === 'GET' && action === 'Call/6653422-91b6-4716-9fad-9463daaeeec2/?status=live') { + if (method === 'GET' && action === 'Call/6653422-91b6-4716-9fad-9463daaeeec2' && params['status'] === 'live') { resolve({ response: {}, body: { @@ -52,7 +52,7 @@ export function Request(config) { }); } - else if (method === 'GET' && action === 'Call/?status=live') { + else if (method === 'GET' && action === 'Call/' && params['status'] === 'live') { resolve({ response: {}, body: { diff --git a/package.json b/package.json index 80e3efa7..38d9b64e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plivo", - "version": "4.23.0", + "version": "4.23.1", "description": "A Node.js SDK to make voice calls and send SMS using Plivo and to generate Plivo XML", "homepage": "https://github.com/plivo/plivo-node", "files": [