# Grandstream UCM

## How Voice Logica connects

The UCM **registers a SIP trunk to Voice Logica** ([way 1](https://docs.voicelogica.ai/phone-systems/#the-four-ways-voice-logica-connects)). Voice Logica creates the trunk and gives you a server, a username and a password; on the UCM it is a normal **Register SIP Trunk**, as with any phone provider. The UCM connects out, so no port forwarding is needed.

- Calls the UCM sends to this trunk are answered by the AI agent.
- The agent transfers callers back over the same trunk, and the UCM rings the extension through an inbound route.

No licence is needed: SIP trunks are built into every UCM. The same menus apply to the UCM6300 / 6300A, UCM6200 (end of life), UCM6510 and CloudUCM.

## 1. Create the connection in Voice Logica

**Telephony - Trunks - Connect your PBX**, pick **Grandstream UCM** and the agent. Keep the dialog open: it shows the values and changes to **Connected** when the UCM registers.

## 2. Add the trunk on the UCM

1. **Extension/Trunk → VoIP Trunks → Add**, type **Register SIP Trunk**.
2. **Provider Name** `Voice Logica`. **Host Name** = the server from the dialog (port 5060). **Transport** UDP.
3. **Username** and **Auth ID** = the username, **Password** = the password.
4. Leave **Keep Trunk CID** off, so each extension's caller ID is kept.
5. **Advanced Settings**: **Codec Preference** PCMA first, then PCMU. **DTMF Mode** = RFC4733. Turn on **Enable Heartbeat Detection**. Leave **Auth Trunk** off: with it on, the UCM challenges our calls and transfers back fail.
6. **Save** and **Apply Changes**. The trunk shows as registered within a minute.

**UCM6100 (older firmware):** the same fields are under **PBX → Basic/Call Routes → VoIP Trunks → Create New Trunk**, and routes under **PBX → Basic/Call Routes**.

## 3. Send calls to the agent

Choose which calls the agent answers:

- **A short code or prefix:** **Extension/Trunk → Outbound Routes → Add**, with a **Pattern** (for example `_9XX` or a dedicated code) and **Use Trunk** = the Voice Logica trunk.
- **A number, an IVR option, a ring group or queue overflow, after-hours calls:** point that destination at the outbound route above.

## 4. Let the agent transfer back to extensions

**Extension/Trunk → Inbound Routes → Add** for the Voice Logica trunk: **DID Pattern** that matches your extensions (for example `_2XX`), destination **By DID** or the extension. Then, in Voice Logica, add the extensions as transfer destinations on the agent: an **External** destination with the extension number (for example `201`), or a **User** with that extension. Use **Warm** transfer, so the agent comes back and takes a message when nobody answers.

## 5. Check it works

- The dialog says **Connected**. In Voice Logica, the trunk's **SIP logs** show each REGISTER and our reply.
- Dial the short code or the number from an extension: the call appears in **Calls** with the agent.
- Ask the agent for a colleague: the extension rings.

## Good to know

- **Behind NAT:** **PBX Settings → SIP Settings → NAT**, set **External Host** (your public IP or hostname) and **Local Network Address**. On UCM630x, also turn off **UCM RemoteConnect** (MediaNAT traversal) if trunk audio is one-way.
- Turn off **SIP ALG** on the office router.
- Each call with the agent uses one trunk channel; a Warm transfer uses two until it connects.
- No trunk at all? A UCM can also take Voice Logica as an extension through an [edge device](https://docs.voicelogica.ai/telephony/edge-device/), but the trunk is simpler.
