]> git.pld-linux.org Git - packages/sipp.git/commitdiff
hack to make sipp auto-answer OPTIONS messages
authorJacek Konieczny <j.konieczny@eggsoft.pl>
Fri, 14 Jun 2013 13:50:20 +0000 (15:50 +0200)
committerJacek Konieczny <jajcus@jajcus.net>
Fri, 14 Jun 2013 13:50:20 +0000 (15:50 +0200)
Such OPTIONS are often used to check SIP peer reachability
(e.g. Asterisk does that)

sipp-OPTIONS_is_ping.patch [new file with mode: 0644]
sipp.spec

diff --git a/sipp-OPTIONS_is_ping.patch b/sipp-OPTIONS_is_ping.patch
new file mode 100644 (file)
index 0000000..064113b
--- /dev/null
@@ -0,0 +1,24 @@
+diff -dur -x '*~' sipp-3.3.orig/call.cpp sipp-3.3/call.cpp
+--- sipp-3.3.orig/call.cpp     2013-06-14 15:24:31.000000000 +0200
++++ sipp-3.3/call.cpp  2013-06-14 15:37:04.000000000 +0200
+@@ -3963,7 +3963,7 @@
+     return E_AM_UNEXP_BYE;
+   } else if (strcmp(P_recv, "CANCEL") == 0) {
+     return E_AM_UNEXP_CANCEL;
+-  } else if (strcmp(P_recv, "PING") == 0) {
++  } else if (strcmp(P_recv, "PING") == 0 || strcmp(P_recv, "OPTIONS") == 0) {
+     return E_AM_PING;
+   } else if (((strcmp(P_recv, "INFO") == 0) || (strcmp(P_recv, "NOTIFY") == 0) || (strcmp(P_recv, "UPDATE") == 0)) 
+                && (auto_answer == true)){
+Only in sipp-3.3.orig: call.cpp.orig
+diff -dur -x '*~' sipp-3.3.orig/sipp.cpp sipp-3.3/sipp.cpp
+--- sipp-3.3.orig/sipp.cpp     2013-02-07 00:11:47.000000000 +0100
++++ sipp-3.3/sipp.cpp  2013-06-14 15:38:04.000000000 +0200
+@@ -3410,6 +3410,7 @@
+     } else if (auto_answer &&
+               ((strstr(msg, "NOTIFY") == msg)  ||
+                (strstr(msg, "INFO")   == msg)  ||
++               (strstr(msg, "OPTIONS")== msg)  ||
+                (strstr(msg, "UPDATE") == msg))) {
+         // If auto answer mode, try to answer the incoming message
+         // with automaticResponseMode
index c8634c6000c419d350d5f27712086fa65190aff3..6e9f59f3fa5c3d377a97828793579743c70933cc 100644 (file)
--- a/sipp.spec
+++ b/sipp.spec
@@ -1,3 +1,8 @@
+
+%bcond_with    options_is_ping # make sipp treat OPTIONS same as PING
+                               # changes sipp behaviour, but that is
+                               # what everybody use for 'pinging'
+
 Summary:       SIPp - a performance testing tool for the SIP protocol
 Name:          sipp
 Version:       3.3
@@ -9,6 +14,7 @@ Source0:       http://dl.sourceforge.net/sipp/%{name}-%{version}.tar.xz
 Patch0:                %{name}-headers.patch
 Patch1:                %{name}-sprintf.patch
 Patch2:                %{name}-stats_crash.patch
+Patch3:                %{name}-OPTIONS_is_ping.patch
 URL:           http://sipp.sourceforge.net/
 BuildRequires: libpcap-devel
 BuildRequires: libstdc++-devel
@@ -37,6 +43,7 @@ system.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%{?with_options_is_ping:%patch3 -p1}
 
 %build
 
This page took 0.067014 seconds and 4 git commands to generate.