> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognigy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# connectAndCall

Connects to the SIP server and starts a call in one operation. This is a convenience method that combines [`connect()`](/click-to-call/sdk/api-reference/connect) and [`startCall()`](/click-to-call/sdk/api-reference/start-call).

## Signature

```typescript theme={null}
await client.connectAndCall();
```

## Parameters

None.

## Returns

`Promise<void>`

## Throws

An error if the connection or call initiation fails.

## Example

```typescript theme={null}
await client.connectAndCall();
console.log('Connected and call started');
```

### With Error Handling

```typescript theme={null}
try {
  await client.connectAndCall();
} catch (error) {
  console.error('Failed to connect and call:', error.message);
}
```

## More Information

* [connect](/click-to-call/sdk/api-reference/connect)
* [startCall](/click-to-call/sdk/api-reference/start-call)
* [endCall](/click-to-call/sdk/api-reference/end-call)
