# polymorfa sip-trunk

> Connect a PBX to WhatsApp calls with SIP trunks.

## Commands

- [polymorfa sip-trunk create](https://docs.polymorfa.com/cli/sip-trunk/create): Create a SIP trunk.
- [polymorfa sip-trunk delete](https://docs.polymorfa.com/cli/sip-trunk/delete): Delete a SIP trunk.
- [polymorfa sip-trunk endpoint](https://docs.polymorfa.com/cli/sip-trunk/endpoint): Show the SIP address for your PBX.
- [polymorfa sip-trunk list](https://docs.polymorfa.com/cli/sip-trunk/list): List SIP trunks.
- [polymorfa sip-trunk rotate-credentials](https://docs.polymorfa.com/cli/sip-trunk/rotate-credentials): Rotate SIP trunk credentials.
- [polymorfa sip-trunk update](https://docs.polymorfa.com/cli/sip-trunk/update): Change a SIP trunk.
- [polymorfa sip-trunk view](https://docs.polymorfa.com/cli/sip-trunk/view): Show a SIP trunk.

## polymorfa sip-trunk create

Create a SIP trunk.

Create a SIP trunk from one JSON object with name, direction, and the outbound and inbound sections the direction needs. Keep passwords in the input file or stdin, not in arguments. A trunk that accepts calls from your PBX returns its password once, followed by the SIP address your PBX sends calls to. Requires a server API key.

### Usage

```bash
polymorfa sip-trunk create [flags]
```

### Flags

- `--input <value>` (value, required). Read the SIP trunk JSON object from a file or stdin (-).

Also accepts the [global flags](https://docs.polymorfa.com/cli#global-flags).

### Examples

```bash
polymorfa sip-trunk create --project 018f0000-0000-7000-8000-000000000002 --input trunk.json
```

## polymorfa sip-trunk delete

Delete a SIP trunk.

Delete a SIP trunk and its credentials. Fails with sip_trunk_in_use while a session routes incoming calls to it. Requires a server API key.

### Usage

```bash
polymorfa sip-trunk delete TRUNK [flags]
```

### Arguments

- `TRUNK` (required). SIP trunk ID.

### Flags

- `--yes` (boolean, required). Confirm permanent deletion of the trunk.

Also accepts the [global flags](https://docs.polymorfa.com/cli#global-flags).

## polymorfa sip-trunk endpoint

Show the SIP address for your PBX.

Show the host and ports your PBX sends SIP to, whether each transport requires SRTP, and the UDP port range call audio uses. The address is the same for every trunk. When this environment does not host SIP, the command says so and prints no address. Requires a server API key.

### Usage

```bash
polymorfa sip-trunk endpoint [flags]
```

### Flags

Also accepts the [global flags](https://docs.polymorfa.com/cli#global-flags).

### Examples

```bash
polymorfa sip-trunk endpoint
```

```bash
polymorfa sip-trunk endpoint --json
```

## polymorfa sip-trunk list

List SIP trunks.

List the SIP trunks of a project. Passwords are never returned. Requires a server API key.

### Usage

```bash
polymorfa sip-trunk list [flags]
```

### Flags

Also accepts the [global flags](https://docs.polymorfa.com/cli#global-flags).

### Examples

```bash
polymorfa sip-trunk list --project 018f0000-0000-7000-8000-000000000002
```

## polymorfa sip-trunk rotate-credentials

Rotate SIP trunk credentials.

Replace the password your PBX uses to place calls through the trunk and print it once with the SIP address your PBX sends calls to. The previous password stops working within about a minute. Requires a server API key.

### Usage

```bash
polymorfa sip-trunk rotate-credentials TRUNK [flags]
```

### Arguments

- `TRUNK` (required). SIP trunk ID.

### Flags

- `--yes` (boolean, required). Confirm that the current password will stop working.

Also accepts the [global flags](https://docs.polymorfa.com/cli#global-flags).

## polymorfa sip-trunk update

Change a SIP trunk.

Change a SIP trunk. Fields you omit keep their values; omit authPassword to keep the stored password. Changes reach new calls within about a minute. Requires a server API key.

### Usage

```bash
polymorfa sip-trunk update TRUNK [flags]
```

### Arguments

- `TRUNK` (required). SIP trunk ID.

### Flags

- `--disable` (boolean). Stop new calls on the trunk.
- `--enable` (boolean). Allow new calls on the trunk.
- `--expected-revision <value>` (value). Refuse the change if the trunk no longer has this revision.
- `--input <value>` (value). Read the JSON changes from a file or stdin (-).

Also accepts the [global flags](https://docs.polymorfa.com/cli#global-flags).

### Examples

```bash
polymorfa sip-trunk update 6f1c2f0e-1d5b-4d8e-9a55-0d4b8a6c1f10 --disable --expected-revision 3
```

```bash
polymorfa sip-trunk update 6f1c2f0e-1d5b-4d8e-9a55-0d4b8a6c1f10 --input changes.json
```

## polymorfa sip-trunk view

Show a SIP trunk.

Show one SIP trunk, including its revision for guarded updates. Requires a server API key.

### Usage

```bash
polymorfa sip-trunk view TRUNK [flags]
```

### Arguments

- `TRUNK` (required). SIP trunk ID.

### Flags

Also accepts the [global flags](https://docs.polymorfa.com/cli#global-flags).
