122 lines
3.7 KiB
Markdown
122 lines
3.7 KiB
Markdown
# 【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-id,Originator(主叫账号),Responder(被叫账号),User-Agent(客户端信息),Server(服务端信息),Media Type(编码),SDP(Responder Content),Duration(持续时间),Bye(挂断方)
|
||
|
||
|
||
|
||
*需求*
|
||
|
||
如上所述,SIP协议中的Reason字段,可以在一个通话中的多个消息中出现,并且定义的protocol至少包括SIP,Q.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**
|
||
|
||
---
|
||
|