aft
2014-09-03 07:39:10 UTC
I'm trying to configure HOMER sip capture server to do some accounting
of the cases when "503 Service Unavailable" message arrives from
capture agents.
I've implemented the following to record the source IPs from which 503
message originates.
onreply_route {
......................
......................
......................
else if(status == "503") {
if($sht(a=>alarm::503) == $null) {
$sht(a=>alarm::503) = 0;
$sht(a=>alarm::$si::503) = 0;
}
xlog("Got 503");
xlog("($sht(a=>alarm::$si::503))");
$sht(a=>alarm::$si::503) = $sht(a=>alarm::$si::503) + 1;
}
...................
...................
...................
The following route supposed run periodically to update the databases.
}
route[TIMER_STATS] {
.....................
.....................
xlog("($sht(a=>alarm::$si::503))");
if($sht(a=>alarm::$si::503) > 0) {
sql_query("cb", "INSERT INTO alarm_data (create_date, type,
total, description, source_ip) VALUES(NOW(), 'Too Many 503',
$sht(a=>alarm::$si::503), 'service unavailable', $si)");
xlog("adding stuff to db");
}
$sht(a=>alarm::503) = 0;
$sht(a=>alarm::$si::503) = 0;
}
But the xlog("adding stuff to db") never executed. But in the first
block of code, the log message to print the value
$sht(a=>alarm::$si::503), which is shown to be non zero.
Don't understand why its not working.
of the cases when "503 Service Unavailable" message arrives from
capture agents.
I've implemented the following to record the source IPs from which 503
message originates.
onreply_route {
......................
......................
......................
else if(status == "503") {
if($sht(a=>alarm::503) == $null) {
$sht(a=>alarm::503) = 0;
$sht(a=>alarm::$si::503) = 0;
}
xlog("Got 503");
xlog("($sht(a=>alarm::$si::503))");
$sht(a=>alarm::$si::503) = $sht(a=>alarm::$si::503) + 1;
}
...................
...................
...................
The following route supposed run periodically to update the databases.
}
route[TIMER_STATS] {
.....................
.....................
xlog("($sht(a=>alarm::$si::503))");
if($sht(a=>alarm::$si::503) > 0) {
sql_query("cb", "INSERT INTO alarm_data (create_date, type,
total, description, source_ip) VALUES(NOW(), 'Too Many 503',
$sht(a=>alarm::$si::503), 'service unavailable', $si)");
xlog("adding stuff to db");
}
$sht(a=>alarm::503) = 0;
$sht(a=>alarm::$si::503) = 0;
}
But the xlog("adding stuff to db") never executed. But in the first
block of code, the log message to print the value
$sht(a=>alarm::$si::503), which is shown to be non zero.
Don't understand why its not working.
--
-Cheers
-Arif
-Cheers
-Arif