Skip to content

Commit

Permalink
docs: Update TS docs
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 11, 2020
1 parent 9ad4331 commit d683d41
Showing 1 changed file with 11 additions and 28 deletions.
39 changes: 11 additions & 28 deletions packages/js/docs/ts/classes/telnyxrtc.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ ___

*Overrides [BaseSession](basesession.md).[broadcast](basesession.md#broadcast)*

*Defined in [src/Modules/Verto/index.ts:113](https://github.com/team-telnyx/webrtc/blob/main/packages/js/src/Modules/Verto/index.ts#L113)*
*Defined in [src/Modules/Verto/index.ts:93](https://github.com/team-telnyx/webrtc/blob/main/packages/js/src/Modules/Verto/index.ts#L93)*

**Parameters:**

Expand Down Expand Up @@ -997,7 +997,7 @@ ___

*Inherited from void*

*Defined in [src/Modules/Verto/index.ts:100](https://github.com/team-telnyx/webrtc/blob/main/packages/js/src/Modules/Verto/index.ts#L100)*
*Defined in [src/Modules/Verto/index.ts:83](https://github.com/team-telnyx/webrtc/blob/main/packages/js/src/Modules/Verto/index.ts#L83)*

Makes a new outbound call.

Expand All @@ -1007,52 +1007,36 @@ This method receives an object `options` with the following properties:

Making an outbound call to `+1 856-444-0362` using default values from the client:

Using async/await:

```js
const call = await client.newCall({
const call = client.newCall({
destinationNumber: '+18564440362',
callerNumber: '+15551231234'
});
```

Using ES6 `Promises`:

```js
client.newCall({
destinationNumber: '+18564440362',
callerNumber: '+15551231234'
}).then((call) => {
// do something with the call
});
```

You can omit `callerNumber` when dialing a SIP address:

```js
const call = await client.newCall({
const call = client.newCall({
destinationNumber: 'sip:[email protected]'
});
```

If you are making calls from one Telnyx connection to another, you may specify just the SIP username:

```js
const call = await client.newCall({
const call = client.newCall({
destinationNumber: 'telnyx-sip-username' // This is equivalent to 'sip:[email protected]'
});
```

### Error handling

If `options` or `destinationNumber` is not specified, it throw an error.
An error will be thrown if `destinationNumber` is not specified.

```js
client.newCall().catch(console.error);
// => `You need to provide the options<CallOptions> object.`
client.newCall({}).catch(console.error);
// => `destinationNumber is required.`
```
const call = client.newCall().catch(console.error);
// => `destinationNumber is required`

**Parameters:**

Expand All @@ -1062,8 +1046,7 @@ Name | Type | Description |

**Returns:** *[Call](call.md)‹›*

`Promise<Call>` A promise fulfilled with the new outbound `Call` object
or rejected with the error.
The new outbound `Call` object.

___

Expand Down Expand Up @@ -1272,7 +1255,7 @@ ___

*Overrides [BaseSession](basesession.md).[subscribe](basesession.md#subscribe)*

*Defined in [src/Modules/Verto/index.ts:117](https://github.com/team-telnyx/webrtc/blob/main/packages/js/src/Modules/Verto/index.ts#L117)*
*Defined in [src/Modules/Verto/index.ts:97](https://github.com/team-telnyx/webrtc/blob/main/packages/js/src/Modules/Verto/index.ts#L97)*

**Parameters:**

Expand All @@ -1292,7 +1275,7 @@ ___

*Overrides [BaseSession](basesession.md).[unsubscribe](basesession.md#unsubscribe)*

*Defined in [src/Modules/Verto/index.ts:121](https://github.com/team-telnyx/webrtc/blob/main/packages/js/src/Modules/Verto/index.ts#L121)*
*Defined in [src/Modules/Verto/index.ts:101](https://github.com/team-telnyx/webrtc/blob/main/packages/js/src/Modules/Verto/index.ts#L101)*

**Parameters:**

Expand Down

0 comments on commit d683d41

Please sign in to comment.