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"
分享到:
相关推荐
<protocols> <add name="HttpGet"/> <add name="HttpPost"/> </protocols> </webServices> <globalization requestEncoding="utf-8" responseEncoding="utf-8"/> </system.web> </configuration> C# .Net ...
The fundamental and theoretical concepts on the call signaling protocols which include SIP, H.323, and MEGACO coupled with an extensive comparative analysis among these protocols to facilitate a ...
NGN protocols:SIP, H248, NO.7
<protocols> <add name=HttpPost/> <add name=HttpGet/> </protocols> </webServices> <!--此节点可允许脚本跨域调用webservice--> 步骤2. webservice代码 using System; using System.Collections....
SIP works in concert with these protocols by enabling Internet endpoints (called “user agents”) to discover one another and to agree on a characterization of a session they would like to share. For...
IPv6 Core Protocols Implementation.pdf
Troubleshooting IP Routing Protocols 2002 Troubleshooting IP Routing Protocols 2002
Recent advances in wireless sensor networks have led to many new protocols specifically designed for sensor networks where energy awareness is an essential consideration. Most of the attention, ...
EPC™ Radio-Frequency Identity Protocols Class-1 Generation-2 UHF RFID Protocol for Communications at 860 MHz – 960 MHz Version 1.2.0
correctness of security protocols. It is clearly written, starting with the basic concepts of cryptography and leading to advanced matters such as smartcards and non-repudiation. The book is also ...
WebRTC - APIs and RTCWEB Protocols of the HTML5 Real-Time Web 第二版 第三版合集 WebRTC p2p nat voip sip
1 SIP and the Internet 1 1.1 Signaling Protocols 1 1.2 The Internet Engineering Task Force 2 1.3 A Brief History of SIP 3 1.4 Internet Multimedia Protocol Stack 4 1.4.1 Physical Layer 4 1.4.2 Internet...
Foundations Of Security Protocols, and Equational Reasoning ,Essays Dedicated to Catherine A. Meadows,2019
This is a book about how to use formal methods to verify security protocols.
Attacking Network Protocols is a deep dive into network protocol security from James Forshaw, one of the world’s leading bug hunters. This comprehensive guide looks at networking from an attacker...
Plant Proteomics Methods and Protocols —————————————————————————— The aim of Plant Proteomics: Methods and Protocols is to present up-to- date methods and protocols used by ...
Multiple Access Protocols For Mobile Communications GPRS UMTS And Beyond - Wiley 2002.pdf
用于在windows2008R2中,配置注册表。...保险起见,执行前,先到注册表HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols,右键导出,作一个备份。如有异常,可还原。
Network Associates Guide To Communications Protocols.pdf 网络协议一张图搞懂,经典收藏
CCSDS-overview of space communications protocols