***

title: connect
slug: /reference/typescript/agents/function-result/connect
description: Transfer or connect the call to another destination.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[functionresult]: /docs/server-sdks/reference/typescript/agents/function-result

Transfer or connect the call to another destination. Generates a SWML `connect`
verb under the hood.

<Note>
  When `final` is `true` (the default), the call permanently leaves the agent. When
  `final` is `false`, the call returns to the agent if the far end hangs up first.
</Note>

## **Parameters**

<ParamField path="destination" type="string" required={true} toc={true}>
  Where to connect the call. Accepts a phone number in E.164 format (e.g.,
  `"+15551234567"`) or a SIP address (e.g., `"support@company.com"`).
</ParamField>

<ParamField path="final" type="boolean" default="true" toc={true}>
  Whether this is a permanent transfer.

  * `true` — call exits the agent completely (terminal action)
  * `false` — call returns to the agent when the far end hangs up
</ParamField>

<ParamField path="fromAddr" type="string | undefined" default="undefined" toc={true}>
  Caller ID override. Phone number or SIP address to show as the caller. When
  `undefined`, the current call's originating address is used.
</ParamField>

## **Returns**

[`FunctionResult`][functionresult] -- `this`, for chaining.

## **Examples**

### Permanent Transfer

```typescript {4}
import { FunctionResult } from '@signalwire/sdk';

const result = new FunctionResult('Transferring you to sales.')
  .connect('+15551234567');
```

### Temporary Transfer

```typescript {4}
import { FunctionResult } from '@signalwire/sdk';

const result = new FunctionResult('Connecting you to a specialist.')
  .connect('+15551234567', false);
```

### Custom Caller ID

```typescript {4}
import { FunctionResult } from '@signalwire/sdk';

const result = new FunctionResult('Transferring now.')
  .connect('support@company.com', true, '+15559876543');
```