Hi,
From kamailio documentation, the usage of hashtable is given as :
modparam("htable", "htable", "a=>size=4;") ... $sht(a=>test) = 1; $sht(a=>$ci::srcip) = $si;
I get it that in the first statement, a is the hashtable, a new key-value pair is added to one of its empty bucket (test,1).
What is happening in the second statement?
It's not an operator, actually. :-) It's just a convention. You can call your keys anything you like (that's grammatically valid).
On 08/28/2014 09:37 AM, aft wrote:
Hi,
From kamailio documentation, the usage of hashtable is given as :
modparam("htable", "htable", "a=>size=4;") ... $sht(a=>test) = 1; $sht(a=>$ci::srcip) = $si;
I get it that in the first statement, a is the hashtable, a new key-value pair is added to one of its empty bucket (test,1).
What is happening in the second statement?
To give a better visual perspective, practically if you do:
$sht(a=>$ci::srcip) = $si;
for and INVITE request that comes from 1.2.3.4 and has the header:
Call-Id: abcd
Then in the the hash table a is added the pair ('abcd::srcip', '1.2.3.4').
So, the pseudo variables (the $xy... tokens are evaluated).
Cheers, Daniel
On 28/08/14 17:35, Alex Balashov wrote:
It's not an operator, actually. :-) It's just a convention. You can call your keys anything you like (that's grammatically valid).
On 08/28/2014 09:37 AM, aft wrote:
Hi,
From kamailio documentation, the usage of hashtable is given as :
modparam("htable", "htable", "a=>size=4;") ... $sht(a=>test) = 1; $sht(a=>$ci::srcip) = $si;
I get it that in the first statement, a is the hashtable, a new key-value pair is added to one of its empty bucket (test,1).
What is happening in the second statement?
Thanks for the reply, now i get it
On Thu, Aug 28, 2014 at 10:56 PM, Daniel-Constantin Mierla miconda@gmail.com wrote:
To give a better visual perspective, practically if you do:
$sht(a=>$ci::srcip) = $si;
for and INVITE request that comes from 1.2.3.4 and has the header:
Call-Id: abcd
Then in the the hash table a is added the pair ('abcd::srcip', '1.2.3.4').
So, the pseudo variables (the $xy... tokens are evaluated).
Cheers, Daniel
On 28/08/14 17:35, Alex Balashov wrote:
It's not an operator, actually. :-) It's just a convention. You can call your keys anything you like (that's grammatically valid).
On 08/28/2014 09:37 AM, aft wrote:
Hi,
From kamailio documentation, the usage of hashtable is given as :
modparam("htable", "htable", "a=>size=4;") ... $sht(a=>test) = 1; $sht(a=>$ci::srcip) = $si;
I get it that in the first statement, a is the hashtable, a new key-value pair is added to one of its empty bucket (test,1).
What is happening in the second statement?
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Next Kamailio Advanced Trainings 2014 - http://www.asipto.com Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
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