Display SIP message flow using Sipviewer

 
Jump to: navigation, search

Diagnosing complex SIP problems often requires looking at the SIP message flow between the components of sipXecs, as well as to and from phones and external gateways. This page tells the adventurous how to use the tools that come with sipXecs to display SIP message flows. Sipviewer is a very powerful toll used to diagnose problems.

Contents

[hide]
<script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>

Installation

Before you can display the messages, you need to install the viewer. You can do that either on the sipXecs system itself (which requires a few prerequisites not installed by the ISO image), or standalone on your regular system (Windows, Mac, or Linux). Once you've gotten one of these done, you're ready to collect trace data for viewing.

Standalone

There is a standalone installer for the sipviewer tool in the temp area on the sipxecs project server:

Download the sipviewer installer

The above installer is a java .jar file - execute it on your system to run the installer, eg:

 java -jar sipviewer-install.jar

The installer should work on any system (Linux, Windows, Mac) that has java installed.

On your sipXecs system

On RPM-based distributions sipviewer is installed with the sipxtacklib RPM; there is a separate package sipviewer for Debian. Sipviewer is written in Java and requires an X server to be running to display results graphically (the ISO installer does not by default include this, but see .

Make sure the necessary packages are installed on the host that runs sipXecs:

yum install xorg-x11-xinit
yum install java-1.5.0-sun-fonts

The package java-1.5.0-sun-fonts can be found in the sipXecs repository.

Getting SIP Messages to display

The SIP messages are logged by sipXecs components at the INFO logging level; this is a more verbose level than the default NOTICE level. You will need to reset the logging level for the components you're interested in tracing - you should always include the proxy (in 3.8 or earlier, both the proxy and authproxy, in 3.10 they are merged into one proxy) and the registrar.

  • Enable INFO or DEBUG log level for the sipXecs proxy server. You can do this using the sipXconfig UI.

You must restart the components for the change in logging level to take effect.

There is a script named 'sipx-trace' installed (by the sipxtools rpm) in your sipXecs system. To create an xml file that contains trace data for messages on your system:

 sipx-trace --all-components --output <filename> <token>...

where <filename> is the output file and <token> is some token that will be in the call (call-id values are best for this, but even the calling number followed by '@' will find it; it will just find lots of other stuff too).

You can copy that xml file to any system where you have installed the sipviewer tool to display the trace, and you can post that file to a mailing list to ask for help interpreting it (be sure to also post a description of your configuration, including the IP addresses for all the components that show in the trace).

Using Sipviewer over an ssh connection

In many cases you will not have an X server running on the sipXecs host.

  • From your client type the following:
xhost +
ssh -Y user@pbx.example.com

The DISPLAY variable for the X server is set automatically. You can verify this using "echo $DISPLAY". You can also verify the connection by starting xterm. The xterm window should appear on your client workstation.

  • Now run these commands in the shell you just started over ssh on the sipXecs host:
cd /var/log/sipxpbx
merge-logs
sipviewer merged.xml

sipviewer is sensitive to log files that are too large. You can delete all the logs in /var/log/sipxpbx and then reproduce the problem before capturing the logs. All the log files are created if they do not exist automatically.

  • If your log is really big or you want to narrow your inspection to just one user
grep "user@example.com" /var/log/sipxpbx/sipproxy.log | syslog2siptrace > /tmp/sipproxy-trace.xml
sipviewer /tmp/sipproxy-trace.xml

Image:Sipviewer.png

Using Sipviewer - More details

First, the needed information must be contained in the sipX log files. The level of detail in the logs is controlled by the log level for each component. If sipXconfig is running the log level can easily be changed in the Web UI by going to "System/General/Logging". Alternatively logging levels can be changed in the configuration files of the respective component. These configuration files are located in the directory /etc/sipxpbx:

 proxy-config.in
authproxy-config.in
registrar-config.in
 
mediaserver-config.in
sipxpark-config.in
sipxpresence-config.in
status-config.in

For most of the components, look for a line like this:

 SIP_AUTHPROXY_LOG_LEVEL : NOTICE

and replace NOTICE with DEBUG. In mediaserver-config.in, the controlling line is:

 mediaserver.log.level         VXIString       NOTICE

To get useful information, the first three components listed above (proxy, authproxy, registrar) must be set at INFO or DEBUG (usually INFO is sufficient, and makes for much smaller log files). You should also have detailed logging about for any other component you suspect to be involved in the problem.

In order to display the SIP traffic through sipX, execute the following commands:

 cd /var/log/sipxpbx
merge-logs
sipviewer merged.xml
  • The executables (merge-logs and sipviewer, and the two programs that merge-logs invokes, syslog2siptrace and siptrace-merge) are normally installed in /usr/bin. If you have them installed in a non-standard directory, you should have that directory in your path. You can invoke merge-logs and sipviewer with full path names, but merge-logs expects syslog2siptrace and siptrace-merge to be runnable through the path.
  • These programs are a collection of shell scripts, Perl scripts, and Java executables. If you con't have those interpreters available, this method won't work.
  • Often there are many SIP messages in the logs that you aren't interested in. merge-logs takes a collection of arguments that will exclude messages that are not of interest. Its arguments are the same as those of siptrace-merge, which are described at the top of that file (/usr/bin/siptrace-merge). Especially useful are --containing, to specify the call-ID of a dialog, --after and --before, to restrict to a certain period of time, and --exclude-method, to screen out the housekeeping SUBSCRIBE, NOTIFY, PUBLISH, and REGISTER transactions. The timestamps that --after and --before use are in GMT, use the format 2006-09-01T20:32:10, and are compared with the lines of the log files as text strings. Use date -u +%Y-%m-%dT%H:%M:%S to print the current time in this format.
  • SIP messages are displayed by sipviewer. sipviewer takes some getting used to, but is quite sophisticated. The vertical lines denote the SIP agents sending and receiving messages. Beware that sometimes sipviewer cannot determine that two addresses are equivalent, and so an agent will be represented by more than one vertical line. You can click between the headers of two vertical lines to exchange them, so you can put the vertical lines in any order you want. If two vertical lines are really the same agent, it usually helps to put them next to each other.
  • When the mouse is over a SIP message, it is highlighed in red, and the details of the message are shown in the lower panels. If you click on the message, a window pops up giving the full text of the message. The window can be closed with the Escape key.
  • When a SIP message is highlighted, related messages are highlighted:
    • green - other messages in this transaction, between these two agents
    • blue - other messages in this transaction, between different agents in the chain
    • yellow - other messages in this dialog
  • SIP messages colored blue and yellow also are coded:
    • light color - has the same from-tag and to-tag as the chosen message, and so is in the same branch of a fork
    • dark color - has different tags, and so is either in a different branch of a fork, or (more likely) are the request and response of an initial request (since the request has no to-tag, but the response does)
  • Looking at a few normal calls will familiarize you with the standard sipX message flow, so you will be able to recognize erroneous message flows.
(From http://sipx-wiki.calivia.com/index.php/Display_SIP_message_flow_using_Sipviewer)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
资源包主要包含以下内容: ASP项目源码:每个资源包中都包含完整的ASP项目源码,这些源码采用了经典的ASP技术开发,结构清晰、注释详细,帮助用户轻松理解整个项目的逻辑和实现方式。通过这些源码,用户可以学习到ASP的基本语法、服务器端脚本编写方法、数据库操作、用户权限管理等关键技术。 数据库设计文件:为了方便用户更好地理解系统的后台逻辑,每个项目中都附带了完整的数据库设计文件。这些文件通常包括数据库结构图、数据表设计文档,以及示例数据SQL脚本。用户可以通过这些文件快速搭建项目所需的数据库环境,并了解各个数据表之间的关系和作用。 详细的开发文档:每个资源包都附有详细的开发文档,文档内容包括项目背景介绍、功能模块说明、系统流程图、用户界面设计以及关键代码解析等。这些文档为用户提供了深入的学习材料,使得即便是从零开始的开发者也能逐步掌握项目开发的全过程。 项目演示与使用指南:为帮助用户更好地理解和使用这些ASP项目,每个资源包中都包含项目的演示文件和使用指南。演示文件通常以视频或图文形式展示项目的主要功能和操作流程,使用指南则详细说明了如何配置开发环境、部署项目以及常见问题的解决方法。 毕业设计参考:对于正在准备毕业设计的学生来说,这些资源包是绝佳的参考材料。每个项目不仅功能完善、结构清晰,还符合常见的毕业设计要求和标准。通过这些项目,学生可以学习到如何从零开始构建一个完整的Web系统,并积累丰富的项目经验。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值