The present invention relates to session description protocol (Session Description Protocol, SDP) technologies, in particular, to a method and a device for identifying and obtaining AMBE encoding and decoding rate information in an SDP, and belongs to the field of communications technologies.
An advanced multiband excitation vocoder (Advanced MultiBand Excitation, AMBE) is a narrowband compression codec with a low bit rate and high quality. Because its encoding bit rate is low, a transmission bandwidth is low, so that it is widely applied in the field of satellite communications, so as to save precious satellite bandwidth resources.
AMBE is multi-rate voice compression encoding and decoding, and supports multiple rates from 1.2 kbps to 4.8 kbps, including 2.45 kbps, 4 kbps, and so on. When the AMBE is used in communication, a rate used between users may be specified through an SDP description in signaling when a session is established between the users.
In the prior art, a manner for describing AMBE encoding in an SDP is as follows:
“m=audio 6666 RTP/AVP 99
a=sendrecv
a=rtpmap:99 X-AMBE4.0/8000
a=fmtp:99
a=rtpmap:98 X-AMBE2.45/8000
a=fmtp:98
a=maxptime:40”.
An original intention of the description manner is to describe that two encoding and decoding rates supporting the AMBE are 4.0 kbps and 2.45 kbps and that corresponding PT values are 99 and 98 respectively. However, when the foregoing manner is adopted to describe the AMBE encoding in the SDP, if a sender device adjusts a sending rate in a bearer plane to send a packet, a receiver device cannot recognize the corresponding packet and does not switch the rate according to the packet automatically.
In view of defects existing in the prior art, embodiments of the present invention provide a method and a device for identifying and obtaining AMBE encoding and decoding rate information in an SDP, which are used to implement automatic rate switching in a bearer plane.
According to one aspect of the embodiments of the present invention, a method for identifying AMBE encoding and decoding rate information in an SDP is provided and includes:
setting an SDP, which specifically includes: in an m attribute line of the SDP, using a payload type PT value to describe AMBE encoding and decoding; and in an fmtp attribute of an a attribute line of the SDP, identifying, in a format field, a PT value same as that of the m attribute line, and identifying AMBE encoding and decoding rate information in a format specific parameter field; and
sending the set SDP to a peer end.
According to another aspect of the embodiments of the present invention, a method for obtaining AMBE encoding and decoding rate information in an SDP is further provided and includes:
parsing an SDP, and obtaining an m attribute line and an fmtp attribute of an a attribute line in the SDP; and
obtaining a PT value from the m attribute line, and obtaining AMBE encoding and decoding rate information from a format specific parameter field of the fmtp attribute of the a attribute line.
According to still another aspect of the embodiments of the present invention, a sender device is further provided and includes:
an SDP generating module, configured to generate an SDP, where in an m attribute line of the SDP, a payload type PT value is used to describe AMBE encoding and decoding; and in an fmtp attribute of an a attribute line of the SDP, a payload type PT value same as that of the m attribute line is identified in a format field, and AMBE encoding and decoding rate information is identified in a format specific parameter field; and
an SDP sending module, configured to send the generated SDP to a receiver device.
According to yet another aspect of the embodiments of the present invention, a receiver device is further provided and includes:
an SDP receiving module, configured to receive an SDP sent by a sender device; p and
an SDP parsing module, configured to parse the SDP, obtain an m attribute line and an fmtp attribute of an a attribute line in the SDP, obtain a PT value from the m attribute line, and obtain AMBE encoding and decoding rate information from a format specific parameter field of the fmtp attribute of the a attribute line.
In the method and the device for identifying and obtaining the AMBE encoding and decoding rate information in the SDP according to the foregoing aspects of the embodiments of the present invention, in the m attribute line, only one payload type PT value is used to describe the AMBE encoding and decoding, and in the fmtp attribute of the a line, the AMBE encoding and decoding rate information is identified in the format specific parameter field, so that the sender device and the receiver device may perform effective rate negotiation in a process of establishing a session, and automatic rate switching in the bearer plane may be effectively implemented for the sender device and the receiver device that have established the session.
To describe the technical solutions in the embodiments of the present invention or in the prior art more clearly, the following briefly introduces accompanying drawings required for describing the embodiments or the prior art. Apparently, the accompanying drawings in the following description are merely some embodiments of the present invention, and persons of ordinary skill in the art may further obtain other drawings according to these accompanying drawings without creative efforts.
The following clearly and completely describes the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the embodiments to be described are merely part rather than all of the embodiments of the present invention. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
Step S201: Set an SDP, which specifically includes: in an m attribute line of the SDP, using a PT value to describe AMBE encoding and decoding; and in an fmtp attribute of an a attribute line of the SDP, identifying, in a format field <format>, a payload type PT value same as that of the m attribute line, and identifying AMBE encoding and decoding rate information in a format specific parameter field <format specific parameters>.
Step S202: Send the set SDP to a peer end.
Specifically, Table 1 is a typical key parameter table describing media information in an SDP (defined in the standard RFC 2327).
As described in Table 1, when the media information is described in the SDP, an m attribute line and a attribute lines are included. The m attribute line is used to describe a media type, port information, transport information, and a media format; multiple a attribute lines are used to describe the rtpmap attribute, the fmtp attribute and the ptime attribute respectively.
In the method for identifying the AMBE encoding and decoding rate information in the SDP according to this embodiment, in the <fmt list> field of the m attribute line in the SDP, a PT value is used to describe the AMBE encoding and decoding, and if the PT value is generated dynamically, the PT value may be any value conforming to protocol specification. Correspondingly, for one PT value, the SDP includes only one “a=fmtp:<format> <format specific parameters>” attribute line, which is used to specifically describe the PT value described in the <fmt list> field of the m attribute line. More specifically, in the “a=fmtp:<format> <format specific parameters>” attribute line, the PT value of the m attribute line is identified in the <format> field, supported AMBE encoding and decoding rate information is identified in the <format specific parameters> field.
An example of identifying the AMBE encoding and decoding rate information in the SDP is shown as follows:
“m=audio 500 RTP/AVP 98
a=rtpmap:98 X-AMBE/8000
a=fmtp:98 mode-set=4000,2450
a=maxptime:40”.
Meaning of each attribute line in the SDP in the foregoing example is specifically described as follows:
“m=audio 500 RTP/AVP 98” attribute line: Media information is described as audio (audio), a port number is described as 500, a protocol is described as a real-time transport protocol (RTP), a profile is described as an approximate vertical profile (Approximate Vertical Profile, AVP), and a media format is described as audio with a PT
“a=rtpmap:98 X-AMBE/8000” attribute line: Encoding and decoding with a PT value of 98 is described as AMBE encoding and decoding (X indicates that no definition exists in an existing standard), and a sampling frequency is described as 8000;
“a=fmtp:98 mode-set=4000,2450” attribute line: Encoding and decoding rates used for the AMBE encoding and decoding are described as 4000 bps and 2450 bps; it should be noted that, 4000 bps and 2450 bps are merely taken as examples for description in the embodiment of the present invention, and persons skilled in the art should understand that, the encoding and decoding rates used for the AMBE encoding and decoding are not limited in the embodiment of the present invention; and
“a=maxptime:40” attribute line: When AMBE encoding and decoding transport is described, a maximum duration of a packet is 40 ms.
In the foregoing example, that in the fmtp attribute of the a attribute line, an AMBE encoding and decoding rate value is directly identified by using “mode-set” as a keyword in the <format specific parameters> field is taken as an example for description, which is merely taken as an example, and is not intended to limit the method for identifying the AMBE encoding and decoding rate information in the SDP according to this embodiment, that is, any keyword may be adopted to indicate the AMBE encoding and decoding rate information, for example, “mode”, other forms of rate information besides the AMBE encoding and decoding rate value may be identified, and an indication form of the AMBE encoding and decoding rate value may also be set randomly as required, for example, “a=fmtp:98 mode-set=4,245” is adopted to describe the AMBE encoding and decoding rates 4 kbps and 2.45 kbps.
A basic procedure for the sender device and the receiver device to use the AMBE encoding and decoding for communication is described in an exemplary manner in the following in combination with the foregoing SDP example, where the sender device is, for example, a caller (caller), the receiver device is, for example, a callee (callee), and the caller and the callee may be not only a terminal but also other network elements capable of implementing the AMBE encoding and decoding.
In the method for identifying the AMBE encoding and decoding rate information in the SDP according to this embodiment, only one PT value is set in the m attribute line, and for the PT value, only one “a=fmtp:<format> <format specific parameters>” attribute line is included, so after the caller adjusts the sending rate automatically in the bearer plane, the callee can still recognize the packet through the PT value, and perform rate switching automatically. Therefore, a defect that when different PT values are adopted to describe different rates, the sender device adjusts the sending rate in the bearer plane so that the receiver device does not recognize the packet and cannot perform rate switching automatically is avoided.
According to the method for identifying the AMBE encoding and decoding rate information in the SDP according to this embodiment, in the m attribute line, only one payload type PT value is used to describe the AMBE encoding and decoding, and in the fmtp attribute of the a line, the AMBE encoding and decoding rate information is identified in the format specific parameter field, so that the sender device and the receiver device may perform effective rate negotiation in a process of establishing a session, and automatic rate switching in the bearer plane may be effectively implemented for the sender device and the receiver device that have established the session.
On the basis of Embodiment 1, a specific form of the AMBE encoding and decoding rate information identified in the <format specific parameters> field in the fmtp attribute of the SDP is extensionally described.
In this embodiment, the identifying the AMBE encoding and decoding rate information in the format specific parameter field specifically includes:
identifying an AMBE encoding and decoding rate mode code in the format specific parameter field, where the AMBE encoding and decoding rate mode code corresponds to an AMBE encoding and decoding rate value.
Another example of identifying the AMBE encoding and decoding rate information in the SDP is shown as follows:
“m=audio 500 RTP/AVP 98
a=rtpmap:98 X-AMBE/8000
a=fmtp:98 mode-set=0,1
a=maxptime:40”.
In the foregoing example, the keyword “mode-set” is used to describe an encoding and decoding rate mode supported by the AMBE encoding and decoding, and encoding and decoding rate modes correspond to specific encoding and decoding rates in a one-to-one manner. Specifically, correspondence between an encoding and decoding rate mode and an encoding and decoding rate is, for example, that a corresponding rate of a mode “0” is 4.0 kbps and a corresponding rate of a mode “1” is 2.45 kbps, or a corresponding rate of a mode “1” is 4.0 kbps and a corresponding rate of a mode “0” is 2.45 kbps. In an actual application, in addition to these two encoding and decoding rates, other AMBE encoding and decoding rates may also be specified in this manner as long as an encoding and decoding rate mode corresponds to an encoding and decoding rate, and specific correspondence is not limited.
When the method in this embodiment is adopted to describe the SDP, the flow chart that the caller communicates with the callee when the rate is switched in the bearer plane is the same as that of Embodiment 1 (as shown in
On the basis of Embodiment 1, the method for identifying the AMBE encoding and decoding rate information in the SDP further includes: identifying AMBE encoding and decoding rate switching information in the <format specific parameters> field of the fmtp attribute of the a attribute line in the SDP.
The AMBE encoding and decoding rate switching information includes, for example, a minimum AMBE encoding and decoding rate switching time interval, an AMBE encoding and decoding rate switching constraint, and/or an AMBE encoding and decoding rate switching direction.
Specifically, for example, a keyword “mode-change-period” indicates a minimum time interval during rate switching, that is, the minimum number of frames after which switching can be performed. If the parameter is not set, the switching is not limited. For example, the value being equal to 2 indicates that switching can be performed once after at least two frames.
A keyword “mode-change-neighbor” indicates a constraint of the rate switching. A value range of the keyword is “0” or “1”, where “0” or not setting the parameter indicates that the rate may be switched randomly between modes, and “1” indicates that only an adjacent rate can be switched to during the switching.
A keyword “mode-change-direction” indicates a direction of the rate switching. These directions include “0” and “1”, where “0” indicates that only a low rate can be switched to, and “1” or not setting the keyword indicates that both a low rate and a high rate can be switched to.
Still another example of identifying the AMBE encoding and decoding rate information in the SDP is shown as follows:
“m=audio 500 RTP/AVP 99
a=rtpmap:99 AMBE/8000
a=fmtp:99 mode=4000,2450; mode-change-period=2; mode-change-neighbor=1;mode-change-direction=0
a=maxptime:40”.
Meaning of each attribute line in the SDP in the foregoing example is specifically described as follows:
“m=audio 500 RTP/AVP 99” attribute line: Media information is described as audio (audio), a port number is described as 500, a protocol is described as a real-time transport protocol (RTP), a profile is described as an approximate vertical profile (Approximate Vertical Profile, AVP), and a media format is described as audio with a PT value of 99;
“a=rtpmap:99 AMBE/8000” attribute line: Encoding and decoding with a PT value of 99 is described as the AMBE encoding and decoding and a sampling frequency is described as 8000; and
“a=fmtp:99 mode=4000,2450; mode-change-period=2; mode-change-neighbor=1; mode-change-direction=0” attribute line: Encoding and decoding rates used for the AMBE encoding and decoding are described as 4000 bps and 2450 bps, the switching can be performed only at an interval of at least two frames and a multiple of two frames, the switching can be performed between any rates, and the rate can only be switched to a low rate; and
“a=maxptime:40” attribute line: When AMBE encoding and decoding transport is described, a maximum duration of a packet is 40 ms.
In the foregoing example, that in the fmtp attribute of the a attribute line, in the <format specific parameters> field, the minimum AMBE encoding and decoding rate switching time interval is identified by using the “mode-change-period” as a keyword, the AMBE encoding and decoding rate switching constraint is identified by using the “mode-change-neighbor” as a keyword, and the AMBE encoding and decoding rate switching direction is identified by using the “mode-change-direction” as a keyword is taken as an example for description, which is merely taken as an example, and is not intended to limit the method for identifying the AMBE encoding and decoding rate information in the SDP according to this embodiment, that is, any other keywords may be adopted to identify the foregoing several kinds of AMBE encoding and decoding rate switching information, for example, a keyword “mode-change-neighbor” or “mode-change” is adopted as a keyword to identify the AMBE encoding and decoding rate switching direction, and other forms of rate switching information besides the foregoing several kinds of AMBE encoding and decoding rate switching information may further be identified, which may be set randomly as required.
According to the method for identifying the AMBE encoding and decoding rate information in the SDP in this embodiment, the AMBE encoding and decoding rate switching information is further described in the SDP, thereby effectively limiting and constraining the rate switching in the bearer plane in the session conveniently and flexibly.
That a method for obtaining AMBE encoding and decoding rate information in an SDP according to Embodiment 4 of the present invention is executed by a receiver device is taken as an example in the following to describe the method for obtaining the AMBE encoding and decoding rate information in the SDP according to Embodiment 4 of the present invention from the perspective of the receiver device.
Step S801: Parse an SDP, and obtain an m attribute line and an fmtp attribute of an a attribute line in the SDP.
Step S802: Obtain a PT value from the m attribute line, and obtain AMBE encoding and decoding rate information from a format specific parameter field of the fmtp attribute of the a attribute line.
The SDP received and parsed by the receiver device is, for example, identified and formed by a sender device according to the method according to any one of the foregoing embodiments, and is not repeatedly described here. A specific parsing method and parameter extraction may be implemented by adopting any method in the prior art, and are not limited here.
According to the method for obtaining the AMBE encoding and decoding rate information in the SDP according to this embodiment, in the m attribute line, only one payload type PT value is used to describe the AMBE encoding and decoding, and in the fmtp attribute of the a line, the AMBE encoding and decoding rate information is identified in the format specific parameter field, so that the sender device and the receiver device may perform effective rate negotiation in a process of establishing a session, and automatic rate switching in the bearer plane may be effectively implemented for the sender device and the receiver device that have established the session.
Furthermore, the obtaining the AMBE encoding and decoding rate information from the format specific parameter field of the fmtp attribute of the a attribute line specifically includes:
obtaining an AMBE encoding and decoding rate mode code from the format specific parameter field of the fmtp attribute of the a attribute line; and
obtaining an AMBE encoding and decoding rate value by querying correspondence between the AMBE encoding and decoding rate mode code and the AMBE encoding and decoding rate value.
Furthermore, the obtaining the AMBE encoding and decoding rate information from the format specific parameter field of the fmtp attribute of the a attribute line specifically includes:
obtaining an AMBE encoding and decoding rate value from the format specific parameter field of the fmtp attribute of the a attribute line.
On the basis of Embodiment 4, the method for obtaining the AMBE encoding and decoding rate information in the SDP further includes: obtaining AMBE encoding and decoding rate switching information from the format specific parameter field of the fmtp attribute of the a attribute line.
The obtaining the AMBE encoding and decoding rate switching information from the format specific parameter field of the fmtp attribute of the a attribute line specifically includes:
obtaining a minimum AMBE encoding and decoding rate switching time interval, an AMBE encoding and decoding rate switching constraint, and/or an AMBE encoding and decoding rate switching direction from the format specific parameter field of the fmtp attribute of the a attribute line.
The SDP in this embodiment is obtained, for example, by adopting the method described in Embodiment 3, and a specific procedure is not repeatedly described here.
According to the method for obtaining the AMBE encoding and decoding rate information in the SDP in this embodiment, the described AMBE encoding and decoding rate switching information is further obtained from the SDP, so that rate switching may be executed conveniently and flexibly according to a limitation and a constraint of rate switching in a bearer plane in a session.
an SDP generating module 91, configured to generate an SDP, where in an m attribute line of the SDP, a payload type PT value is used to describe AMBE encoding and decoding; and in an fmtp attribute of an a attribute line of the SDP, a payload type PT value same as that of the m attribute line is identified in a format field, and AMBE encoding and decoding rate information is identified in a format specific parameter field; and
an SDP sending module 92, configured to send the generated SDP to a receiver device.
A procedure of identifying, by the sender device, the AMBE encoding and decoding rate information in the SDP according to this embodiment is the same as that in Embodiment 1, and is not repeatedly described here.
The sender device may be a terminal, and may also be any other network elements capable of implementing the AMBE encoding and decoding.
According to the sender device in this embodiment, when the SDP is generated, in the m attribute line, only one payload type PT value is used to describe the AMBE encoding and decoding, and in the fmtp attribute of the a line, the AMBE encoding and decoding rate information is identified in the format specific parameter field, so that the sender device and the receiver device may perform effective rate negotiation in a process of establishing a session, and automatic rate switching in a bearer plane may be effectively implemented for the sender device and the receiver device that have established the session.
Furthermore, the AMBE encoding and decoding rate information includes an AMBE encoding and decoding rate value, or an AMBE encoding and decoding rate mode code corresponding to the AMBE encoding and decoding rate value.
Furthermore, the SDP generating module is further configured to identify AMBE encoding and decoding rate switching information in the format specific parameter field.
Furthermore, the AMBE encoding and decoding rate switching information includes a minimum AMBE encoding and decoding rate switching time interval, an AMBE encoding and decoding rate switching constraint, and/or an AMBE encoding and decoding rate switching direction.
The sender device may conveniently and flexibly perform an effective limitation and constraint on the rate switching in the bearer plane in the session by identifying the AMBE encoding and decoding rate switching information in the SDP.
an SDP receiving module 101, configured to receive an SDP sent by a sender device; and
an SDP parsing module 102, configured to parse the SDP, obtain an m attribute line and an fmtp attribute of an a attribute line in the SDP, obtain a PT value from the m attribute line, and obtain AMBE encoding and decoding rate information from a format specific parameter field of the fmtp attribute of the a attribute line.
A procedure of obtaining, by the receiver device, the AMBE encoding and decoding rate information in the SDP according to this embodiment is the same as that in Embodiment 4, and is not repeatedly described here.
The receiver device may be a terminal, and may also be any other network elements capable of implementing the AMBE encoding and decoding.
According to the receiver device in this embodiment, when the SDP is parsed, a PT value is obtained from the m attribute line and the AMBE encoding and decoding rate information is obtained in the format specific parameter field from the fmtp attribute of the a line, so that the sender device and the receiver device may perform effective rate negotiation in a process of establishing a session, and automatic rate switching in a bearer plane may be effectively implemented for the sender device and the receiver device that have established the session.
Furthermore, the AMBE encoding and decoding rate information includes an AMBE encoding and decoding rate value, or an AMBE encoding and decoding rate mode code corresponding to the AMBE encoding and decoding rate value. Correspondingly, the SDP parsing module is further configured to, if the AMBE encoding and decoding rate mode code is obtained, obtain the AMBE encoding and decoding rate value by querying correspondence between the AMBE encoding and decoding rate mode code and the AMBE encoding and decoding rate value.
Furthermore, the SDP parsing module is further configured to obtain AMBE encoding and decoding rate switching information from the format specific parameter field of the fmtp attribute of the a attribute line.
Furthermore, the AMBE encoding and decoding rate switching information includes a minimum AMBE encoding and decoding rate switching time interval, an AMBE encoding and decoding rate switching constraint, and/or an AMBE encoding and decoding rate switching direction.
The receiver device may conveniently and flexibly execute corresponding rate switching according to a limitation and a constraint of the rate switching in the bearer plane in the session by obtaining the AMBE encoding and decoding rate switching information in the SDP.
It should be noted that:
1. It is described in the embodiments that a caller and a callee exchange AMBE encoding and decoding media information through an SDP in INVITE and 2000K of an SIP protocol, but an AMBE media information exchange manner in the present invention is not limited to the INVITE and 2000K messages, which are merely examples. The AMBE media information exchange manner in the present invention entirely complies to the description of media information negotiation in the RFC 3261 standard protocol.
2. In the embodiments, merely the description of AMBE 4 kbps and 2.45 kbps is provided. Because the AMBE is multi-rate encoding and decoding, the present patent is definitely also applicable to AMBE at other rates, which include, but are not limited to, 1.2 kbps and 4.8 kbps, and so on.
3. In the embodiments, merely the description of the AMBE encoding and decoding is provided, but the method in the present patent is also applicable to a latest encoding and decoding version AMBE+2 of the AMBE, which is a latest standard of the AMBE encoder series. The present patent is applicable to all AMBE encoding and decoding series versions.
Persons of ordinary skill in the art may understand that all or part of the steps in the foregoing method embodiments may be implemented by a program instructing relevant hardware. The program may be stored in a computer readable storage medium. When the program is run, the steps of the foregoing method embodiments are performed. The storage medium includes any medium that is capable of storing program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
Finally, it should be noted that the foregoing embodiments are merely intended for describing the technical solutions of the present invention, rather than limiting the present invention. Although the present invention is described in detail with reference to the foregoing embodiments, persons of ordinary skill in the art should understand that they may still make modifications to the technical solutions described in the foregoing embodiments, or make equivalent replacements to part or all of the technical features of the technical solutions described in the foregoing embodiments; however, these modifications or replacements do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
100011 This application is a continuation of International Patent Application No. PCT/CN2012/071855, filed on Mar. 2, 2012, which is hereby incorporated by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2012/071855 | Mar 2012 | US |
Child | 14194122 | US |