VoIP Protocols > SIP
SIP is a text-based protocol that uses a similar semantic to HTTP. The UAC make requests and the UAS return answers to client requests. SIP defines the communication through two types of messages. The requests (methods) and the answers (state codes) use the generic format of the RFC 2822. They have an initial line followed by one or more header fields, an empty line that shows the end of the head, and finally, the body of the message (optional).
- SIP Methods
The most important thing of SIP Requests is the initial line of the message, called Request-Line. It contains the method name, the request address identifier (Request-URI) and the SIP protocol version. There are six basic methods (defined in RFC 254) for the client requests:
- INVITE: Let invite a user or a service to a new session or to modify parameters of a established session.
- ACK: Confirm the session establishment
- OPTION: Request information about the capabilities of a server
- BYE: End of a session
- CANCEL: Cancel a pending request.
- REGISTER: Register the user agent.
However there are additional methods that can be used. For example INFO, SUBSCRIBER, etc. (published in other RFCs)
For example you can see here a real example of a register method:
Via: SIP/2.0/UDP 192.168.0.100:5060;rport;branch=z9hG4bK646464100000000b43c52d6c00000d1200000f03
Content-Length: 0
Contact: <sip:20000@192.168.0.100:5060>
Call-ID: ED9A8038-A29D-40AB-95B1-0F5F5E905574@192.168.0.100
CSeq: 36 REGISTER
From: <sip:20000@192.168.0.101>;tag=910033437093
Max-Forwards: 70
To: <sip:20000@192.168.0.101>
User-Agent: SJphone/1.60.289a (SJ Labs)
Authorization: Digest username="20000",realm="192.168.0.101",nonce="43c52e9d29317c0bf1f885b9aaff1522d93c7692"
,uri="192.168.0.101",response="f69463b8d3efdb87c388efa9be1a1e63"
- SIP Answers (State Codes) .
After a SIP request message, the receiver answers with a message. This message, is similar to the previous one, but the first line, called Status-Line, that contains the SIP version , the answer code (Status-Code) and a small description (Reason-Phrase). The code of the answer is made up of three digits that allow classify the different types. The first digit defines the answer class
Class Code
1xx - Provisional Messages.
2xx - Success Answers.
3xx - Redirection Answers.
4xx - Method Failures.
5xx - Server Failures.
6xx - Global Failures.
This is a 200 sucess answer example:
Internet Protocol, Src Addr: 192.168.0.101 (192.168.0.101), Dst Addr:
192.168.0.100 (192.168.0.100)
User Datagram Protocol, Src Port: 5060 (5060), Dst Port: 5060 (5060)
Session Initiation Protocol
Status-Line: SIP/2.0 200 OK
Status-Code: 200
Resent Packet: False
Via: SIP/2.0/UDP 192.168.0.100:5060;rport;branch=z9hG4bK646464100000000b43c52d6c00000d1200000f03
Content-Length: 0
Contact: <sip:20100@192.168.0.100:5060>
Call-ID: ED9A8038-A29D-40AB-95B1-0F5F5E905574@100.100.100.16
CSeq: 36 REGISTER
From: <sip:20000@192.168.0.101>;tag=910033437093
Max-Forwards: 70
To: <sip:20000@192.168.0.101:5060>
Authorization: Digest username="20100",realm="192.168.0.101",nonce="43c52e9d29317c0bf1f885b9aaff1522d93c7692",uri="sip:192.168.0.101",
response="f69463b8d3efdb87c388efa9be1a1e63"
- SIP Methods
The most important thing of SIP Requests is the initial line of the message, called Request-Line. It contains the method name, the request address identifier (Request-URI) and the SIP protocol version. There are six basic methods (defined in RFC 254) for the client requests:
- INVITE: Let invite a user or a service to a new session or to modify parameters of a established session.
- ACK: Confirm the session establishment
- OPTION: Request information about the capabilities of a server
- BYE: End of a session
- CANCEL: Cancel a pending request.
- REGISTER: Register the user agent.
However there are additional methods that can be used. For example INFO, SUBSCRIBER, etc. (published in other RFCs)
For example you can see here a real example of a register method:
Via: SIP/2.0/UDP 192.168.0.100:5060;rport;branch=z9hG4bK646464100000000b43c52d6c00000d1200000f03
Content-Length: 0
Contact: <sip:20000@192.168.0.100:5060>
Call-ID: ED9A8038-A29D-40AB-95B1-0F5F5E905574@192.168.0.100
CSeq: 36 REGISTER
From: <sip:20000@192.168.0.101>;tag=910033437093
Max-Forwards: 70
To: <sip:20000@192.168.0.101>
User-Agent: SJphone/1.60.289a (SJ Labs)
Authorization: Digest username="20000",realm="192.168.0.101",nonce="43c52e9d29317c0bf1f885b9aaff1522d93c7692"
,uri="192.168.0.101",response="f69463b8d3efdb87c388efa9be1a1e63"
- SIP Answers (State Codes) .
After a SIP request message, the receiver answers with a message. This message, is similar to the previous one, but the first line, called Status-Line, that contains the SIP version , the answer code (Status-Code) and a small description (Reason-Phrase). The code of the answer is made up of three digits that allow classify the different types. The first digit defines the answer class
Class Code
1xx - Provisional Messages.
2xx - Success Answers.
3xx - Redirection Answers.
4xx - Method Failures.
5xx - Server Failures.
6xx - Global Failures.
This is a 200 sucess answer example:
Internet Protocol, Src Addr: 192.168.0.101 (192.168.0.101), Dst Addr:
192.168.0.100 (192.168.0.100)
User Datagram Protocol, Src Port: 5060 (5060), Dst Port: 5060 (5060)
Session Initiation Protocol
Status-Line: SIP/2.0 200 OK
Status-Code: 200
Resent Packet: False
Via: SIP/2.0/UDP 192.168.0.100:5060;rport;branch=z9hG4bK646464100000000b43c52d6c00000d1200000f03
Content-Length: 0
Contact: <sip:20100@192.168.0.100:5060>
Call-ID: ED9A8038-A29D-40AB-95B1-0F5F5E905574@100.100.100.16
CSeq: 36 REGISTER
From: <sip:20000@192.168.0.101>;tag=910033437093
Max-Forwards: 70
To: <sip:20000@192.168.0.101:5060>
Authorization: Digest username="20100",realm="192.168.0.101",nonce="43c52e9d29317c0bf1f885b9aaff1522d93c7692",uri="sip:192.168.0.101",
response="f69463b8d3efdb87c388efa9be1a1e63"
相關文章
- VoIP通話之sip協議協議
- ProtocolsProtocol
- [SIP00]SIP 概念總結
- PHP偽協議(Pseudo-Protocols)PHP協議Protocol
- [SIP01]SIP Header Fields裡面各欄位用途Header
- 如何避免VoIP安全風險
- sip是什麼?Mac電腦如何關閉sip?關閉系統完整性保護SIP的方法教程Mac
- SIP系統怎麼禁用?Mac上 sip系統完整性關閉方法,怎麼看sip是否關閉Mac
- 網路電話VoIP常識★龍人VoIP網路電話公司提供
- 《FreeSWITCH:VoIP實戰<前言>》
- SIP (Session Initiation Protocol) 協議SessionProtocol協議
- sip與openser的關係
- object-c 協議(Protocols)和代理(Delegation)的學習Object協議Protocol
- voip網路電話-Voip電話-網路電話-IP電話-深圳、香港、澳大利亞
- 關於SIP的原始碼地址原始碼
- 《SIP揭祕》讀書筆記筆記
- SIP穿越NAT的rport機制
- 第四章 SIP協議協議
- 第一章 PSTN與VoIP
- 蘋果M1晶片的Mac怎麼關閉SIP?M1 mac關閉Sip方法教程!蘋果晶片Mac
- 個人使用者:VoIP網路電話解決方案|voip網路電話|深圳網路電話公司
- [轉]Introduction to JAIN SIP API part2AIAPI
- iLocus:2009年VoIP業務報告——中興通訊VoIP軟交換裝置份額全球第一
- iOS VoIP電話:CallKit與PushKit的應用iOS
- mac os 關閉sip保護有什麼好處?有什麼壞處?macOS為什麼關閉sip?Mac
- ORTC與SIP融合通訊服務架構架構
- 強大的螢幕取色軟體:Sip for macMac
- 針對 VoIP 伺服器發動 DDoS 攻擊伺服器
- Mac技巧12:MacBook Pro如何開啟、關閉SIP?Mac
- 將 VoIP 電話直接連線到 Asterisk 伺服器AST伺服器
- VoIP Push 在海外音視訊業務中的應用
- 如何在樹莓派中安裝 VoIP 系統:Asterisk樹莓派AST
- 用freeswitch架構自己的VOIP網路電話架構
- 基於IP-PBX的VoIP系統解決方案
- 一篇文章讀懂SDP、RTMP、HLS、SIP、MMS
- Kamailio v4.2.2 釋出,開源 SIP 伺服器AI伺服器
- Kamailio v4.1.8 釋出,開源 SIP 伺服器AI伺服器
- Kamailio v4.1.7 釋出,開源 SIP 伺服器AI伺服器