Files
geedge-jira/md/OMPUB-1412.md
2025-09-14 21:52:36 +00:00

122 lines
3.7 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 【WMS-UTR项目】SIP协议增加Q.850的cause字段
| ID | Creation Date | Assignee | Status |
|----|----------------|----------|--------|
| OMPUB-1412 | 2024-08-13T18:15:49.000+0800 | 杨威 | 已解决 |
---
1、何老师想在SIP的日志里展示一个Q.850的cause字段内容。
2、Q.850在SIP协议里定义了电话呼叫中的各种信令和错误码https://www.cisco.com/c/zh_cn/support/docs/unified-communications/unified-border-element/214634-voice-router-internal-call-disconnect-ca.html。
!image-2024-08-13-18-15-05-397.png|width=436,height=321!**yangwei** commented on *2024-08-14T17:57:24.285+0800*:
*定义*
按RFC3326定义Reason Field可以在多种SIP消息中出现
!image-2024-08-14-17-33-24-635.png|width=683,height=603!
典型的格式为:
 
{code:java}
Reason : [protocol];[reason-param][reason-param]...[reason-param]{code}
例如:
 
 
{code:java}
Reason: SIP ;cause=200 ;text="Call completed elsewhere"
Reason: Q.850 ;cause=16 ;text="Terminated"
Reason: SIP ;cause=600 ;text="Busy Everywhere"
Reason: SIP ;cause=580 ;text="Precondition Failure"{code}
 
*TSG实现*
sip作为一个典型的包含Transaction的协议TSG使用callid作为Transaction通常对应一个通话的唯一标识以通话为单位记录sip transaction日志每个通话记录如下信息
* call-idOriginator主叫账号Responder被叫账号User-Agent客户端信息Server服务端信息Media Type编码SDPResponder ContentDuration持续时间Bye挂断方
 
*需求*
如上所述SIP协议中的Reason字段可以在一个通话中的多个消息中出现并且定义的protocol至少包括SIPQ.850。
结合issue中给出的思科连接用户需求的意图是记录每个通话挂断的Reason (待确认[~niuxiang] 即记录Method为Bye消息的Reason字段
 
*日志*
考虑SIP日志增加一个新的字段SIP.bye_reason字段值可选如下三种类型
* string即直接输出原始报文中为Reason的值例如 SIP.bye_reason : "Q.850 ;cause=16 ;text=\"Terminated\""
** 优点:结构简单,记录所有原始信息
** 缺点用户在界面进行检索和统计Q.850相关的cause需要单独组织sql语句
* array(string)即按分号拆分Reason值SIP.bye_reason : [”Q.850“”cause=16“, "text=\"Terminated\""]
** 优点预拆分信息类似IP Tags字段方便对protocol或者cause等信息进行检索和统计
** 缺点:功能端预拆分原始信息,拆分失败可能丢失信息
* json string参照Encapsulation字段输出一个可以被反序列化为json的字符串如SIP.bye_reason :  ”[\”Q.850\“,\”cause=16\“, \"text=\"Terminated\"\"]”
** 优点:便于后期扩展
** 缺点检索和统计Q.850相关的cause需要单独组织sql语句
 
 
---
**niuxiang** commented on *2024-08-15T16:38:32.746+0800*:
[~yangwei] 
跟何老师确认一下需求:
1、他只关心cause字段不要全部的reason
2、需要全部的cause字段不只是Bye消息
---
**yangwei** commented on *2024-09-26T10:05:08.416+0800*:
已在[2024-09-23 Hotfix firewall module to support IP CIDR mapping, SIP Cause, and fix excessive memory usage|https://docs.geedge.net/display/TSGEN/2024-09-23+Hotfix+firewall+module+to+support+IP+CIDR+mapping%2C+SIP+Cause%2C+and+fix+excessive+memory+usage]中更新该功能
---
## Attachments
**61131/image-2024-08-13-18-15-05-397.png**
---
**61212/image-2024-08-14-17-20-21-632.png**
---
**61213/image-2024-08-14-17-31-18-831.png**
---
**61214/image-2024-08-14-17-33-24-635.png**
---
**61133/msh-sip02.pcapng**
---