# Yeastar

## How Voice Logica connects

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

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

## 1. Create the connection in Voice Logica

**Telephony - Trunks - Connect your PBX**, pick **Yeastar P-Series** or **Yeastar S-Series** and the agent. Keep the dialog open until it says **Connected**.

## 2. Add the trunk, routes and transfers

<Tabs syncKey="yeastar">
<TabItem label="P-Series">

1. **Extension and Trunk → Trunk → Add**. Name `Voice Logica`, **Trunk Status** Enabled, **ITSP Template** General.
2. **Trunk Type** = Register Trunk. **Transport** UDP, **Hostname/IP** = the server, **Port** 5060, **Domain** = the server.
3. **Username** and **Authentication Name** = the username, **Password** = the password.
4. **Advanced → Codec Setting**: G.711 A-law first, then u-law. **Advanced → VoIP Setting → DTMF Mode** = RFC4733 (RFC2833), **Qualify** on.
5. **Save** and **Apply**. The trunk list shows the registration status.

**Send calls to the agent:** **Call Control → Outbound Route → Add**, a dial pattern (for example a short code) with the Voice Logica trunk, or send an IVR option, a queue's failover or after-hours calls to it.

**Transfers back:** **Call Control → Inbound Route → Add**, **Trunk** = Voice Logica, **DID Pattern** matching your extensions, destination the extensions.

</TabItem>
<TabItem label="S-Series">

1. **Settings → PBX → Trunks → Add**, type **Register Trunk** (VoIP).
2. **Transport** UDP, **Hostname/IP** = the server, **Port** 5060, **Domain** = the server.
3. **Username** and **Authentication Name** = the username, **Password** = the password.
4. Advanced: **DTMF Mode** RFC2833, **Qualify** on. Codecs: G.711 A-law, then u-law.
5. **Save** and **Apply**. Check the trunk in **PBX Monitor**.

**Send calls to the agent:** **Settings → PBX → Call Control → Outbound Routes** with the Voice Logica trunk, or an IVR option pointing at it.

**Transfers back:** **Settings → PBX → Call Control → Inbound Routes**, **Member Trunks** = Voice Logica, destination your extensions.

</TabItem>
</Tabs>

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.

## 3. Check it works

- The dialog says **Connected**; the trunk's **SIP logs** in Voice Logica show each REGISTER and our reply.
- Call the route from an extension: the call appears in **Calls**.
- Ask the agent for a colleague: the extension rings.

## Good to know

- The Yeastar firewall blocks SIP from outside the PBX's own subnet by default. The trunk registers out, so it is not affected, but an [edge device](https://docs.voicelogica.ai/telephony/edge-device/) on another subnet must be allowed in the PBX firewall.
- Turn off **SIP ALG** on the office router.
- A Warm transfer uses two trunk channels until it connects.
