@unboundcx/sdk 4.8.16 → 4.8.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/services/voice.js +10 -9
package/README.md
CHANGED
|
@@ -352,7 +352,7 @@ const call = await api.voice.createCall({
|
|
|
352
352
|
// Call controls
|
|
353
353
|
await api.voice.mute(call.callControlId);
|
|
354
354
|
await api.voice.hold(call.callControlId);
|
|
355
|
-
await api.voice.sendDtmf(call.
|
|
355
|
+
await api.voice.sendDtmf({ callId: call.callId, dtmf: '1234' }); // mode: 'auto'|'rtp'|'inband'|'info'
|
|
356
356
|
await api.voice.transfer(call.callControlId, '+1555555555');
|
|
357
357
|
await api.voice.hangup(call.callControlId);
|
|
358
358
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.17",
|
|
4
4
|
"description": "Official JavaScript SDK for the Unbound API - A comprehensive toolkit for integrating with Unbound's communication, AI, and data management services",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
package/services/voice.js
CHANGED
|
@@ -250,25 +250,26 @@ export class VoiceService {
|
|
|
250
250
|
return this.mute(voiceChannelId, 'unmute', direction);
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
|
|
253
|
+
/**
|
|
254
|
+
* Send DTMF digits on a live call (SIP call ID). mode: 'auto' (default —
|
|
255
|
+
* RFC4733 RTP if negotiated, else in-band tones) | 'rtp' | 'inband' | 'info'
|
|
256
|
+
* (SIP INFO application/dtmf-relay).
|
|
257
|
+
*/
|
|
258
|
+
async sendDtmf({ callId, dtmf, mode }) {
|
|
254
259
|
this.sdk.validateParams(
|
|
255
|
-
{
|
|
260
|
+
{ callId, dtmf, mode },
|
|
256
261
|
{
|
|
257
|
-
|
|
262
|
+
callId: { type: 'string', required: true },
|
|
258
263
|
dtmf: { type: 'string', required: true },
|
|
259
264
|
mode: { type: 'string', required: false },
|
|
260
265
|
},
|
|
261
266
|
);
|
|
262
267
|
|
|
263
268
|
const params = {
|
|
264
|
-
body: mode ? { dtmf, mode } : { dtmf },
|
|
269
|
+
body: mode ? { callId, dtmf, mode } : { callId, dtmf },
|
|
265
270
|
};
|
|
266
271
|
|
|
267
|
-
const result = await internalRequest(this.sdk,
|
|
268
|
-
`/voice/calls/dtmf/${voiceChannelId}`,
|
|
269
|
-
'POST',
|
|
270
|
-
params,
|
|
271
|
-
);
|
|
272
|
+
const result = await internalRequest(this.sdk, `/voice/dtmf`, 'POST', params);
|
|
272
273
|
return result;
|
|
273
274
|
}
|
|
274
275
|
|