[packages/sipp] hack to make sipp auto-answer OPTIONS messages

jajcus jajcus at pld-linux.org
Fri Jun 14 15:51:09 CEST 2013


commit 3807eea2d015e91b7b7ab5a65a317270c476e3f1
Author: Jacek Konieczny <j.konieczny at eggsoft.pl>
Date:   Fri Jun 14 15:50:20 2013 +0200

    hack to make sipp auto-answer OPTIONS messages
    
    Such OPTIONS are often used to check SIP peer reachability
    (e.g. Asterisk does that)

 sipp-OPTIONS_is_ping.patch | 24 ++++++++++++++++++++++++
 sipp.spec                  |  7 +++++++
 2 files changed, 31 insertions(+)
---
diff --git a/sipp.spec b/sipp.spec
index c8634c6..6e9f59f 100644
--- 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
 
diff --git a/sipp-OPTIONS_is_ping.patch b/sipp-OPTIONS_is_ping.patch
new file mode 100644
index 0000000..064113b
--- /dev/null
+++ b/sipp-OPTIONS_is_ping.patch
@@ -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
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/sipp.git/commitdiff/3807eea2d015e91b7b7ab5a65a317270c476e3f1



More information about the pld-cvs-commit mailing list