On 08/12/2014 03:56 PM, AliReza Khoshgoftar Monfared wrote:
Hi List,

I am trying to keep a counter for number of messages received per source
ip in my kamailio script.

The basic challenge is to keep this data in a neat structure.
Ideally, I want some array with keys named after source IP addresses,

sth like number_of_messages["10.10.10.10"] = 23

Of course, this data structure shall be script-persistent (as opposed to
transaction persistent)

Is there any suggestion to do this? (keep a record of # of messages
received from each source IP address and log them)?

It sounds to me like you're looking for:

http://kamailio.org/docs/modules/4.1.x/modules/htable.html

The hash tables reside in shared memory, so the data is of global scope and script-persistent.

--
Alex Balashov - Principal
Evariste Systems LLC
Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/

Please be kind to the English language:

http://www.entrepreneur.com/article/232906

_______________________________________________
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

Reply via email to