项目作者: jchavanton

项目描述 :
SIP performance test tool
高级语言: C
项目地址: git://github.com/jchavanton/voip_perf.git
创建时间: 2017-07-21T16:26:35Z
项目社区:https://github.com/jchavanton/voip_perf

开源协议:

下载


Docker Pulls

GitHub Logo

ABOUT

VoIP perf

It is a SIP signaling performance testing application that can provide a server and a client.
It can produce latency stats at specified intervals in csv to measure the response time of any SIP endpoint.
It can also read a json configuration file and randomize numbers.

Docker quick start

quick start with docker

Linux Debian building from sources

see commands in Dockerfile

Example : starting a server

  1. ./voip_perf \
  2. --local-port=5072 \ # server listening port
  3. --trying \ # when receiving invite 100 trying will be send
  4. --ringing \ # when receiving invite 183 will be sent
  5. --thread-count=4 \ # number of server threads created
  6. --delay=1500 # ringing delay in MS 1.5 second

Example : starting a client

This will send one INVITE to a randomise number starting with +1206?????? to server 1.1.1.1

  1. ./voip_perf \
  2. "sip:+1206???????@1.1.1.1" \ # target R-URI, <?> will be replaced by random digit
  3. --method="INVITE" \ # method
  4. --local-port=5072 \ # source port
  5. --caller-id="+1??????????" \ # user part of the From header, <?> will be replaced by random digit
  6. --count=1 \ # total calls to send
  7. --proxy=2.2.2.2 \ # this will send the SIP message to a SIP proxy instead of the host in R-URI
  8. --duration=5 \ # send BYE after 5 seconds
  9. --call-per-second=500 \ # send 500cps
  10. --window=100000 \ # maximum amount of in progress calls
  11. --thread-count=1 \ # number of thread used
  12. --interval=1 \ # reporting interval, everyone second a line is added to voip_perf_stats.log with latency metrics
  13. --timeout 7200 # total run time , if all the requests where not send, voip_perf will stop and report scnenario timeout
  14. # --verbose # runwith verbose logs

Example : starting a client with TLS

  1. ./voip_perf "sip:+1??????????@sip.domain.com:5061;transport=tls" \
  2. --local-port=5050 \
  3. --method="INVITE" \
  4. --caller-id="+1??????????" \
  5. --interval=1 \
  6. --count=20 \
  7. --call-per-second=10 \
  8. --window=25 \
  9. --thread-count=1 \
  10. --use-tls \
  11. --timeout 7200 \
  12. --tls-cert="tls/certificate.pem" \
  13. --tls-key="tls/key.pem" \
  14. --tls-calist="tls/ca_list.pem" \
  15. --conf="conf.json"
  16. # --verbose \

Example : config in json file

  1. {
  2. "server" : [
  3. {
  4. "response" : [
  5. { "code" : 200,
  6. "reason" : "OK",
  7. "probability" : 0.6
  8. },
  9. { "code" : 404,
  10. "reason" : "Not found",
  11. "probability" : 0.3
  12. },
  13. { "code" : 0,
  14. "reason" : "drop/no response timeout",
  15. "probability" : 0.1
  16. }
  17. ]
  18. }
  19. ],
  20. "client": [
  21. {
  22. "extra-headers": {
  23. "Foo": "Bar",
  24. "Bar": "Foo"
  25. }
  26. },
  27. {
  28. "users": [
  29. {
  30. "ruri": "sip:12063??????@192.168.10.10",
  31. "extra-headers": {
  32. "Bar": "Open"
  33. }
  34. },
  35. {
  36. "ruri": "sip:12063??????@192.168.10.10",
  37. "extra-headers": {
  38. "Bar": "Close"
  39. }
  40. },
  41. {
  42. "ruri": "sip:12063??????@192.168.10.10",
  43. "extra-headers": {
  44. "VIP": "True",
  45. "Bar": "Open"
  46. }
  47. }
  48. ]
  49. }
  50. ]
  51. }

Example : adding headers from a C header file

You can add custom headers in this file

  1. include/custom_headers.h

Additional notes

voip_perf was initially a fork from pjsip-apps/src/samples/pjsip-perf.c

http://www.pjsip.org/release/0.5.4/PJSIP-Dev-Guide.pdf