Call Flow Fundamentals

🇹🇭 ภาษาไทย

หลักการพื้นฐาน — PBX เป็นศูนย์กลาง

PBX (Private Branch Exchange) คือตัวกลางของระบบโทรศัพท์ทุกสาย — ไม่ว่าจะโทรเข้า โทรออก หรือโทรภายใน ทุก call ต้องผ่าน PBX เสมอ

PSTN/Provider ↔ [SIP Trunk] ↔ [PBX] ↔ [Extension/IP Phone]
                                  ↕
                           IVR / Queue / Ring Group

ประเภทสายโทรศัพท์มี 3 ประเภท:

ประเภททิศทางตัวอย่าง
InboundPSTN → Extensionลูกค้าโทรเข้าออฟฟิค
OutboundExtension → PSTNพนักงานโทรออกนอก
InternalExtension ↔ 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 GroupQueue
Use caseทีมเล็ก, ทุกคนรับได้Call center, สาย inbound หนาแน่น
Ring methodRing all พร้อมกัน / Linear / Memory huntRound robin / Least recent / Fewest calls / Skill-based
ประสบการณ์ผู้โทรรอสั้น, ไม่มีการรายงานตำแหน่งคิวได้ยิน MOH + “คุณคือคนที่ X ในคิว”
FailoverNo answer → Voicemail / IVRQueue timeout → Failover destination
Extra featuresBLF pickupSLA, 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 PatternPattern ที่ match กับเบอร์ที่กด0. = เบอร์ขึ้นต้นด้วย 0
Stripตัดตัวอักษรหน้าออกกี่ตัวStrip 1 → ตัด 0 ออก
Prependเติมตัวอักษรหน้า66 → แปลง 0xx เป็น 66xx
TrunkSIP Trunk ที่ใช้ส่งสายSIP Trunk หลัก / GSM Gateway
Caller ID (Outbound CID)เบอร์ที่แสดงที่ปลายทาง020001234
PINรหัสผ่านก่อนโทรเส้นทาง International ต้องใส่ PIN

ตัวอย่าง Outbound Routes

RouteDial PatternStripPrependTrunkหมายเหตุ
Internal[1-9]XXX0ไม่มี (internal)Extension 4 หลัก
Local/Mobile0.0SIP Trunkเบอร์ขึ้นต้น 0
International00.0SIP Trunkต้องใส่ PIN
GSM Mobile06.|08.|09.0GSM 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


ความเชื่อมโยง


🇬🇧 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:

TypeDirectionExample
InboundPSTN → ExtensionCustomer calls the office
OutboundExtension → PSTNStaff dials an external number
InternalExtension ↔ ExtensionStaff 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

FilterMeaningExample
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 ConditionTime of day / day of weekBusiness 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

AspectRing GroupQueue
Use caseSmall team, anyone can answerCall center, high inbound volume
Ring methodRing all simultaneously / Linear / Memory huntRound robin / Least recent / Fewest calls / Skill-based
Caller experienceShort wait, no position announcementMOH + “You are caller number X in queue”
FailoverNo answer → Voicemail / IVRQueue timeout → Failover destination
Extra featuresBLF pickupSLA, 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

FieldMeaningExample
Dial PatternPattern matched against the dialed number0. = any number starting with 0
StripNumber of leading characters to removeStrip 1 → removes leading 0
PrependCharacters to add before the number66 → converts 0xx to 66xx
TrunkSIP Trunk used to send the callMain SIP Trunk / GSM Gateway
Caller ID (Outbound CID)Number displayed at the destination020001234
PINRequired code before call connectsInternational routes require a PIN

Example Outbound Routes

RouteDial PatternStripPrependTrunkNotes
Internal[1-9]XXX0None (internal)4-digit extensions
Local/Mobile0.0SIP TrunkAny number starting with 0
International00.0SIP TrunkPIN required
GSM Mobile06.|08.|09.0GSM GatewayRoutes 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