Use the Options method to implement keep alive

Source: Internet
Author: User
Tags keep alive

Noiile@hotmail.com

In the SIP application, if a user is using the sip ua to enjoy a certain time-based service, such as watching a pay-as-you-go TV online and suddenly crashes, the server will not be able to know any information about the user's device crashes, the billing service continues.

This is obviously an unreasonable situation. The server must know the user's status in real time. In this case, the Presence Server may not be able to solve the problem. Because the user's sip ua sends a publish message to the Presence Server only when the status changes, that is to say, the server can only know that the user is no longer online after the publish expired. However, whether publish or register is sent, the expiration time of the publish depends on the user's sip ua. In many cases, the user sets the expiration time to 10 minutes or longer. This cannot meet the real-time requirements of some services.

 

It is easy to conclude that for services with high real-time requirements, such as IPTV server, either register or publish, the problem cannot be solved. The following considerations must be taken into account for the solution:

1. The existing sip method is used and does not depend on the user's sip ua,

2. the user's sip ua does not have to perform any special processing on this.

3. The time control depends on the service provider, that is, the application server or other servers, because different services may have different requirements on time precision.

 

Obviously, if the server sends a SIP request to the terminal in a cycle, the cycle time depends on the server. If the user's sip ua has a response, the user is still online, if the user does not return response, it is offline, and the server can terminate the user's service.

But what sip method is the most suitable? Options. Because rfc3261 is defined, all UA must support the Options method, so the Options method meets the requirements of 1 and 2 mentioned above. In addition, the options method is simple. It only requests the user's sip ua capability and does not require human-computer interaction. It has nothing to do with dialog. Therefore, it is more appropriate to use the Options method to determine whether the user is online.

 

The process is as follows:

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.