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

# SIP-Trunk aktualisieren

> Aktualisiere eine bestehende SIP-Trunk-Konfiguration in Famulor per API. Ändere Credentials, Routing-Regeln und Rufnummern für KI-Voice-Telefonie.

Dieser Endpunkt aktualisiert einen bestehenden SIP-Trunk. Sende nur die Felder, die du ändern möchtest - partielle Updates werden unterstützt. Änderungen an Zugangsdaten, Adresse oder Proxy-Einstellungen führen automatisch zur erneuten Provisionierung der betroffenen Voice-Trunks.

### Pfad-Parameter

<ParamField path="id" type="integer" required>
  Die eindeutige Kennung des zu aktualisierenden SIP-Trunks
</ParamField>

### Body-Parameter

Alle Felder sind optional. Sende nur die Felder, die du ändern möchtest.

<ParamField body="phone_number" type="string" optional>
  Die SIP-Erweiterung oder Telefonnummer (1-15 Zeichen)
</ParamField>

<ParamField body="nickname" type="string" optional>
  Ein kurzes, menschenlesbares Label für den Trunk. Maximal 50 Zeichen. Sende `null`, um es zu löschen.
</ParamField>

<ParamField body="sip_username" type="string" optional>
  Benutzername für SIP-Authentifizierung (3-128 Zeichen)
</ParamField>

<ParamField body="sip_password" type="string" optional>
  Passwort für SIP-Authentifizierung (mindestens 3 Zeichen)
</ParamField>

<ParamField body="sip_address" type="string" optional>
  SIP-Serveradresse ohne Port
</ParamField>

<ParamField body="sip_calling_format" type="string" optional>
  Ausgehendes Rufnummernformat: `+e164`, `e164` oder `national`
</ParamField>

<ParamField body="inbound_authorization_type" type="string" optional>
  Authentifizierung für eingehende Anrufe: `auth` oder `ip`. Beim Wechsel auf `ip` muss `allowed_inbound_ips` mitgegeben werden. Beim Wechsel auf `auth` wird eine vorhandene IP-Whitelist entfernt.
</ParamField>

<ParamField body="allowed_inbound_ips" type="array" optional>
  Array erlaubter IP-Adressen für eingehende Anrufe. **Pflichtfeld**, wenn `inbound_authorization_type` auf `ip` gesetzt wird.
</ParamField>

<ParamField body="country_code" type="string" optional>
  ISO-3166-2-Ländercode
</ParamField>

<ParamField body="outbound_proxy" type="boolean" optional>
  Leitet ausgehende Anrufe über eine feste IP-Adresse
</ParamField>

### Antwort

<ResponseField name="message" type="string">
  Erfolgsmeldung
</ResponseField>

<ResponseField name="data" type="object">
  Das aktualisierte SIP-Trunk-Objekt (gleiche Felder wie bei [SIP-Trunk abrufen](/de/api-reference/sip-trunks/get))
</ResponseField>

<ResponseExample>
  ```json 200 Updated credentials theme={null} theme={null}
  {
    "message": "SIP trunk updated successfully.",
    "data": {
      "id": 42,
      "phone_number": "1000",
      "nickname": "Provider X — Haupt",
      "sip_username": "new_username",
      "sip_address": "sip.provider.com",
      "sip_calling_format": "+e164",
      "inbound_authorization_type": "auth",
      "allowed_inbound_ips": null,
      "outbound_proxy": false,
      "country_code": "US",
      "inbound_trunk_id": "ST_newtrunkid1",
      "outbound_trunk_id": "ST_newtrunkid2",
      "created_at": "2026-03-31T10:00:00.000000Z",
      "updated_at": "2026-03-31T12:00:00.000000Z"
    }
  }
  ```

  ```json 200 Switched to IP auth theme={null} theme={null}
  {
    "message": "SIP trunk updated successfully.",
    "data": {
      "id": 42,
      "phone_number": "1000",
      "nickname": "Provider X — Haupt",
      "sip_username": "myuser",
      "sip_address": "sip.provider.com",
      "sip_calling_format": "+e164",
      "inbound_authorization_type": "ip",
      "allowed_inbound_ips": ["203.0.113.10"],
      "outbound_proxy": false,
      "country_code": "US",
      "inbound_trunk_id": "ST_newtrunkid1",
      "outbound_trunk_id": "ST_yyyyyyyyyyyy",
      "created_at": "2026-03-31T10:00:00.000000Z",
      "updated_at": "2026-03-31T12:00:00.000000Z"
    }
  }
  ```

  ```json 404 Not Found theme={null} theme={null}
  {
    "error": "SIP trunk not found."
  }
  ```

  ```json 422 Validation Error theme={null} theme={null}
  {
    "message": "The given data was invalid.",
    "errors": {
      "allowed_inbound_ips": ["At least one allowed IP address is required when authorization type is \"ip\"."]
    }
  }
  ```

  ```json 500 Provisioning Error theme={null} theme={null}
  {
    "error": "Failed to update SIP trunk. Please try again or contact support."
  }
  ```
</ResponseExample>

### Re-Provisionierungsverhalten

Die folgenden Feld-Änderungen lösen eine automatische Re-Provisionierung der Voice-Infrastruktur-Trunks aus:

| Geändertes Feld              | Inbound-Trunk | Outbound-Trunk |
| ---------------------------- | :-----------: | :------------: |
| `sip_username`               |  Neu erzeugt  |   Neu erzeugt  |
| `sip_password`               |  Neu erzeugt  |   Neu erzeugt  |
| `sip_address`                |       -       |   Neu erzeugt  |
| `phone_number`               |  Neu erzeugt  |   Neu erzeugt  |
| `inbound_authorization_type` |  Neu erzeugt  |        -       |
| `allowed_inbound_ips`        |  Neu erzeugt  |        -       |
| `outbound_proxy`             |       -       |   Neu erzeugt  |

Felder wie `sip_calling_format` oder `country_code` werden nur lokal gespeichert und lösen keine Re-Provisionierung aus.
