วิธีที่ 1: IP Peering
หลักการทำงาน
ทั้งสองฝั่งจะ “ไว้ใจ IP ของกันและกัน” สายขาเข้า/ขาออกส่งตรงระหว่าง IP ของลูกค้ากับ Ingfah SIP Server โดยไม่มีการลงทะเบียน (no REGISTER) ลูกค้าต้องเปิด firewall ให้ Ingfah SIP Server IP เข้ามาได้ และในทางกลับกัน Ingfah SIP Server ก็จะ whitelist IP ของลูกค้าไว้เช่นกัน
สายเข้า (Inbound)
sequenceDiagram
actor Caller as ผู้โทร
participant PBX as PBX ลูกค้า
box rgba(43,127,255,0.1) Ingfah
participant SBC as Ingfah SIP Server
participant AI as Ingfah
end
Caller->>PBX: โทรเข้า DID
PBX->>SBC: INVITE (ตรวจสอบด้วย source IP)
SBC->>AI: ส่งสายต่อ
สายออก (Outbound)
sequenceDiagram
box rgba(43,127,255,0.1) Ingfah
participant AI as Ingfah
participant SBC as Ingfah SIP Server
end
participant PBX as PBX ลูกค้า
participant PSTN as PSTN
AI->>SBC: เริ่มโทรออก
SBC->>PBX: INVITE sip:number@server (IP whitelist)
PBX->>PSTN: ส่งออก PSTN
ข้อมูลที่ต้องเตรียม
| ฟิลด์ | จำเป็น | คำอธิบาย | ตัวอย่าง / default |
|---|---|---|---|
name | ✓ | ชื่อย่อใช้แทน trunk นี้ (ตัวอักษรอังกฤษ ไม่มีช่องว่าง) | "abc-corp" |
server | ✓ | IP สาธารณะหรือ FQDN ของระบบ SIP ลูกค้า | "27.254.205.133" |
port | — | SIP signaling port | default 5060 |
transport | — | "udp" หรือ "tls" (ปลอดภัยกว่า ต้องใช้ cert) | default "udp" |
codec | — | Array ของ codec ตามลำดับ: ["g722","ulaw"] (HD + fallback, แนะนำ) หรือ ["ulaw"] | default ["g722","ulaw"] |
sip_user | ✓ | SIP identity — user-part ของ SIP URI (From:, Contact:) | "021088503" |
number | — | หมายเลข PSTN หรือ extension; routing key สำหรับโทรออก ถ้าต่างจาก sip_user ให้ระบุ | default = sip_user |
direction | — | "inbound", "outbound", หรือ "both" | default "both" |
สิ่งที่ลูกค้าต้องทำในระบบของตน
- เปิด firewall ให้รับ SIP/RTP จาก Ingfah SIP Server IP (ดู endpoint ที่ทีมงานส่งให้)
- SIP: UDP 5060 หรือ TLS 5061
- RTP: source port 10000–20000/udp (ปลายทาง RTP ฝั่งท่านใช้ port range ของ PBX ตัวเอง — ไม่ต้องเปิด 10000–20000 ฝั่งตน)
- กำหนดให้ระบบ route สายไปยัง Ingfah SIP Server endpoint ที่ทีมงานส่งให้
- หากใช้ TLS: ตรวจสอบ CN/SAN ของ cert ให้ตรงกับ hostname ที่ได้รับ
- ตกลง codec กับทีมงาน — ฝั่ง ingfah แนะนำ
g722เพื่อคุณภาพ HD; ใช้ulawเฉพาะเมื่อฝั่งลูกค้าไม่รองรับ g722
แบบฟอร์มเชื่อมต่อ
กรุณา copy ฟอร์มด้านล่าง กรอกข้อมูลให้ครบ แล้วส่งกลับให้ทีมงาน
========== IP PEERING TRUNK ==========ชื่อบริษัท/โครงการ : ____________________ผู้ติดต่อ : ____________________อีเมล / เบอร์โทร : ____________________
[ข้อมูลทางเทคนิค]name : ____________________ (ชื่อย่อ ภาษาอังกฤษ)server : ____________________ (IP สาธารณะหรือ FQDN ของระบบท่าน)port : ____________________ (default 5060)transport : [ ] udp [ ] tlscodec : [ ] g722 (แนะนำ) [ ] ulawsip_user : ____________________ (SIP identity — ใช้ใน From: header)number : ____________________ (ระบุเฉพาะถ้าต่างจาก sip_user)
[ทิศทางการใช้งาน]direction : [ ] inbound [ ] outbound [ ] both (default)
[Firewall checklist][ ] อนุญาต SIP จาก Ingfah SIP Server IP (UDP 5060 หรือ TLS 5061)[ ] อนุญาต RTP จาก Ingfah SIP Server IP source port 10000-20000/udp[ ] route สายของหมายเลขไปยัง Ingfah SIP Server endpoint