Introduction to the most popular and complete sips

  • Detail

Introduction to complete sip/sdp media negotiation

according to the specification of rfc3264, any party of the agent can generate subsequent offers. In the previous article of the author, the author discussed the rules about the process of ending the ice process, which will cause the accused agent to send an update offer. Specifically, when ice has selected a different pairing from the default pairing, in the ice end process, the accused agent will send an update offer message. However, the previous article did not describe in detail how the agent can update offers, receive offers, and finally update and check the connection and valid list. If the agent wants to realize the process of updating the offer, the agents of both sides need to go through three main processes. The agent needs to be built through the offer message first, then the peer receives the updated offer, generates the updated answer message, and finally updates the connection check and valid list

because the content of updating the offer is quite miscellaneous, in order to let readers have a better reading experience, the author plans to divide the above content into three parts. This article introduces the content of the first part (generating subsequent offers), and the content of the second part and the third part will be introduced in future articles

this article mainly covers the content about generating subsequent offers:

overall deployment scenario discussion (ice restart, remove media streams, increase media streams)

full scenario deployment discussion: existing media stream processing during ice operation and existing media stream processing after ice completion

lightweight scenario deployment discussion: existing media stream processing during ice runtime and existing media stream processing after ice is completed

in the discussion, the subsequent offer/an should be shut down for inspection; In case of failure and failure in operation, when it is necessary to check the constant swer interaction mode, the first thing to pay attention to is how to generate an updated offer message. In generating update offer messages, rfc5245 specifies two common processing flows (full scenario deployment scenario and lightweight deployment scenario) respectively. Next, the author will first discuss the overall deployment scenario, and then discuss the processing of existing media streams in different ice running state environments in the two deployment scenarios

note: there are some differences between rfc5245 and rfc8445 specifications about the details of ice restart. The author uses rfc5245 specifications as the basis for discussion. If you are interested in the latest specification, you can refer to the details of rfc8445

1 discussion on overall deployment scenario

when discussing the subsequent offer/answer interaction mode, the first thing to pay attention to is how to generate updated offer messages. In generating update offer messages, rfc5245 specifies two common processing flows (full scenario deployment scenario and lightweight deployment scenario) for agents. Before introducing the processing flow of these two deployment scenarios, we will first introduce three contents related to the overall deployment scenario. The first is about restarting the ice process

agent can restart ice processing process for existing media streams. Restarting the ice processing process will cause the previous ice processing process to be refreshed and the inspection process to be restarted. Note that there is a difference between restarting the ice process and re creating a new session. During the restart of the ice process, the media stream will still be sent to the previous valid pairing destination. For a media stream, if the following two situations may occur, the agent must restart the ice process:

an offer has been generated to modify the media stream destination. In short, the agent wants to generate an updated offer message (ice does not use this offer), and the result is to generate a new value for the destination of the media component

agent is modifying its deployment level. In general, the situation occurs in the environment of third-party call control. The signaling that the object entity is using is not the signaling that the entity receives the media, and this entity has been modified from the destination of the media mid session to another entity, which has a different ice deployment environment

the modification of other rules will also cause ice restart. Changing the IP address in line C in SDP to will cause ice restart. Therefore, if the call waiting service function needs to be supported, the above mechanism cannot be used in ice deployment. It must be set with a=inactive and a=sendonly. Because the IPv6 network scenario is involved here, the old specification rfc3264 has been updated. For the latest details of this requirement, readers are advised to refer to rfc Chapter 1 Introduction. If the agent wants to restart the ice process for the media stream, the agent must modify the two attributes ice PWD and ice ufrag required by the authenticated user in the offer message. Note that rfc5245 specification also allows agents to use session level attribute settings in offers, and only provide the same ice PWD or ice ufrag as a media level attribute in subsequent offers. Such an operation will not change the password, nor will it change its presentation, treat the creative way with a "playful" attitude, nor will it cause ice to restart. Agent sets several other attributes in SDP, which are included in the initialized offer. For this media stream, in the next process of updating the offer, the candidate address group may include some parameters or no parameters, or the previous candidate address, and may include the newly collected candidate address group according to the actual situation. The collection of candidate addresses is performed by collecting candidate addresses (for candidate address scenarios, please refer to historical articles)

according to the rfc3264 specification, if the agent needs to remove the media, it can set its port to 0. This rule also applies here. Except that the agent sets the port to 0, for the media stream to be removed, it must not contain any candidate address attributes, and should not include any ice related attribute settings. For specific ice related attributes, refer to the following examples:

if the agent wants to add a new media stream, it needs to set the relevant domain value for this media stream in SDP. The relevant domain value settings in these SDPs need to refer to the settings in SDP decoding in the initialization offer. After the agent modifies the settings of these media streams, the ice processing flow will start sending media streams

the above content introduces the processing flow of ice restart, removing media streams and deleting media streams in the overall deployment environment. Next, we will first explain the processing flow in the full scenario deployment environment

2 process flow of full scene deployment environment

this chapter will describe in detail the processing of existing media streams under different ice operating states in the full scene deployment environment. Note here that these three parameters, user name (ice ufrag), password (ice PWD) and deployment level, have not changed. If the agent needs to modify one of the parameter conditions, ice needs to be restarted

if the agent generates an updated offer, including a previously created media stream in the updated offer, and the ice check is also running, the agent needs to execute according to the following process. For this media stream, this agent must include candidate attributes for all local candidate addresses. The attributes of the candidate address identified by DP, such as priority, foundation, type and related transmission address, which attracted a batch of polylactic acid product manufacturers such as Bicheng and Leiguan to settle in s, should remain unchanged. Among the candidate addresses, Ma Ruiwen also indicates that the basic confirmation information, for example, the IP address, port and transmission protocol must not be changed (if one of them is changed, it indicates a new candidate address). The component ID is consistent with the previous component ID. The agent can include other candidate addresses that have not been generated in the previous offer. However, since the last offer/answer interaction, for the candidate addresses that the agent has collected, it needs to include a peer referral candidates. For the media, as in the initial offer, there must be a set of candidate attributes that can match the default destination address, and the agent can modify the default destination address for this media

the above is the process that the agent needs to execute to update the offer when ice is running. In addition to ice being executed, ice check may also be completed. If the agent generates an updated offer, including a previously created media stream in the updated offer, and the ice check is completed, the agent needs to execute according to the following process. The default destination address for the media (for example, the IP address and port value in line m and line C of the media stream) must be a local candidate address from the highest priority recommended pairing of the valid list for each media component. In this way, the destination address can be repaired so that the destination address of the default media is equal to the selected address of ice for this media. The agent must contain some candidate attributes of candidate addresses, which match the default destination address of each component in the media stream, and the agent must not contain other candidate addresses. In addition, if the agent is a accused agent, it must include a=remote candidates attribute for each media stream (the check list of these media streams is in ice completion status). This property setting contains remote candidate addresses from the highest priority pairing value in the valid list supported by each component of this media stream. There may be an extreme situation that needs to be avoided as much as possible. The accused agent chose its pairing, but the update offer performed a disorderly connection check on the master agent. In this case, the opposite agent may not know which pair is a valid pair. Therefore, use the a=remote-candidates attribute when updating an offer to avoid this extreme situation caused by the loss of request/response messages between the update offer and the stun check protocol. Note that the discussion on the processing mechanism of this extreme case is only stipulated in the specification of rfc5245, but this processing is cancelled in rfc8445. Compared with rfc5245, rfc8445 greatly simplifies ice restart

a=remote candidates avoid pairing disorder processing (rfc5245)

3 lightweight deployment environment processing flow

the discussion in this part and the application of the previous discussion, the author will also introduce the processing flow of the lightweight deployment environment under the two ice running states

first, describe the processing flow when the ice process is running for the existing media stream in the lightweight deployment. Lightweight deployment must include all candidate addresses for each component of each media stream in a=candidate in any subsequent offer. The process of building candidate addresses is exactly the same as that of initializing an offer. The specific construction process is specifically introduced in the previous historical article, and readers can refer to historical documents. Other host candidate addresses must not be added to subsequent offers in lightweight deployment. If the agent wants to add a new host candidate address, the agent must restart the ice processing process. The user name (ice ufrag), password (ice PWD) and deployment level in the subsequent offer should be consistent with the attributes in the previous offer, if

Copyright © 2011 JIN SHI