@unboundcx/sdk 4.8.15 → 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 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.callControlId, '1234');
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.15",
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,24 +250,26 @@ export class VoiceService {
250
250
  return this.mute(voiceChannelId, 'unmute', direction);
251
251
  }
252
252
 
253
- async sendDtmf(voiceChannelId, dtmf) {
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
- { voiceChannelId, dtmf },
260
+ { callId, dtmf, mode },
256
261
  {
257
- voiceChannelId: { type: 'string', required: true },
262
+ callId: { type: 'string', required: true },
258
263
  dtmf: { type: 'string', required: true },
264
+ mode: { type: 'string', required: false },
259
265
  },
260
266
  );
261
267
 
262
268
  const params = {
263
- body: { dtmf },
269
+ body: mode ? { callId, dtmf, mode } : { callId, dtmf },
264
270
  };
265
271
 
266
- const result = await internalRequest(this.sdk,
267
- `/voice/calls/dtmf/${voiceChannelId}`,
268
- 'POST',
269
- params,
270
- );
272
+ const result = await internalRequest(this.sdk, `/voice/dtmf`, 'POST', params);
271
273
  return result;
272
274
  }
273
275