summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Oetiker <tobi@oetiker.ch>2012-02-06 23:17:32 +0100
committerTobias Oetiker <tobi@oetiker.ch>2012-02-06 23:17:32 +0100
commit589ea56efaa087811c2bf0cf37781843f9992c51 (patch)
treebb912336ad756b02999c1b29ad061ab8ecf8c76a
parent8c8ed47542783991ed4639783607334f2e52bb70 (diff)
downloadsmokeping-589ea56efaa087811c2bf0cf37781843f9992c51.tar.gz
smokeping-589ea56efaa087811c2bf0cf37781843f9992c51.tar.xz
make SipSak work with sip servers implementing OPTIONS
-rw-r--r--CHANGES2
-rw-r--r--lib/Smokeping/probes/SipSak.pm15
2 files changed, 14 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index ed31fe7..e8944a0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+* Make SipSak work with sip services actually implementing OPTIONS -- tobi
+
2012/01/11 -- released version 2.6.7
* be more careful in handling input from the web to prevent xss. Thanks to
diff --git a/lib/Smokeping/probes/SipSak.pm b/lib/Smokeping/probes/SipSak.pm
index 9e6c3a2..25f1649 100644
--- a/lib/Smokeping/probes/SipSak.pm
+++ b/lib/Smokeping/probes/SipSak.pm
@@ -73,14 +73,23 @@ sub pingone {
shift @reply;
my $filter = '.*';
+ $self->do_debug("SipSak: got ".(scalar @reply)." replies, expected $pingcount");
if (scalar @reply > $pingcount){
- $filter = $keep eq 'yes' ? 'final' : 'provisional';
+ $filter = $keep eq 'yes' ? 'final received' : 'provisional received';
}
for my $item (@reply){
- next unless $item =~ /$filter/;
- if (/^(?:\s+and|\sreceived\safter)\s(\d+(?:\.\d+))\sms\s/){
+ $self->do_debug("SipSak: looking at '$item'");
+ if (not $item =~ /$filter/){
+ $self->do_debug("SipSak: skipping as there was not match for $filter");
+ next;
+ }
+ if ($item =~ /(?:\sand|\sreceived\safter)\s(\d+(?:\.\d+)?)\sms\s/){
+ $self->do_debug("SipSak: match");
push @times,$1/1000;
}
+ else {
+ $self->do_debug("SipSak: no match");
+ }
}
return sort { $a <=> $b } @times;
}