ผลต่างระหว่างรุ่นของ "Session Initiation Protocol"
เนื้อหาที่ลบ เนื้อหาที่เพิ่ม
เพิ่มแม่แบบ: เมสเซนเจอร์ |
เก็บกวาด |
||
บรรทัด 9:
[[โพรโทคอล]] SIP ถูกออกแบบมาคล้ายกับ[[โพรโทคอล]] HTTP ในส่วนของการร้องขอและการตอบรับ (request/response) ระหว่างลูกข่าย (client) ซึ่งเป็นผู้เริ่มต้นการเชื่อมต่อ โดยส่งการร้องขอ (request) การทำงานบางอย่างกับเครื่องแม่ข่าย (server) และ SIP ยังใช้ข้อมูล header, กฎการเข้ารหัส และหมายเลขสถานะ (status codes) เหมือนกับ HTTP อีกด้วย
ในการส่งสัญญาณมีเดีย SIP จะต้องทำงานร่วมกับ[[โพรโทคอล]]
เป้าหมายในการออกแบบ[[โพรโทคอล]] SIP ก็เพื่อใช้เป็นมาตรฐานในการเริ่มต้นการส่งสัญญาณโทรศัพท์ (signaling and call setup protocol) บนเครือข่ายแบบ IP-based และสามารถทำงานร่วมกับ public switched telephone network (PSTN) ที่มีอยู่เดิมได้ทันที และ SIP ถูกออกแบบมาโดยอ้างอิงถึงการเชื่อมต่อกันระว่าง proxy server และ user agents เพื่อให้มีลักษณะคล้ายกับการทำงานของโทรศัพท์มากที่สุด เช่น การส่งหมายเลข (dialing a number), การส่งสัญญาณกระดิ่ง (ringing), การส่งสัญญาญรอการเชื่อมต่อ (ring back) และการส่งสัญญาณสายไม่ว่าง (busy tone)
บรรทัด 27:
* Network Servers แบ่งออกเป็น 2 ชนิด
# Proxy server มี 2 ชนิดคือแบบ Stateful และ Stateless แบบ Stateful จะจำเซสชั่นการร้องขอของแต่ละไคล์เอนต์ที่กำลังรอการตอบกลับไว้และจะไม่ทำการส่งต่อการร้องขอซ้ำที่มาจากเซสชั่นที่เดิม ส่วน Stateless จะไม่มีการเก็บเซสชั่น ดังนั้นการร้องขอซ้ำจะถูกส่งต่อไปยังปลายทางทุกครั้งเพราะ Stateless จะไม่มีการจดจำว่าเคยส่งไปแล้วหรือยัง โดยทั้งสองแบบจะทำหน้าเป็นทั้ง UAC และ UAS ที่ทำหน้าที่รับและส่งต่อ SIP Message ของไคลเอนต์ไปยังเครื่องแม่ข่าย
# Redirect server จะทำหน้าที่รับ SIP request จากไคลเอนต์ จากนั้นจะส่งผลลัพธ์เป็นที่อยู่ของเครื่องแม่ข่ายถัดไปไปยังเครื่องไคลเอนต์ โดยที่ Redirect server จะไม่มีการส่งต่อข้อมูล SIP messages ไปยังเครื่องแม่ข่าย
* การกำหนดที่อยู่ของผู้รับและผู้ส่ง (Addressing) SIP จะระบุที่อยู่ของผู้รับและผู้ส่งในรูปแบบของ SIP URLs (SIP Universal Resource Locators) โดยจะอยู่ในรูปแบบ sip:ชื่อยูสเซอร์@ที่อยู่เครื่อง ตัวอย่างเช่น sip:john@example.com, sip:6680001@111.11.11.1 เป็นต้น
== ตัวอย่าง SIP's Call flow ==
* แบบ Point to Point
| |
|
| |
|
|
| |
|
| |
* แบบ Via Proxy server โทรจาก John's Soft phone ไปยัง Bob's SIP Phone โดยที่ John's Soft phone ส่งข้อมูลผ่าน Proxy server ที่ชื่อ site-a.com ส่วน Bob's SIP Phone ส่งข้อมูลผ่าน Proxy server ที่ชื่อ site-b.com
site-a.com............site-b.com
. proxy proxy .
. .
softphone SIP Phone
▲ John's .......................................................... Bob's
| | | |
John | 1. INVITE | | |
เริ่มต้นโทรออก |-----------------> | 2. INVITE | |
| 3. 100
|
John | | 7. 180 Ringing |<---------------- | ได้ยินสัญญาณโทรเข้า
ได้ยิน Ringback
หรือ Music
| 12. ACK F12 |
| RTP Media Session |
▲ |--------------------------------------------------------> |
| 13. BYE |
▲ สนทนา |<==============================> | สนทนา
| 14. 200 OK |
▲ |<-------------------------------------------------------- | Bob วางหู
| |
▲ John วางหู |--------------------------------------------------------> |
== ตัวอย่าง SIP Request ==
== รายละเอียดของ SIP Messages ==
เส้น 137 ⟶ 130:
! Code !! Description !! References
|-
| 200 || OK. ||
|-
| 202 || Accepted. || RFC 3265
|-
| 204 || No Notification. ||
|}
เส้น 152 ⟶ 145:
| 300 || Multiple choices. || RFC 3261
|-
| 301 || Moved permanently. ||
|-
| 302 || Moved temporarily. ||
|-
| 305 || Use proxy. ||
|-
| 380 || Alternative service. ||
|}
เส้น 167 ⟶ 160:
! Code !! Description !! References
|-
| 400 || Bad request. ||
|-
| 401 || Unauthorized. ||
|-
| 402 || Payment required. ||
|-
| 403 || Forbidden. ||
|-
| 404 || Not found. ||
|-
| 405 || Bad request. ||
|-
| 406 || Not acceptable. ||
|-
| 407 || Proxy authentication required. ||
|-
| 408 || Request timeout. ||
|-
| 410 || Gone. ||
|-
| 412 || Conditional request failed. || RFC 3903
|-
| 413 || Request entity too large. ||
|-
| 414 || Request-URI too long. ||
|-
| 415 || Unsupported media type. ||
|-
| 416 || Unsupported URI scheme. ||
|-
| 417 || Unknown Resource-Priority. || RFC 4412
|-
| 420 || Bad extension. ||
|-
| 421 || Extension required. ||
|-
| 422 || Session Interval too small. || RFC 4028
|-
| 423 || Interval too brief. ||
|-
| 428 || Use Identity Header. || RFC 4474
เส้น 225 ⟶ 218:
| 470 || Consent needed. || RFC 5360
|-
| 480 || Temporarily unavailable. ||
|-
| 481 || Call/Transaction does not exist. ||
|-
| 482 || Loop detected. ||
|-
| 483 || Too many hops. ||
|-
| 484 || Address incomplete. ||
|-
| 485 || Ambiguous. ||
|-
| 486 || Busy here. ||
|-
| 487 || Request terminated. ||
|-
| 488 || Not acceptable here. ||
|-
| 489 || Bad event. || RFC 3265
|-
| 491 || Request pending. ||
|-
| 493 || Undecipherable. ||
|-
| 494 || Security agreement required. || RFC 3329
|}
5xx: การตอบกลับข้อผิดพลาดที่เกิดจากเครื่องแม่ข่าย (Server error)
เส้น 261 ⟶ 253:
| 500 || Server internal error. || RFC 3261
|-
| 501 || Not implemented. ||
|-
| 502 || Bad gateway. ||
|-
| 503 || Service unavailable. || RFC 3261
|-
| 504 || Server timeout. ||
|-
| 505 || Version not supported. ||
|-
| 513 || Message too large. ||
|-
| 580 || Precondition Failure. || RFC 3312
เส้น 282 ⟶ 274:
! Code !! Description !! References
|-
| 600 || Busy everywhere. ||
|-
| 603 || Decline. ||
|-
| 604 || Does not exist anywhere. ||
|-
| 606 || Not acceptable. ||
|}
== ตัวอย่างภาษา Perl ==
#
#
#
#
{{เมสเซนเจอร์}}
|