Re: [SR-Users] Kamailio invite counter

2015-06-19 Thread Alex Balashov
@lists.sip-router.org] On Behalf Of Alex BalashovSent: Friday, June 19, 2015 5:16 PMTo: Ali TaherSubject: Re: [SR-Users] Kamailio invite counter Ali, $var variables do not persist outside the scope of the processing of a single SIP message. They live in the private memory of every receiver process. Take a l

Re: [SR-Users] Kamailio invite counter

2015-06-19 Thread Ali Taher
, Ali From: sr-users [mailto:sr-users-boun...@lists.sip-router.org] On Behalf Of Alex Balashov Sent: Friday, June 19, 2015 5:16 PM To: Ali Taher Subject: Re: [SR-Users] Kamailio invite counter Ali, $var variables do not persist outside the scope of the processing of a single SIP message

Re: [SR-Users] Kamailio invite counter

2015-06-19 Thread Ali Taher
: Ali Taher Subject: Re: [SR-Users] Kamailio invite counter Ali, $var variables do not persist outside the scope of the processing of a single SIP message. They live in the private memory of every receiver process. Take a look at the 'htable' or 'statistics'

Re: [SR-Users] Kamailio invite counter

2015-06-19 Thread Alex Balashov
Ali,$var variables do not persist outside the scope of the processing of a single SIP message. They live in the private memory of every receiver process.Take a look at the 'htable' or 'statistics' modules.

Re: [SR-Users] Kamailio invite counter

2015-06-19 Thread Ali Taher
Thanks Dirk it worked as I want! -Original Message- From: sr-users [mailto:sr-users-boun...@lists.sip-router.org] On Behalf Of Dirk Teurlings - SIGNET B.V. Sent: Friday, June 19, 2015 5:03 PM To: sr-users@lists.sip-router.org Subject: Re: [SR-Users] Kamailio invite counter Hi, $var is

Re: [SR-Users] Kamailio invite counter

2015-06-19 Thread Fred Posner
On 06/19/2015 09:54 AM, Ali Taher wrote: > Hello, > > I want to define a counter that increase in every invite. > > I tried the below : > > if (is_method("INVITE")) > > { > > $var(u)=$var(u)+1; > > xlog("L_INFO","Counter : $var(u) " ); > > } > > > But the counter is

Re: [SR-Users] Kamailio invite counter

2015-06-19 Thread Dirk Teurlings - SIGNET B.V.
Hi, $var is in a scope per thread, so you will have a different counter in every thread. You should use shared memory instead: http://www.kamailio.org/wiki/cookbooks/4.2.x/pseudovariables#shv_name_-_shared_memory_variables Cheers, Dirk On 19-06-15 15:54, Ali Taher wrote: Hello, I want t

[SR-Users] Kamailio invite counter

2015-06-19 Thread Ali Taher
Hello, I want to define a counter that increase in every invite. I tried the below : if (is_method("INVITE")) { $var(u)=$var(u)+1; xlog("L_INFO","Counter : $var(u) " ); } But the counter is reset to 1 randomly (even before restarting kamailio service) How