Call Flow Fundamentals
🇹🇭 ภาษาไทย
หลักการพื้นฐาน — PBX เป็นศูนย์กลาง
PBX (Private Branch Exchange) คือตัวกลางของระบบโทรศัพท์ทุกสาย — ไม่ว่าจะโทรเข้า โทรออก หรือโทรภายใน ทุก call ต้องผ่าน PBX เสมอ
PSTN/Provider ↔ [SIP Trunk] ↔ [PBX] ↔ [Extension/IP Phone]
↕
IVR / Queue / Ring Group
ประเภทสายโทรศัพท์มี 3 ประเภท:
| ประเภท | ทิศทาง | ตัวอย่าง |
|---|---|---|
| Inbound | PSTN → Extension | ลูกค้าโทรเข้าออฟฟิค |
| Outbound | Extension → PSTN | พนักงานโทรออกนอก |
| Internal | Extension ↔ Extension | พนักงานโทรหากันภายใน |
สายขาเข้า (Inbound Call)
Flow ทั้งหมด:
ผู้โทรกดเบอร์
→ PSTN/Provider
→ SIP Trunk (PBX receives)
→ Inbound Route (filters: DID + CID + Time Condition)
→ Destination: IVR / Ring Group / Queue / Extension / Voicemail
→ IP Phone rings
Inbound Route — Filters
Inbound Route จะกรองสายเข้าตาม 3 เงื่อนไข:
| Filter | ความหมาย | ตัวอย่าง |
|---|---|---|
| DID (Direct Inward Dial) | เบอร์ที่ผู้โทรกด (ปลายทาง) | 02-xxx-1000 → แผนก Sales |
| CID (Caller ID) | เบอร์ของผู้โทร (ต้นทาง) | 0800000000 → VIP route |
| Time Condition | ช่วงเวลา | วันทำการ 08:00–18:00 → IVR, นอกเวลา → Voicemail |
IVR (Interactive Voice Response)
ผู้โทรเข้า IVR
→ เล่นเสียงต้อนรับ
→ รอ DTMF (กด 1 / 2 / 3 …)
├─ กด 1 → Ring Group Sales
├─ กด 2 → Queue Support
├─ กด 0 → Operator
├─ Timeout (ไม่กดภายเวลา) → Default destination
└─ Invalid (กดเบอร์ที่ไม่มี) → Repeat / Voicemail
Ring Group vs Queue
| หัวข้อ | Ring Group | Queue |
|---|---|---|
| Use case | ทีมเล็ก, ทุกคนรับได้ | Call center, สาย inbound หนาแน่น |
| Ring method | Ring all พร้อมกัน / Linear / Memory hunt | Round robin / Least recent / Fewest calls / Skill-based |
| ประสบการณ์ผู้โทร | รอสั้น, ไม่มีการรายงานตำแหน่งคิว | ได้ยิน MOH + “คุณคือคนที่ X ในคิว” |
| Failover | No answer → Voicemail / IVR | Queue timeout → Failover destination |
| Extra features | BLF pickup | SLA, Wallboard, skill-based routing, agent wrap-up time |
สายขาออก (Outbound Call)
Flow ทั้งหมด:
พนักงานกดเบอร์
→ PBX receives digits
→ Outbound Route (matches dial pattern + checks extension permissions)
→ Strip prefix / Prepend prefix
→ Select SIP Trunk
→ Provider → destination rings
Outbound Route — Components
| Field | ความหมาย | ตัวอย่าง |
|---|---|---|
| Dial Pattern | Pattern ที่ match กับเบอร์ที่กด | 0. = เบอร์ขึ้นต้นด้วย 0 |
| Strip | ตัดตัวอักษรหน้าออกกี่ตัว | Strip 1 → ตัด 0 ออก |
| Prepend | เติมตัวอักษรหน้า | 66 → แปลง 0xx เป็น 66xx |
| Trunk | SIP Trunk ที่ใช้ส่งสาย | SIP Trunk หลัก / GSM Gateway |
| Caller ID (Outbound CID) | เบอร์ที่แสดงที่ปลายทาง | 020001234 |
| PIN | รหัสผ่านก่อนโทร | เส้นทาง International ต้องใส่ PIN |
ตัวอย่าง Outbound Routes
| Route | Dial Pattern | Strip | Prepend | Trunk | หมายเหตุ |
|---|---|---|---|---|---|
| Internal | [1-9]XXX | 0 | — | ไม่มี (internal) | Extension 4 หลัก |
| Local/Mobile | 0. | 0 | — | SIP Trunk | เบอร์ขึ้นต้น 0 |
| International | 00. | 0 | — | SIP Trunk | ต้องใส่ PIN |
| GSM Mobile | 06.|08.|09. | 0 | — | GSM Gateway | ผ่าน TG gateway |
สายภายใน (Internal Call)
Extension กดเบอร์ภายใน
→ PBX ตรวจ dial plan
→ match extension ที่ registered
→ ring โดยตรง (ไม่ผ่าน trunk)
→ ฟรี ไม่มีค่าใช้จ่าย
Internal call ไม่ใช้ SIP Trunk เลย — PBX จัดการ routing ภายในทั้งหมด
Multi-Site (ข้ามสาขา)
สำหรับองค์กรที่มีหลายสาขา สามารถเชื่อม PBX เข้าหากันผ่าน Inter-site SIP Trunk:
HQ PBX ↔ [Inter-site SIP Trunk] ↔ Branch PBX
ตัวอย่าง: พนักงาน HQ กด 2000
Ext 1000 (HQ) กด 2000
→ HQ Outbound Route (pattern 2XXX → Inter-site Trunk)
→ Inter-site SIP Trunk
→ Branch Inbound Route (DID 2000–2050 → Extension)
→ Branch Ext 2000 rings
ดูรายละเอียดเพิ่มเติม: Yeastar P-Series Multi-Site PBX Interconnection
ภาพรวม Component ทั้งระบบ
┌─────────────────────────────────┐
PSTN/SIP Provider ───┤ ├──► IVR
│ ├──► Ring Group
GSM/4G Gateway ────┤ PBX (Yeastar) ├──► Queue
│ ├──► Extension / IP Phone
E1/T1 Gateway ────┤ ├──► Voicemail
└─────────────────────────────────┘
│ ▲
Outbound Inbound
Routes Routes
│
SIP Trunk / GSM / E1
│
Provider / PSTN / Mobile
Inbound path: Provider → SIP Trunk → Inbound Route → IVR/Ring Group/Queue/Extension/Voicemail
Outbound path: Extension → Outbound Route (dial pattern match) → Strip/Prepend → SIP Trunk → Provider
ความเชื่อมโยง
- VoIP Phone System — ภาพรวม component ของระบบ VoIP
- Yeastar P-Series Admin Guide — การตั้งค่า trunk, IVR, queue, ring group
- Yeastar P-Series Call Center — advanced queue/agent management
- Yeastar P-Series Call Flow Designer — visual call flow builder แบบ drag-and-drop
- Yeastar P-Series Multi-Site PBX Interconnection — การโทรข้ามสาขา
- Yeastar P-Series API — call control ผ่าน API (
call/dial,call/transfer, events)
🇬🇧 English
Core Principle — PBX as the Hub
The PBX (Private Branch Exchange) is the intermediary for every phone call — inbound, outbound, and internal. All calls are routed through it.
PSTN/Provider ↔ [SIP Trunk] ↔ [PBX] ↔ [Extension/IP Phone]
↕
IVR / Queue / Ring Group
Three call types:
| Type | Direction | Example |
|---|---|---|
| Inbound | PSTN → Extension | Customer calls the office |
| Outbound | Extension → PSTN | Staff dials an external number |
| Internal | Extension ↔ Extension | Staff calls another desk directly |
Inbound Call — Full Flow
Caller dials number
→ PSTN/Provider
→ SIP Trunk (PBX receives)
→ Inbound Route (filters: DID + CID + Time Condition)
→ Destination: IVR / Ring Group / Queue / Extension / Voicemail
→ IP Phone rings
Inbound Route Filters
| Filter | Meaning | Example |
|---|---|---|
| DID (Direct Inward Dial) | The number the caller dialed (destination) | 02-xxx-1000 → Sales dept |
| CID (Caller ID) | The caller’s number (source) | 0800000000 → VIP route |
| Time Condition | Time of day / day of week | Business hours 08:00–18:00 → IVR; after hours → Voicemail |
IVR Flow
Caller enters IVR
→ Greeting plays
→ Waits for DTMF input
├─ Press 1 → Sales Ring Group
├─ Press 2 → Support Queue
├─ Press 0 → Operator
├─ Timeout (no key pressed) → Default destination
└─ Invalid input → Repeat prompt / Voicemail
Ring Group vs Queue
| Aspect | Ring Group | Queue |
|---|---|---|
| Use case | Small team, anyone can answer | Call center, high inbound volume |
| Ring method | Ring all simultaneously / Linear / Memory hunt | Round robin / Least recent / Fewest calls / Skill-based |
| Caller experience | Short wait, no position announcement | MOH + “You are caller number X in queue” |
| Failover | No answer → Voicemail / IVR | Queue timeout → Failover destination |
| Extra features | BLF pickup | SLA, Wallboard, skill-based routing, agent wrap-up time |
Outbound Call — Full Flow
Staff dials number
→ PBX receives digits
→ Outbound Route (matches dial pattern + checks extension permissions)
→ Strip prefix / Prepend prefix
→ Select SIP Trunk
→ Provider → destination rings
Outbound Route Components
| Field | Meaning | Example |
|---|---|---|
| Dial Pattern | Pattern matched against the dialed number | 0. = any number starting with 0 |
| Strip | Number of leading characters to remove | Strip 1 → removes leading 0 |
| Prepend | Characters to add before the number | 66 → converts 0xx to 66xx |
| Trunk | SIP Trunk used to send the call | Main SIP Trunk / GSM Gateway |
| Caller ID (Outbound CID) | Number displayed at the destination | 020001234 |
| PIN | Required code before call connects | International routes require a PIN |
Example Outbound Routes
| Route | Dial Pattern | Strip | Prepend | Trunk | Notes |
|---|---|---|---|---|---|
| Internal | [1-9]XXX | 0 | — | None (internal) | 4-digit extensions |
| Local/Mobile | 0. | 0 | — | SIP Trunk | Any number starting with 0 |
| International | 00. | 0 | — | SIP Trunk | PIN required |
| GSM Mobile | 06.|08.|09. | 0 | — | GSM Gateway | Routes via TG gateway |
Internal Call
Extension dials internal number
→ PBX checks dial plan
→ Matches registered extension
→ Rings directly (no trunk used)
→ Free — no carrier cost
Internal calls never touch a SIP Trunk — the PBX handles all routing internally at no cost.
Multi-Site (Inter-Office Calls)
For organizations with multiple branches, PBX systems connect via an Inter-site SIP Trunk:
HQ PBX ↔ [Inter-site SIP Trunk] ↔ Branch PBX
Example: HQ staff dials extension 2000 (Branch)
Ext 1000 (HQ) dials 2000
→ HQ Outbound Route (pattern 2XXX → Inter-site Trunk)
→ Inter-site SIP Trunk
→ Branch Inbound Route (DID 2000–2050 → Extension)
→ Branch Ext 2000 rings
See Yeastar P-Series Multi-Site PBX Interconnection for configuration details.
Full System Architecture
┌─────────────────────────────────┐
PSTN/SIP Provider ───┤ ├──► IVR
│ ├──► Ring Group
GSM/4G Gateway ────┤ PBX (Yeastar) ├──► Queue
│ ├──► Extension / IP Phone
E1/T1 Gateway ────┤ ├──► Voicemail
└─────────────────────────────────┘
│ ▲
Outbound Inbound
Routes Routes
│
SIP Trunk / GSM / E1
│
Provider / PSTN / Mobile
Inbound path: Provider → SIP Trunk → Inbound Route → IVR/Ring Group/Queue/Extension/Voicemail
Outbound path: Extension → Outbound Route (dial pattern match) → Strip/Prepend → SIP Trunk → Provider
Related
- VoIP Phone System — component overview of the VoIP ecosystem
- Yeastar P-Series Admin Guide — trunk, IVR, queue, ring group configuration
- Yeastar P-Series Call Center — advanced queue/agent management
- Yeastar P-Series Call Flow Designer — visual drag-and-drop call flow builder
- Yeastar P-Series Multi-Site PBX Interconnection — inter-site call routing
- Yeastar P-Series API — call control via API (
call/dial,call/transfer, events)