THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - VĂctor Seva (linuxmaniac)
Attached to Project - sip-router Summary - usrloc: Add missing RPC commands Task Type - Improvement Category - usrloc (k) Status - Unconfirmed Assigned To - Operating System - All Severity - Low Priority - Normal Reported Version - Development Due in Version - Undecided Due Date - Undecided Details - Added commands: - ul.rm - ul.rm_contact - ul.flush - ul.add
One or more files have been attached.
More information can be found at the following URL: http://sip-router.org/tracker/index.php?do=details&task_id=290
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
Details - Added commands:
- ul.rm
- ul.rm_contact
- ul.flush
- ul.add
i patched my local master and tested ul.add. i'm using xmlrpc to make the call and give params expires and q as int and double:
<param> <value> <int>0</int> </value> </param> <param> <value> <double>0.1</double> </value> </param>
i get to syslog:
Apr 30 20:14:52 siika /usr/sbin/sip-proxy[15009]: DBG: usrloc [ul_rpc.c:557]: ret: -1 expires:0 q:0.000000
and i get back response 500 with error message:
<value><string>2:Not enough parameters or wrong format</string></value>
produced by:
ret = rpc->scan(ctx, "dd", &ci.expires, &ci.q); LM_INFO("ret: %d expires:%d q:%f\n", ret, (int) ci.expires, (double) ci.q); if ( ret != 2) { rpc->fault(ctx, 500, "2:Not enough parameters or wrong format"); return; }
what is wrong with those two params? why is 0.1 convered to 0.00000? should "dd" be changed to "df"?
-- juha
2013/4/30 Juha Heinanen jh@tutpro.com:
what is wrong with those two params? why is 0.1 convered to 0.00000? should "dd" be changed to "df"?
You are right. It should be "df".
Victor Seva writes:
what is wrong with those two params? why is 0.1 convered to 0.00000? should "dd" be changed to "df"?
You are right. It should be "df".
i tried that and the error disappeared, but value of q (0.1) does not look good:
Apr 30 20:45:43 siika /usr/sbin/sip-proxy[15562]: DBG: usrloc [ul_rpc.c:557]: ret: 2 expires:0 q:-1717986918.000000
next i got error:
3:Not enough parameters or wrong format
most likely because i gave unused param as int rather than string. the types of the params should be documented in README.
-- juha
2013/4/30 Juha Heinanen jh@tutpro.com:
i tried that and the error disappeared, but value of q (0.1) does not look good:
Apr 30 20:45:43 siika /usr/sbin/sip-proxy[15562]: DBG: usrloc [ul_rpc.c:557]: ret: 2 expires:0 q:-1717986918.000000
next i got error:
3:Not enough parameters or wrong format
most likely because i gave unused param as int rather than string. the types of the params should be documented in README.
can you test this, please:
diff --git a/modules/usrloc/ul_rpc.c b/modules/usrloc/ul_rpc.c index d9535cb..5675081 100644 --- a/modules/usrloc/ul_rpc.c +++ b/modules/usrloc/ul_rpc.c @@ -559,7 +559,7 @@ static void ul_rpc_add(rpc_t* rpc, void* ctx) rpc->fault(ctx, 500, "2:Not enough parameters or wrong format"); return; } - ret = rpc->scan(ctx, "Sddd", &useless, &ci.flags, &ci.cflags, &ci.methods); + ret = rpc->scan(ctx, ".Sddd", &useless, &ci.flags, &ci.cflags, &ci.methods); LM_DBG("ret: %d useless:%.*s flags:%d bflags:%d methods:%d\n", ret, useless.len, useless.s, ci.flags, ci.cflags, (int)ci.methods); if ( ret != 4) { rpc->fault(ctx, 500, "3:Not enough parameters or wrong format");
Victor Seva writes:
can you test this, please:
diff --git a/modules/usrloc/ul_rpc.c b/modules/usrloc/ul_rpc.c index d9535cb..5675081 100644 --- a/modules/usrloc/ul_rpc.c +++ b/modules/usrloc/ul_rpc.c @@ -559,7 +559,7 @@ static void ul_rpc_add(rpc_t* rpc, void* ctx) rpc->fault(ctx, 500, "2:Not enough parameters or wrong format"); return; }
ret = rpc->scan(ctx, "Sddd", &useless, &ci.flags, &ci.cflags,
&ci.methods);
ret = rpc->scan(ctx, ".Sddd", &useless, &ci.flags, &ci.cflags,
&ci.methods); LM_DBG("ret: %d useless:%.*s flags:%d bflags:%d methods:%d\n", ret, useless.len, useless.s, ci.flags, ci.cflags, (int)ci.methods); if ( ret != 4) { rpc->fault(ctx, 500, "3:Not enough parameters or wrong format");
i tried that change and still get error 3. as i wrote in previous message, the original Sddd is fine with me as long as it is documented in readme that unused param is of type string.
-- juha
Juha Heinanen writes:
i tried that and the error disappeared, but value of q (0.1) does not look good:
Apr 30 20:45:43 siika /usr/sbin/sip-proxy[15562]: DBG: usrloc [ul_rpc.c:557]: ret: 2 expires:0 q:-1717986918.000000
after changing unused param to "", ul.add succeeded and i was able to verify that q (0.1) value is wrong (-1717986.88) also in location table.
-- juha