MSCBSC 移动通信论坛
搜索
登录注册
网络优化工程师招聘专栏 4G/LTE通信工程师最新职位列表 通信实习生/应届生招聘职位
 

  • 阅读:300
  • 回复:0
IMS/SIP中的订阅(SUSCRIBE)和通知(NOTIFY)
KangGuoYing
版主
鎵嬫満鍙风爜宸查獙璇


 发短消息    关注Ta 

C友·铁杆勋章   公益·慈善勋章   C友·贡献勋章   纪念勋章·七周年   财富勋章·万元户   专家·高级勋章   财富勋章·财运连连   财富勋章·小财主   C友·登录达人   财富勋章·富甲一方   纪念勋章·八周年   纪念勋章·九周年   纪念勋章·十周年   纪念勋章·十二周年   C友·技术大神  
积分 93558
帖子 6268
威望 705989 个
礼品券 11319 个
专家指数 24033
注册 2007-3-13
专业方向 
回答问题数 13554
回答被采纳数 1833
回答采纳率 14%
 
发表于 2020-10-23 07:54:32  只看楼主 

        IMS/SIP中流程中我们经常看到订阅(SUSCRIBE)通知(NOTIFY)消息,它们的定义、用途及示例分别如下:


1.消息定义

       订阅(SUSCRIBE)在无线协议中类似“测量控制”或“信息请求”,要求对方对特定事件或状态进行报告;

       通知(NOTIFY)在无线协议中类似“测量报告”或“信息反馈”,其是对订阅(SUSCRIBE)事件的信息反馈(具体见RFC3265中SIP事件定义节);

2.订阅(SUSCRIBE)支持的事件

        订阅是经常见的事件就是注册“reg”(注册状态检查),另有很多其他的事件;详见下表:

Event

Description

Reference

     reg

          Request   for IMS/SIP Registration Status

  RFC   3680

  presence

Request   for presence information (commonly used in RCS)

   RFC   3856

     winfo

Request   for Watcher information (commonly used in RCS)

   RFC   3857

  xcap-diff

Request   for Xcap-Diff information (commonly used in RCS)

   RFC   3875

3.通知(NOTIFY)支持的事件

       通知(通常是CSCF)有错误出现(如481,400,500);除在消息正文之外提供的详细(除已订阅)信息,还会发送带有特定订阅状态信息的通知消息(具体参阅RFC3265 3.2.4);

Subscription-State

Description

active(激活)

It   means the subscription is accepted (in most case, authorized as well)

   pending      (暂缓)

It means the subscription   has been received by the notifier, but there is insufficient policy   information to grant or deny the subscription yet

terminated (结束)

It   means the subscription is terminated and this can specify as a reason code as   follows


deactivated (去激活)

This mean that the   subscription ended (terminated) but the subscriber (UE) SHOULD retry   with a new subscription immediately.


probation (稍后再试)

This   mean that the subscription ended (terminated) but the client   SHOULD retry at some time later.


rejected   (拒绝)

This   mean that the subscription ended (terminated) due to change in authorization   policy. The client SHOULD NOT retry.


timeout   (超时)

This   mean that the subscription ended (terminated) because it is not refreshed   before it expired. The client MAY retry immediately.


giveup

(放弃)

This mean that the   subscription ended (terminated) because the notifier could not obtain   authorization in time


noresource  (无资源)

This mean that the   subscription ended (terminated) because the resource being monitored is no   longer available.


4.订阅和通知流程

          订阅(SUSCRIBE)一般由终端(UA)发起,服务器应答 通知(NOTIFY),其流程简化如下:

    

image.png

5.订阅和通知消息内容

       以注册“reg”(注册状态检查)为例的“订阅” SUBSCRIBE“通知”NOTIFY )消息内容如下:

Step 1 : SUBSCRIBE -----------------------------------

SUBSCRIBE sip:+11234567890@test.3gpp.com SIP/2.0

Via: SIP/2.0/UDP 10.133.202.46:50997;branch=z9hG4bK2968d27245f17c7bcae38c31991bfdaa

Max-Forwards: 70

Contact: <sip:+11234567890@10.133.202.46:50997>;+sip.instance="<urn:gsma:imei:00440113-904785-0>"

To: <sip:+11234567890@test.3gpp.com>

From: <sip:+11234567890@test.3gpp.com>;tag=210a54

Call-ID: d57a0b04-785ba328-13a4d876@10.133.202.46

CSeq: 14534 SUBSCRIBE

Expires: 600000

User-Agent: IM-client/OMA1.0 DUT-IMS

Event: reg

Accept: application/reginfo+xml

P-Access-Network-Info: 3GPP-E-UTRAN-FDD;utran-cell-id-3gpp="0010100010000000"

P-Preferred-Identity: <sip:+11234567890@test.3gpp.com>

Content-Length: 0

 

Step 2 : 200 OK -----------------------------------

SIP/2.0 200 OK

Via: SIP/2.0/UDP 10.133.202.46:50997;branch=z9hG4bK2968d27245f17c7bcae38c31991bfdaa

From: <sip:+11234567890@test.3gpp.com>;tag=210a54

To: <sip:+11234567890@test.3gpp.com>;tag=987654321

Call-ID: d57a0b04-785ba328-13a4d876@10.133.202.46

CSeq: 14534 SUBSCRIBE

Expires: 600000

Contact: <sip:10.133.202.47:5060>

Record-Route: <sip:10.133.202.47;lr>

Content-Length: 0

 

Step 3 : NOTIFY -----------------------------------

NOTIFY sip:+11234567890@test.3gpp.com SIP/2.0

Via: SIP/2.0/UDP 10.133.202.47:5060;branch=z9hG4bK-d1e4c4961ca9d523ae76b67e088589cd

Call-ID: d57a0b04-785ba328-13a4d876@10.133.202.46

From: <sip:+11234567890@test.3gpp.com>;tag=987654321

To: <sip:+11234567890@test.3gpp.com>;tag=210a54

Subscription-State: active;expires=600000

Event: reg

CSeq: 14534 NOTIFY

Contact: <sip:10.133.202.47:5060>

Max-Forwards: 70

Content-Type: application/reginfo+xml

Content-Length: 340

 

<?xml version="1.0" encoding="UTF-8"?>

<reginfo xmlns="urn:ietf:params:xml:ns:reginfo" version="0" state="full">

<registration aor="sip:+11234567890@test.3gpp.com" id="12345" state="active">

<contact id="100" state="active" event="registered" expires="600000">

<uri>sip:+11234567890@10.133.202.46:50997</uri>

</contact>

</registration>

</reginfo>

 

Step 4 : 200 OK -----------------------------------

SIP/2.0 200 OK

Via: SIP/2.0/UDP 10.133.202.47:5060;branch=z9hG4bK-d1e4c4961ca9d523ae76b67e088589cd

Max-Forwards: 70

Contact: <sip:+11234567890@10.133.202.46:50997>;+sip.instance="<urn:gsma:imei:00440113-904785-0>"

To: <sip:+11234567890@test.3gpp.com>;tag=210a54

From: <sip:+11234567890@test.3gpp.com>;tag=987654321

Call-ID: d57a0b04-785ba328-13a4d876@10.133.202.46

CSeq: 14534 NOTIFY

Allow: NOTIFY,SUBSCRIBE

Content-Length: 0


原文来自:http://www.sharetechnote.com

整理:kangguoying20201023

5G终端接入网络第一把密钥---RA-RNTI计算 ”已在微信公众号"跟着老康学5G"中推出,敬请关注!

扫码关注5G通信官方公众号,免费领取以下5G精品资料
  • 1、回复“afgj”免费领取《 5G基站概述及基本操作
  • 2、回复“qiehuan”免费领取《5G NR切换互操作
  • 3、回复“qiantai”免费领取《5G前台信令流程
  • 4、回复“zxmm”免费领取《5G Massive MIMO网络应用白皮书
  • 5、回复“cyjg”免费领取《高速公路5G智联网技术、方案和应用
  • 6、回复“5gsa2”免费领取《5G SA独立组网部署指南(中文版)
  • 7、回复“hxw”免费领取《一份PPT看懂5G核心网
  • 8、回复“5gdh”免费领取《5G配套电源规划与设计方案
  • 对本帖内容的看法? 我要点评

     
    [充值威望,立即自动到帐] [VIP贵宾权限+威望套餐] 另有大量优惠赠送活动,请光临充值中心
    充值拥有大量的威望和最高的下载权限,下载站内资料无忧

    快速回复主题    
    标题
    内容
     上传资料请点左侧【添加附件】

    当前时区 GMT+8, 现在时间是 2020-11-24 09:45:52
    渝ICP备11001752号  Copyright @ 2006-2016 mscbsc.com  本站统一服务邮箱:mscbsc@163.com

    Processed in 11.978840 second(s), 13 queries , Gzip enabled
    TOP
    清除 Cookies - 联系我们 - 移动通信网 - 移动通信论坛 - 通信招聘网 - Archiver