Discussion:
[SR-Users] kamcmd htable access problem, probably with int->string conversion
Moritz Graf
2014-07-21 11:26:35 UTC
Permalink
Hi There,

i implemented a mapping via htable. For debugging purpose I use kamcmd
to see if the values are correctly filled. Doing so I discovered that
there is a problem getting the values of the keys, where the name is a
integer value. So it's the following behaviour:
#####################################################################
***@kamailio-stage:~# kamcmd htable.dump maptodest
{
entry: 55
size: 1
slot: {
item: {
name: 1
value: 0000000000000000001
}
}
}
{
entry: 504
size: 1
slot: {
item: {
name: blub
value: 0000000000000000001
}
}
}
{
entry: 686
size: 1
slot: {
item: {
name: 001
value: 0000000000000000001
}
}
}

***@kamailio-stage:~# kamcmd htable.get maptodest blub
{
item: {
name: blub
value: 0000000000000000001
}
}
***@kamailio-stage:~# kamcmd htable.get maptodest 001
error: 500 - Not enough parameters (htable name and key name)
#####################################################################

Is there a reasonable explanation why it works with blub, but not with 001?
Why is he complaining about the number of parameters?
Does anyone know a workarround?


Thanks for any advise!!


greeetz Moritz
--
Moritz Graf, M.Sc.
Betrieb NGN-Plattform

G-FIT GmbH & Co. KG
Greflingerstr. 26, 93055 Regensburg
Daniel-Constantin Mierla
2014-07-21 11:29:48 UTC
Permalink
Hello,

try to prefix the value with s: in command line.

It is kamcmd code that tries to detect if it is a number or not, the
pass it further to kamailio as integer or string. Using s: is
overwriting kamcmd auto-detect.

Cheers,
Daniel
Post by Moritz Graf
Hi There,
i implemented a mapping via htable. For debugging purpose I use kamcmd
to see if the values are correctly filled. Doing so I discovered that
there is a problem getting the values of the keys, where the name is a
#####################################################################
{
entry: 55
size: 1
slot: {
item: {
name: 1
value: 0000000000000000001
}
}
}
{
entry: 504
size: 1
slot: {
item: {
name: blub
value: 0000000000000000001
}
}
}
{
entry: 686
size: 1
slot: {
item: {
name: 001
value: 0000000000000000001
}
}
}
{
item: {
name: blub
value: 0000000000000000001
}
}
error: 500 - Not enough parameters (htable name and key name)
#####################################################################
Is there a reasonable explanation why it works with blub, but not with 001?
Why is he complaining about the number of parameters?
Does anyone know a workarround?
Thanks for any advise!!
greeetz Moritz
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
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/miconda
Moritz Graf
2014-07-21 12:30:23 UTC
Permalink
Hi Daniel,

check! ;) Thx a lot, working good!

***@kamailio-stage:~# kamcmd htable.get maptodest_ip s:1
{
item: {
name: 1
value: 0000000000000000001
}
}


Solved!

greetz Moritz
Post by Daniel-Constantin Mierla
Hello,
try to prefix the value with s: in command line.
It is kamcmd code that tries to detect if it is a number or not, the
pass it further to kamailio as integer or string. Using s: is
overwriting kamcmd auto-detect.
Cheers,
Daniel
Post by Moritz Graf
Hi There,
i implemented a mapping via htable. For debugging purpose I use kamcmd
to see if the values are correctly filled. Doing so I discovered that
there is a problem getting the values of the keys, where the name is a
#####################################################################
{
entry: 55
size: 1
slot: {
item: {
name: 1
value: 0000000000000000001
}
}
}
{
entry: 504
size: 1
slot: {
item: {
name: blub
value: 0000000000000000001
}
}
}
{
entry: 686
size: 1
slot: {
item: {
name: 001
value: 0000000000000000001
}
}
}
{
item: {
name: blub
value: 0000000000000000001
}
}
error: 500 - Not enough parameters (htable name and key name)
#####################################################################
Is there a reasonable explanation why it works with blub, but not with 001?
Why is he complaining about the number of parameters?
Does anyone know a workarround?
Thanks for any advise!!
greeetz Moritz
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
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/miconda
--
Moritz Graf, M.Sc.
Betrieb NGN-Plattform

G-FIT GmbH & Co. KG
Greflingerstr. 26, 93055 Regensburg

Telefon +49 (9 41) 46299 - 1 86
Telefax +49 (9 41) 46299 - 2 86
mailto:moritz.graf-***@public.gmane.org
http://www.g-fit.de

G-FIT Gesellschaft für innovative Telekommunikationsdienste mbH & Co.
KG, Kommanditgesellschaft, Sitz Regensburg, Registergericht Regensburg,
HRA 7626; Geschäftsführer: Dipl.Inf. (FH) Alfred Rauscher
Daniel-Constantin Mierla
2014-07-21 12:53:50 UTC
Permalink
Post by Moritz Graf
Hi Daniel,
check! ;) Thx a lot, working good!
Welcome,
Daniel
Post by Moritz Graf
{
item: {
name: 1
value: 0000000000000000001
}
}
Solved!
greetz Moritz
Post by Daniel-Constantin Mierla
Hello,
try to prefix the value with s: in command line.
It is kamcmd code that tries to detect if it is a number or not, the
pass it further to kamailio as integer or string. Using s: is
overwriting kamcmd auto-detect.
Cheers,
Daniel
Post by Moritz Graf
Hi There,
i implemented a mapping via htable. For debugging purpose I use kamcmd
to see if the values are correctly filled. Doing so I discovered that
there is a problem getting the values of the keys, where the name is a
#####################################################################
{
entry: 55
size: 1
slot: {
item: {
name: 1
value: 0000000000000000001
}
}
}
{
entry: 504
size: 1
slot: {
item: {
name: blub
value: 0000000000000000001
}
}
}
{
entry: 686
size: 1
slot: {
item: {
name: 001
value: 0000000000000000001
}
}
}
{
item: {
name: blub
value: 0000000000000000001
}
}
error: 500 - Not enough parameters (htable name and key name)
#####################################################################
Is there a reasonable explanation why it works with blub, but not with 001?
Why is he complaining about the number of parameters?
Does anyone know a workarround?
Thanks for any advise!!
greeetz Moritz
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
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/miconda
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Loading...