SIP客户端定期向服务器注册

SIP客户端定期向服务器注册,sip,sip-server,Sip,Sip Server,我已经用SIPSDK编写了一个SIP客户端,您可以在线访问。经典的SIP功能:你在SIP服务器上注册,打电话,打电话。。。这一切正常,但假设SIP服务器重新启动或由于其他原因丢失SIP客户端的注册。现在其他客户端无法呼叫您,因为在SIP服务器上找不到您 这是怎么处理的? 即使您已注册,您是否会定期发送另一条注册信息?每隔10分钟或者类似的时间?您是否先注销然后(这意味着在这段时间内您无法联系到,这将是不好的),然后再注册,或者在您已经注册且没有问题的情况下,您是否可以调用register 我还发

我已经用SIPSDK编写了一个SIP客户端,您可以在线访问。经典的SIP功能:你在SIP服务器上注册,打电话,打电话。。。这一切正常,但假设SIP服务器重新启动或由于其他原因丢失SIP客户端的注册。现在其他客户端无法呼叫您,因为在SIP服务器上找不到您

这是怎么处理的? 即使您已注册,您是否会定期发送另一条注册信息?每隔10分钟或者类似的时间?您是否先注销然后(这意味着在这段时间内您无法联系到,这将是不好的),然后再注册,或者在您已经注册且没有问题的情况下,您是否可以调用register


我还发现了register/options keep-alive消息传递,但我不确定它的目的是什么,它能处理sip服务器不再有您的注册的情况吗?sip服务器是否始终支持它?

在对
注册表的响应中,您应该得到
Expires
头(您也可以发送一个)。您应该在到期之前发送另一个
注册
请求。这将使您在典型场景中保持注册状态。服务器本身不应该丢失您的注册,即使它重新启动。如果它真的不能持久保存数据,那么你就无能为力了。您的注册将在接近下一个到期时间时刷新

与往常一样-如有疑问,请阅读:

10.3处理登记请求

7. The registrar now processes each contact address in the Contact
     header field in turn.  For each address, it determines the
     expiration interval as follows:

     -  If the field value has an "expires" parameter, that value
        MUST be taken as the requested expiration.

     -  If there is no such parameter, but the request has an
        Expires header field, that value MUST be taken as the
        requested expiration.

     -  If there is neither, a locally-configured default value MUST
        be taken as the requested expiration.

这一部分还应该解释一些事情:
10.2.1.1设置联系人地址的过期时间间隔

在对
注册表的响应中,您应该得到一个
Expires
标题(您也可以发送一个)。您应该在到期之前发送另一个
注册
请求。这将使您在典型场景中保持注册状态。服务器本身不应该丢失您的注册,即使它重新启动。如果它真的不能持久保存数据,那么你就无能为力了。您的注册将在接近下一个到期时间时刷新

与往常一样-如有疑问,请阅读:

10.3处理登记请求

7. The registrar now processes each contact address in the Contact
     header field in turn.  For each address, it determines the
     expiration interval as follows:

     -  If the field value has an "expires" parameter, that value
        MUST be taken as the requested expiration.

     -  If there is no such parameter, but the request has an
        Expires header field, that value MUST be taken as the
        requested expiration.

     -  If there is neither, a locally-configured default value MUST
        be taken as the requested expiration.
本部分还应说明一些事项:
10.2.1.1设置联系人地址的过期时间间隔