From 589ea56efaa087811c2bf0cf37781843f9992c51 Mon Sep 17 00:00:00 2001 From: Tobias Oetiker Date: Mon, 6 Feb 2012 23:17:32 +0100 Subject: make SipSak work with sip servers implementing OPTIONS --- lib/Smokeping/probes/SipSak.pm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lib') 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; } -- cgit v1.2.3-24-g4f1b