@unboundcx/sdk 4.8.17 → 4.8.18

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({ callId: call.callId, dtmf: '1234' }); // mode: 'auto'|'rtp'|'inband'|'info'
355
+ await api.voice.sendDtmf({ callId: call.callId, dtmf: '1234' }); // mode: 'auto'|'rtp'|'inband'|'info'; target: 'leg' (default) | 'peer'
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.17",
3
+ "version": "4.8.18",
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
@@ -251,23 +251,29 @@ export class VoiceService {
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).
254
+ * Send DTMF digits on a live call (SIP call ID).
255
+ * mode: 'auto' (default — RFC4733 RTP if negotiated, else in-band tones)
256
+ * | 'rtp' | 'inband' | 'info' (SIP INFO application/dtmf-relay).
257
+ * target: 'leg' (default) — transmit on callId's media toward its far end
258
+ * (e.g. a bot sending digits on the PSTN leg it dialed);
259
+ * 'peer' — as if the party on callId pressed the keys: the bridge
260
+ * relays to the other side (a user's keypad on their own leg).
257
261
  */
258
- async sendDtmf({ callId, dtmf, mode }) {
262
+ async sendDtmf({ callId, dtmf, mode, target }) {
259
263
  this.sdk.validateParams(
260
- { callId, dtmf, mode },
264
+ { callId, dtmf, mode, target },
261
265
  {
262
266
  callId: { type: 'string', required: true },
263
267
  dtmf: { type: 'string', required: true },
264
268
  mode: { type: 'string', required: false },
269
+ target: { type: 'string', required: false },
265
270
  },
266
271
  );
267
272
 
268
- const params = {
269
- body: mode ? { callId, dtmf, mode } : { callId, dtmf },
270
- };
273
+ const body = { callId, dtmf };
274
+ if (mode) body.mode = mode;
275
+ if (target) body.target = target;
276
+ const params = { body };
271
277
 
272
278
  const result = await internalRequest(this.sdk, `/voice/dtmf`, 'POST', params);
273
279
  return result;