On 04/09/14 09:19, aft wrote:
On Wed, Sep 3, 2014 at 11:36 PM, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
The $si is the source ip of the sip packet. Bu in a rtimer route there is no packet received from the network.
So your config is not going to work for what you want to do.
You can try to use mqueue to push sql queries from sip worker to rtimer as you need to write something to database.
Should i push $si using mq_add() and fetch it using mq_fetch()?
It should work with pushing $si as well.
I was thinking to do the check in onreply route and push the entire sql query, so the rtimer route just execute it.
Cheers, Daniel
Cheers, Daniel
On Wednesday, September 3, 2014, aft aftnix@gmail.com wrote:
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.
-Cheers -Arif
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla - http://www.asipto.com http://twitter.com/#!/miconda - http://www.linkedin.com/in/micond
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users