网站建设 地址 上海石门二路快速做网站的方法

当前位置: 首页 > news >正文

网站建设 地址 上海石门二路,快速做网站的方法,seo网站内容,兰州网站移动端优化规范解读GB28181-2022注册、注销基本要求相对GB28181-2016版本#xff0c;做了一定的调整#xff0c;新调整的部分如下#xff1a;——更改了注册和注销基本要求#xff08;见 9.1.1#xff0c;2016 年版的 9.1.1#xff09;。1.增加对NAT模式网络传输要求#xff0c;宜…规范解读GB28181-2022注册、注销基本要求相对GB28181-2016版本做了一定的调整新调整的部分如下——更改了注册和注销基本要求见 9.1.12016 年版的 9.1.1。1.增加对NAT模式网络传输要求宜增加TCP传输模式——增加了注册重定向见 9.1.2.3。这里我们来看看GB28181-2022针对注册和注销的基本要求a)SIP客户端,网关、SIP设备、联网系统等SIP代理(SIP UA)应使用IETF RFC 3261定义的REGISTER方法进行注册和注销。注册和注销时应进行认证,认证方式应支持数字摘要认证方式,高安全级别的宜支持数字证书的认证方式。b)注册成功后,SIP代理在注册过期时间到来之前,应向注册服务器进行刷新注册﹐刷新注册消息流程应与9.1.2.1的流程描述一致,并遵循IETF RFC 3261对刷新注册的规定。c)若注册失败,SIP代理应间隔一定时间后继续发起注册过程,与上一次注册时间间隔应可调一般情况下不应短于60 s。d)系统、设备注册过期时间应可配置,缺省值为86 400 s(1 天),应在注册过期时间到来之前发送刷新注册消息,为SIP服务器预留适当刷新注册处理时间,注册过期时间不应短于3600 s。e)SIP代理注册成功则认为SIP服务器为在线状态,注册失败则认为SIP服务器为离线状态SIP服务器在SIP代理注册成功后认为其为在线状态,SIP代理注册过期则认为其为离线状态。f)对于处于开启网络地址转换(NAT)功能的路由器内侧的SIP代理,宜支持使用TCP发起注册,并在注册成功后保持TCP连接不关闭,SIP代理及服务器在该TCP通道里发送心跳、刷新注册、视音频点播、控制等所有请求及响应SIP消息。若TCP通道断开,则认为SIP代理异常掉线,SIP代理应按前述要求间隔一定时间后重新发起注册。相对GB28181-2016注册和注销基本要求主要增加了NAT模式下的网络传输要求建议增加TCP传输模式。下面我们来看看注册重定向注册重定向在GB28181-2016规范并没有体现GB28181-2022针对此做了详细的说明注册重定向流程如下注册重定向流程描述如下:a)1 :设备或系统端的SIP代理向SIP重定向服务器发起注册请求;b)(可选)2:SIP重定向服务器向SIP代理发送响应401,并在响应的消息头 WWW-Authentica字段中给出适合SIP代理的认证体制和参数;c)(可选)3;SIP代理重新向SIP重定向服务器发送REGISTER请求,在请求的Authorization字段给出信任书,包含认证信息;d)4:SIP重定向服务器对请求进行验证,如果检查出SIP代理身份合法,SIP重定向服务器根据内部策略选择设备需注册的SIP服务器A,并回复注册请求响应302,响应消息携带Contact头域和Expires,Contact格式为(sip;SIP服务器A编码目的IP地址端口,在此头域中携带SIP服务A的地址;e)5:SIP代理收到302重定向响应后,向SIP服务器A发起注册;f)6~8:完成注册重定向流程后后续所有请求和响应动作由SIP服务器A和设备直接完成;g)重定向后,如果SIP代理按照9.1.1的注册要求或9.6.1的心跳要求,判定SIP服务器A离线,或注册被SIP服务器A拒绝(包括403或500等错误),则SIP代理应重新执行注册重定向流程,向SIP重定向服务器发起注册请求。技术实现本文以大牛直播SDK的Android平台GB28181设备接入端为例通过setTransportProtocol()接口信令可选TCP或UDP模式/** Author: daniusdk.com*/ private boolean initGB28181Agent() {if ( gb28181agent ! null )return true;getLocation(context_);String local_ipaddr IPAddrUtils.getIpAddress(context);Log.i(TAG, initGB28181Agent local ip addr: local_ip_addr);if ( local_ip_addr null || local_ip_addr.isEmpty() ) {Log.e(TAG, initGB28181Agent local ip is empty);return false;}gb28181agent GBSIPAgentFactory.getInstance().create();if ( gb28181agent null ) {Log.e(TAG, initGB28181Agent create agent failed);return false;}gb28181agent.addListener(this);gb28181agent.addPlayListener(this);gb28181agent.addTalkListener(this);gb28181agent.addAudioBroadcastListener(this);gb28181agent.addDeviceControlListener(this);gb28181agent.addQueryCommandListener(this);// 必填信息gb28181agent.setLocalAddress(local_ip_addr);gb28181agent.setServerParameter(gb28181_sip_serveraddr, gb28181_sip_serverport, gb28181_sip_serverid, gb28181_sipdomain);gb28181agent.setUserInfo(gb28181_sipusername, gb28181_sippassword);// 可选参数gb28181agent.setUserAgent(gb28181_sip_user_agentfiled);gb28181agent.setTransportProtocol(gb28181_sip_trans_protocol_0?UDP:TCP);// GB28181配置gb28181agent.config(gb28181_regexpired, gb28181_heartbeatinterval, gb28181_heartbeatcount);com.gb.ntsignalling.Device gb_device new com.gb.ntsignalling.Device(34020000001380000001, 安卓测试设备, Build.MANUFACTURER, Build.MODEL,宇宙,火星1,火星, true);if (mLongitude ! null mLatitude ! null) {com.gb.ntsignalling.DevicePosition device_pos new com.gb.ntsignalling.DevicePosition();device_pos.setTime(mLocationTime);device_pos.setLongitude(mLongitude);device_pos.setLatitude(mLatitude);gb_device.setPosition(device_pos);gb_device.setSupportMobilePosition(true); // 设置支持移动位置上报}gb28181agent.addDevice(gb_device);/com.gb.ntsignalling.Device gb_device1 new com.gb.ntsignalling.Device(34020000001380000002, 安卓测试设备2, Build.MANUFACTURER, Build.MODEL,宇宙,火星1,火星, true);if (mLongitude ! null mLatitude ! null) {com.gb.ntsignalling.DevicePosition device_pos new com.gb.ntsignalling.DevicePosition();device_pos.setTime(mLocationTime);device_pos.setLongitude(mLongitude);device_pos.setLatitude(mLatitude);gb_device1.setPosition(device_pos);gb_device1.setSupportMobilePosition(true);}gb28181agent.addDevice(gb_device1);/if (!gb28181agent.createSipStack()) {gb28181agent null;Log.e(TAG, initGB28181Agent gb28181agent.createSipStack failed.);return false;}boolean is_bind_local_port_ok false;// 最多尝试5000个端口int try_end_port gb28181_sip_local_portbase 5000;try_end_port try_end_port 65536 ?65536: try_end_port;for (int i gb28181_sip_local_portbase; i try_end_port; i) {if (gb28181agent.bindLocalPort(i)) {is_bind_local_port_ok true;break;}}if (!is_bind_local_port_ok) {gb28181agent.releaseSipStack();gb28181agent null;Log.e(TAG, initGB28181Agent gb28181agent.bindLocalPort failed.);return false;}if (!gb28181agent.initialize()) {gb28181agent.unBindLocalPort();gb28181agent.releaseSipStack();gb28181agent null;Log.e(TAG, initGB28181Agent gb28181agent.initialize failed.);return false;}return true; }Override public void ntsRegisterOK(String dateString) {Log.i(TAG, ntsRegisterOK Date: (dateString! null? dateString : )); }Override public void ntsRegisterTimeout() {Log.e(TAG, ntsRegisterTimeout); }Override public void ntsRegisterTransportError(String errorInfo) {Log.e(TAG, ntsRegisterTransportError error: (errorInfo ! null?errorInfo :)); }总结以上是GB28181-2022注册注销基本要求和注册重定向相关的调整感兴趣的开发者可以直接阅读相关规范总的来说GB28181-2022更全面2016版忽略的细节好多都已很完善剩下的就是需要开发者们调整自己的业务逻辑快速兼容GB28181-2022版。