The generation of early media and ring tones in sip

Source: Internet
Author: User
Tags ack sessions
Transferred from Http://www.ring180.com/sip/28-pstn-interworking/59-sipThursday January 2009 03:46 Sharp Voice Communication

1 , early media

Whether in the PSTN or VoIP network, the final purpose of a call is to have two users talk (conversation). Here we will be generated by conversations between the users of the media called the regular media ("regular medium").

Early media ("Early media") is compared to conventional media.

Typically, the user's conversation does not start immediately after the caller initiates the call (and may even end up without a start), and the wait time is typically a few seconds to 10 seconds, depending on when the user is called. Before the call is answered, there can also be media streaming between the host user and the network, which is distinguished from the conventional media, which is called the early media. The most typical early media is a ring-back tone. Other forms of early media include queuing prompts and so on. Early media are usually one-way (Network > host), and there may be bidirectional early media in the SIP.

2 , early media delivery

To transfer media, you first have to establish a media conversation (session). Establishing a media session is actually a process of negotiating the media parameters of a session through the SDP Offer/answer Exchange. In SIP, the process of establishing a media session is usually first accompanied by the process of establishing a SIP dialog (Dialog), in which media sessions and SIP dialogs are established simultaneously (with the SDP answer via SIP 200 or ACK messages). In this case, the media session will not be established until the user is called off the machine, only the user can transfer the user media, apparently unable to transmit the early media.

To deliver early media, you must complete the creation of a media session when the SIP dialog is not fully established, the so-called SIP early state of the conversation.

How to establish a media session in an early dialog state? Two approaches are supported in SIP.

The key difference between the two approaches is whether the session that transmits the early media is clearly separated from the conversation in the communication media after the transfer. In terms of protocol, both approaches take advantage of SIP messages prior to 200, such as 1xx-rel, Prack, update, and so on, to deliver the SDP Offer/answer, but these SDP offer/ The answer type and processing instructions in the SIP message are different.

Practice 1 does not explicitly distinguish between sessions for early media, and in fact there is always only one session. On the protocol, the SDP offer/answer that is used to establish (or modify) This session instructions in SIP messages are "sessions."

Practice 2 specifically establishes a session for transmitting early media and is called an early session ("Early-session"). On the protocol, the processing instructions in the SDP Offer/answer SIP messages that are used to establish (or modify) an earlier session are "Early-session". Also, in a SIP message, two SDP messages with processing instructions, respectively, "session" and "early-session" can be carried simultaneously, independently for negotiation of early sessions and negotiation of normal sessions.

As shown in the following figure. In practice 1, the same session (in different time periods) is used to transmit the early media and the call media. Before being called a machine, this session can be used to transmit the early media, after being called to pick the machine, this session is used to transmit the communication media. If the parameters of the early media and the call media are different, the need to renegotiate the media transmission parameters, which takes a certain amount of time, may lead to a media clipping problem. In practice 2, at the same time there will be two sessions, respectively for the transmission of early media and call media, after being called off the machine, the terminal can quickly switch from the early session to the normal session, will not bring the problem of media pruning.

Depending on their scenario, the two approaches are referred to as gateway mode and Application Server mode, respectively.

3 , the emergence of a ring-back sound

After a call is initiated, when called terminal ringing, the caller will also hear a certain sound, the hint is waiting to be called answer, this is called the ring back tone. The ring tone is usually a standard audio signal, or it may be a particular sound file specified by the user, such as music, and so on. In the PSTN, the ring tone is usually generated by the called local switch, which is then transmitted to the main call phone via the established one-way channel, which is played to the main call by the main call telephone.

In a SIP network, the called side can provide a ring-back tone to the host in the form of an early media (if the called side does not provide a ring-back tone, then the host-called SIP terminal will produce a ring-back tone locally). Use the one of the two approaches mentioned above to transmit the early media, discussed separately below.

3.1 . Gateway Mode

The gateway pattern applies to situations where the called (that is, UAS) is a SIP gateway. The specific possible scenarios are usually shown in the following illustration: A user calls a PSTN user on a SIP terminal, and this call passes through a SIP gateway. In the case of a SIP call, the gateway is called.

Here, the ring tones are generated by the PSTN network. However, in the SIP domain, the SIP gateway needs to transmit the ring-tone media received from PSTN network to the SIP terminal in the form of early media.

In this case, from the SIP domain, the ring-back sound media stream and the subsequent stream of called media are homologous, all in the SIP network. When the user is called off, the ring-tone media stream naturally becomes the user media stream, so you can use the gateway mode, and will not bring the problem of media pruning.

The signaling process is shown below:

The message is briefly described below:

1 The INVITE request contains SDP offer, its disposition type is "session".
When the gateway receives the invite, it sends the IAM message to the PSTN, and then receives the ring tone on the PCM traffic, and receives the ACM message on the signaling.

2) 183 response contains SDP answer, whose disposition type is "session".
At this point, the media session between UAC and the Gateway is established, and the callback tone is uploaded to UAC in this session.

3 UAC Send Prack

4 The Gateway returns 200 responses for Prack.

5) is called the user to reply, the gateway receives the ANM to return the invite response to the SIP UAC. At the same time, the callback tone on the session on the SIP UAC automatically becomes the user's voice received from the PSTN. The principal is called to start a two-way call

6) SIP UAC sends an ACK.

3.2 . Application Server Mode

Application Server mode applies to situations where a called (i.e. UAS) is an application server. The specific possible scenario is usually shown in the image above: A sip user wants a ring tone to be generated by the carrier network rather than the terminal. Operators usually use a MRF resource on the network to provide a ring back tone, and need an application server to control the return ring tone.

In this case, the back-tone media stream and the later called Media Stream are produced on the MRF and called SIP terminals respectively, and are obviously different sources. If you use gateway mode, switch the ring tone media to a called media stream must be media changed on the session, the media changes can not be completed immediately, which will result in the media pruning problem.

With Application server mode, two sessions are established at the same time, and the callback sound media is switched to a called media stream that can be completed immediately by switching the current session from an earlier session to a normal session.

The signaling process is shown below:

The brief description is as follows:

1 Invite request to carry a SDP as a regular session of the Offer
Its Supported header field contains an option label "Early-session", which means that the host call terminal supports an earlier session.

2 The offer received prior to carrying the INVITE request

3) 183 In response carries a SDP as the answer of the regular session.

4) 183 contains two SDP:

(a) A answer that was received from the previous call, as a regular conversation;
At this point, the regular session is established, but no media is transmitted.

b another offer as an early session to be established.

5) Prack carrying a SDP, as an early session of the answer
At this point, the earlier session was established and was transmitted by the early media (ring-back tone).

6) As to be called sent Prack

7) called back to as Prack

8) As to the main call return to Prack

9) is called to pick the machine, send 200 response to AS

As to the main call send 200 response
There will be media transfer at this time of the general session, with the host called UA playing the media on the regular session.

4 , a brief description of the realization of the current multimedia ringtones

At present, China Netcom and China Mobile multimedia body color Ring service implementation of the main use of the Gateway mode of implementation (detailed procedures refer to the relevant technical specifications), because many SIP terminals do not support the "early-session" option label, can not use the Application server mode.

In fact, the use of Gateway mode to achieve the color ring will cause the media to delete some of the problems, and eventually should be gradually transition to the ideal scheme-application server model.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.