Giter Club home page Giter Club logo

sipp's Introduction

Coverity Scan Build Status

SIPp - a SIP protocol test tool Copyright (C) 2003-2020 - The Authors

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Documentation

See the docs/ directory. It should also be available in html format at: https://sipp.readthedocs.io/en/latest/

Build a local copy using: sphinx-build docs _build

Building

This is the SIPp package. Please refer to the webpage for details and documentation.

Normally, you should be able to build SIPp by using CMake:

cmake .
make

The SIPp master branch (3.7.x) requires a modern C++11 compiler.

There are several optional flags to enable features (SIP-over-TLS, SIP-over-SCTP, media playback from PCAP files and the GNU Scientific Libraries for random distributions):

cmake . -DUSE_SSL=1 -DUSE_SCTP=1 -DUSE_PCAP=1 -DUSE_GSL=1

Static builds

SIPp can be built into a single static binary, removing the need for libraries to exist on the target system and maximising portability.

This is a fairly complicated process, and for now, it only works on Alpine Linux.

To build a static binary, pass -DBUILD_STATIC=1 to cmake.

Two Alpine-based Dockerfiles are provided, which can be used as a build-environment. Use either Dockerfile or Dockerfile.full in the following commands:

git submodule update --init
docker build -t sipp -f docker/Dockerfile --output=. --target=bin .

Support

I try and be responsive to issues raised on Github, and there's a reasonably active mailing list.

Making a release

  • Update CHANGES.md. Tag release. Do a build.
  • Make sipp.1 by calling:
    help2man --output=sipp.1 -v -v --no-info \
      --name='SIP testing tool and traffic generator' ./sipp
    
  • Then:
    mkdir sipp-$VERSION
    git ls-files -z | tar -c --null \
       --exclude=gmock --exclude=gtest --files-from=- | tar -xC sipp-$VERSION
    cp sipp.1 sipp-$VERSION/
    # check version, and do
    cp ${PROJECT_BINARY_DIR:-.}/version.h sipp-$VERSION/include/
    tar --sort=name --mtime="@$(git log -1 --format=%ct)" \
          --owner=0 --group=0 --numeric-owner \
          -czf sipp-$VERSION.tar.gz sipp-$VERSION
    
  • Upload to github as "binary". Note that github replaces tilde sign (for ~rcX) with a period.
  • Create a static binary and upload this to github as well:
    docker build -t sipp -f docker/Dockerfile --output=. --target=bin .
    
  • Note that the static build is broken at the moment. See ldd sipp.

Contributing

SIPp is free software, under the terms of the GPL licence (see the LICENCE.txt file for details). You can contribute to the development of SIPp and use the standard Github fork/pull request method to integrate your changes integrate your changes. If you make changes in SIPp, PLEASE follow a few coding rules:

  • Please stay conformant with the current indentation style (4 spaces indent, standard Emacs-like indentation). Examples:

    if (condition) {        /* "{" even if only one instruction */
        f();                /* 4 space indents */
    } else {
        char* p = ptr;      /* C++-style pointer declaration placement */
        g(p);
    }
    
  • If possible, check that your changes can be compiled on:

    • Linux,
    • Cygwin,
    • Mac OS X,
    • FreeBSD.

Thanks,

Rob Day [email protected]

sipp's People

Contributors

andrey-starodubtsev avatar bklang avatar bluerise avatar codyherzog-zz avatar dependabot[bot] avatar hagbard-c avatar jeannotlanglois avatar kadabusha avatar leedm777 avatar lekensteyn avatar lemenkov avatar linuxmaniac avatar mctrk avatar mstovenour avatar nshopik avatar ojacques avatar orgads avatar p120ph37 avatar pbertera avatar peter-oneill avatar rkday avatar rsvargas avatar ryandesign avatar sjthomason avatar smititelu avatar ticpu avatar treyadg avatar uhle avatar vodik avatar wdoekes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sipp's Issues

Ruby test harness

SIPped, the Polycom fork of SIPp (https://github.com/SIPp/polycom-sipped) has a Ruby test harness that can be used to drive SIPp and provide regression testing. It would be good to get this merged into the main SIPp code.

It looks as though the relevant commits are 89b5049, 89b5049, c63a904, e4d066d, 4955dec, 13588ce, fd4b38a, aae26fb, 7613269, ae0c8c4, 2d4086e, d7cf829, bc538bd, f38926b, 324d4e0, 28316f8, d060afe, 78b55d8, d087c8c, 165cdfe, 69c83e6, b335a2d, 9909784, 1db1b71, 47d9eef, e542254, c026762, 9860f4f, 0b68d95, 801707f, 2e09034, df9b28a, 1d0294d, 938b50c, 954985d, 298669d, 94f13e0, 4ce98bb, c56e5e4, 723ab5a, 2326a97, 3589a39, f54e544, 3745aa4, a04b599, 9756227, d945d10 and 670b001, though some of these relate to Ruby tests for other features not yet merged.

There are also a set of commits relating to making the test harness run on Windows - these are 7dbdc72, 2d857ce, a64364c, 9e01953, e5edfab, e8588a5 and 68bd8c9.

Support DNS round-robin

If SIPp has a DNS name which resolves to multiple IP addresses, it should be able to choose an IP address each time it opens a socket rather than once at the start.

Metaswitch/sipp@2ecb63b is a good basis for this work, but it would be nice to support UDP, and nice to make it a command-line option (so there's no per-call DNS lookup which might impact performance).

Additional keywords

SIPped, the Polycom fork of SIPp (https://github.com/SIPp/polycom-sipped) has support for new keywords - [remote_tag], [remote_tag_param], [contact_uri], [contact_value], [to_uri], [to_value], [from_uri] and [from_value]. It might be good to get this merged into the main SIPp code (although other Polycom additions like the ability to just get the value from a last_ header may replace from_value etc.).

It looks as though the relevant commits are a5011a6 (remote_tag, remote_tag_param) and 9013201 (the others).

Content-Length generation is buggy

SIPped, the Polycom fork of SIPp (https://github.com/SIPp/polycom-sipped) fixes up the Content-Length keyword so that it works when it's in the middle of the header list and the body is not empty. It would be good to get this merged into the main SIPp code.

It looks as though the relevant commits are 309bce6, bf84fdb and 78a060b.

Add fax/t38 support

The guys at https://code.osso.nl/projects/sipp have a nice fork of sipp 3.2 that adds support for t38 fax in sipp.

A new directive send_pcap_image is added and the support for the pcap files containing fax images.

With the permission of the authors, we could add this feature in sipp.

Transaction support

SIPped, the Polycom fork of SIPp (https://github.com/SIPp/polycom-sipped) includes transaction support. It would be good to get this merged into the main SIPp code.

It looks as though the relevant commits are 42a425d, 571793a, 95b2458, 11ae252, 2ba6966, 64b098d, 1a432ca, 7edd4b2, dc5587f, c9f04d5, 1e97bbd and 43e2f15.

Add JUnit output [enhancement]

For those people using sipp for functional testing, it would be nice to have the option to output the final result in junit format.

Master cannot be started, if it only controls slaves

(Originally https://sourceforge.net/p/sipp/bugs/121/)

In complicated call scenarios, I need a master who's only job is to control slaves, so I don't have to mix the scenario control with the SIP blocks. Plus, error handling would be much easier this way.
However, sipp does not allow to have a component that is neither a server or a client, i.e. does not have any send or recv commands, only sendCmd and recvCmd commands:
"Unable to determine send mode of the tool (server, client)"
even if there is no need the master to interact on SIP level at all. There is no command line parameter to specify the server/client role (as far as I have seen), so there is no workaround.

Generation of local/remote tags

SIPped, the Polycom fork of SIPp (https://github.com/SIPp/polycom-sipped) has support for generating local and remote peer tags, and exercising finer control over their generation. It would be good to get this merged into the main SIPp code.

It looks as though the relevant commits are edf7110, 6a54032, 7e3714e, 4c40e08 and d885d16.

Allow multiple RTDs to be started/stopped at once

It may be desirable to have a certain message start or stop more than one RTDs. It's not possible to have multiple attributes in a single XML tag, so would be illegal - the syntax should probably be .

Messages currently only store one RTD number, which is the main problem here.

Improvements to <exec> function

SIPped, the Polycom fork of SIPp (https://github.com/SIPp/polycom-sipped) has improved the command, adding the ability to wait for a return code and verify it, as well as output tracing. It would be good to get this merged into the main SIPp code.

It looks as though the relevant commits are 9013201, bca0bcc and 2a23974 for return code verification (which might be a good task for a new dev) and 9013201, 571793a, f7d2e97, 1c9f029 and ba9f6b7 for improved tracing.

Segmentation fault when the first command is sendCmd

(Originally https://sourceforge.net/p/sipp/bugs/120/)

SIPp makes a segfault when the first command in the master's scenario is a sendCmd. It works fine, if sendCmd follows a regular send command. If nop or pause precedes the sendCmd, it does not help either. The problem can always be reproduced.

Segmentation fault ./sipp -sf ../scenarios/3pty/3pty_normal_A_send.xml -inf ../scenarios/3pty/3pty_normal.csv -i 130.100.227.249 10.64.65.4:5082 -mp 6252 -buff_size 1000000000 -slave_cfg ../scenarios/3pty/3pty_normal_3PCC.cfg -master 3pty_normal_A_master -r 0 -rp 1000 -l 100

Race condition in threads (PCAP PLAY , RTP echo)

(Originally https://sourceforge.net/p/sipp/bugs/139/)

In SIPP code, are several variables which are accessed (read and write ) by several threads , but they are not protected by any mutex or semaphor. This is causing random sengmentation faults and race conditions. Especially in sending RTP packets (PCAP PLAY) and receiving RTP stream (RTP echo). This problems can be detected with valgrind tool DRD .

$ valgrind --tool=drd --read-var-info=yes ./sipp -aa -sf CallOriginatorByeSend.xml -rtp_echo -m 1 -inf SimpleCall.csv 172.28.60.2

This is list of some problematic variables :
rtp_pckts_pcap
rtp_bytes_pcap
rtp_pckts
rtp_bytes
rtp2_pckts
rtp2_bytes
clock_tick

-periodic_rtd option should be deprecated in favour of multiple columns

In the statistics dump file, most counts have a "(P)" or "(C)" appended to indicate whether they are periodic or cumulative (i.e. whether they relate to the whole run or just the last statistics period). Response Time Duration stats are controlled by a -periodic_rtd option instead, but it would be more consistent to have a (P) and a (C) column.

Improve error logging

SIPped, the Polycom fork of SIPp (https://github.com/SIPp/polycom-sipped) includes several improvements to error logging. It would be good to get this merged into the main SIPp code.

It looks as though the relevant commits are 3d3a0a5, 89fd326, 54dd3c1, b1587e0, a704051, 442cf8b and d46cc7a.

Stdout redirect to /dev/null results in epoll error

When

  • using a sipp from the 3.4 branch and
  • the stdout (and stderr) is redirected to /dev/null

we get the following behaviour:

  • sipp fails to run
  • the following error is logged in server__error file:
2014-01-29  10:30:12.990978 1390984212.990978: Failed to add FD to epoll, errno = 1 (Operation not permitted).

This does not replicate with sipp 3.3

Multiple dialogs per scenario

SIPped, the Polycom fork of SIPp (https://github.com/SIPp/polycom-sipped) has support for multiple dialogs with different Call-IDs within the same scenario file. It would be good to get this merged into the main SIPp code.

It looks as though the relevant commits are a5011a6, 6a54032, a704051, 464f623 ande4179a2.

Fix up IP address handling for media

SIPped, the Polycom fork of SIPp (https://github.com/SIPp/polycom-sipped) includes several improvements to media socket handling (including sending media from the same IP as signalling, from the default IP, or from a specified second IP). It would be good to get this merged into the main SIPp code.

It looks as though the relevant commits are 1ed9011, 9d66ded, eef0864, 42374ff, 093bf13, abc836a, 2ba2fdc, c892b62, a9db14c, f74622c and 2dec60e.

Win32 port

SIPped, the Polycom fork of SIPp (https://github.com/SIPp/polycom-sipped) compiles natively on Widows with Visual Studio (i.e. without Cygwin). It would be good to get this merged into the main SIPp code.

It looks as though the relevant commits are a5011a6, 57220e0, d3a4b09, ac0cb41, cafe0f3, 3b96e94, 7dc7c0a, 07dddd1, 428a2ea, 37f9d19, 1776d34, 8c0d813, 8df0de5, 7c2df78, d63f0a5, 49763eb, 57fe216, 5b6f12c, 2c50756, f68cfe8, ba3fdf6, 4700588, 331c6ed, 1ad906e, ee4c148, 20d6457, 95bec90, 5098602, 1a36dba, 892a9e2, 3072d2c and 981909.

Auto-answer of REGISTERs

SIPped, the Polycom fork of SIPp (https://github.com/SIPp/polycom-sipped) has support for auto-answering REGISTER messages, including options to set the Expires header and so on. It would be good to get this merged into the main SIPp code.

It looks as though the relevant commits are a5011a6, 89b5049, ae29def and 76e93a0.

Sequence diagram dump

SIPped, the Polycom fork of SIPp (https://github.com/SIPp/polycom-sipped) has support for dumping out the sequence diagram that is shown in the ncurses UI. It would be good to get this merged into the main SIPp code.

It looks as though the relevant commits are edf7110, 069251f, 1c6dd15, 2326a97, 3589a39 and ee4c148.

Add support for a cfg file instead of cli arguments

Instead of cli arguments we should support all those options in a cfg file

Ex:

sipp -c scenario.cfg 

versus

sipp -sf scenario.xml -inf scenario.csv  sut.hostname.me -mp 1234 -i 10.11.12.13 -t u1  -p 1232 -r 10 -m 200 -l 15 -aa

The format of the cfg file may be yaml, json or something else.
This can be added to work in parallel with the current mode.

Can't play both audio and video

(Originally https://sourceforge.net/p/sipp/bugs/122/)

Using version: SIPp v3.1-PCAP, version unknown, built Apr 28 2010, 08:46:05.
I observed that attempts to start audio and video at the same time using pcap_play_audio and pcap_play_video to send two streams, the second one always succeeds and the first always fails.
Examining the code, I note that in call.cpp the media thread responsible for both is cancelled whenever the next pcap_play_xxx. That would appear to be the root of the problem.

Crash when using -trace_stats and -stf

(Originally at https://sourceforge.net/p/sipp/bugs/143/, which has a proposed patch).

Starting program: /usr/bin/sipp -trace_stat -stf stats -sf uac_invite.xml -timeout 300.0 192.168.15.23
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE = 1024
Resolving remote host '192.168.15.23'... Done.
Program received signal SIGSEGV, Segmentation fault.
__strcpy_ssse3 () at ../sysdeps/i386/i686/multiarch/strcpy-ssse3.S:2959
2959 movlpd %xmm0, (%edx)
(gdb) bt
0 __strcpy_ssse3 () at ../sysdeps/i386/i686/multiarch/strcpy-ssse3.S:2959
1 0x080746cc in strcpy (src=, dest=)
at /usr/include/bits/string3.h:104
2 CStat::sRepartitionInfo (this=this@entry=0x81ee590,
tabRepartition=0x81f0bd8, sizeOfTab=9) at stat.cpp:1151
3 0x08078c19 in CStat::dumpData (this=0x81ee590) at stat.cpp:1666
4 0x08082d92 in stattask::report () at reporttask.cpp:86
5 0x080719e1 in traffic_thread () at sipp.cpp:3643
6 0x0804dfa3 in main (argc=9, argv=0xbffff094) at sipp.cpp:5495

Clear variable before use by ereg action

If a variable has already been set before being used in an assign_to of an ereg action where check_it is set to true, the action will always succeed even if the regex does not match. This behavior is due to the way that the ereg action uses the primary match variable and doesn't seem to be fixable without changing the underlying CCallVariable class to be resettable (it may be possible through a mechanism I am unaware of since I don't know the codebase that well).

Allow capitalised booleans

SIPped, the Polycom fork of SIPp (https://github.com/SIPp/polycom-sipped) allows boolean values to be specified regardless of capitalisation, instead of just "true" and "false" in lowercase. It would be good to get this merged into the main SIPp code.

It looks as though the relevant commit is 81af0e1.

Allow ereg to omit assign_to

The regex matching in SIPp should be allowed to omit assign_to if check_it or check_it_inverse are set. Requiring assign_to to be present in these circumstances presents an annoyance since checking the value of the match beyond the regex itself is often unnecessary and the single variable reference must then be resolved.

Use multiple ports for rtp stream

(Originally https://sourceforge.net/p/sipp/bugs/141/)

I believe I've encountered a bug using sipp 3.3 as a UAS with the -rtp_echo flag under high call volumes. Essentially, after about 200-300 simultaneous calls, the DUT is unable to establish more streams to the single UDP port of 6001, resulting in a discrepancy in the TX/RX bandwidth. I believe this only occurs when connection tracking is enabled on the DUT. Unfortunately, there's no way to disable connection tracking on the DUT.
However, the overall call flow scenario isn't very realistic, where the RTP streams for all calls are destined to a single port on the UAS side (that is, the 200 OK from the UAS has the same media port). Is there a way to have the rtp_echo dynamically allocate ports?
I have tried doing a custom UAS scenario where the 200 ok uses the [auto_media_port] variable in the SDP in hopes of having the rtp_echo parameter use that rather than the static port, but that did not work, nor did supplying the "-t un" option to the UAS scenario or using multiple "-mp 5555 -mp 4444" values.

XML parser speedup

SIPped, the Polycom fork of SIPp (https://github.com/SIPp/polycom-sipped) improves the XML parser by using strcmp rather than strnstr where possible. It would be good to get this merged into the main SIPp code.

It looks as though the relevant commit is 440dd63.

XML include statements

SIPped, the Polycom fork of SIPp (https://github.com/SIPp/polycom-sipped) has support for including XML scenario files within other XML scenario files through the xi:include directive. It would be good to get this merged into the main SIPp code.

It looks as though the relevant commits are a5011a6, 89b5049, 54866d2, edf7110, 42a425d, a22a738, 3ac1f7f, 97e4d13 and 7463bac.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.