[OpenSIPS-Devel] Weirs param parsing - MI
Daniel Zanutti
daniel.zanutti at gmail.com
Sat Jul 9 22:26:27 CEST 2016
I'm trying to read 3 integers parameters from MI, but Opensips is for some
reason combining 2 values.
This is the command: opensipsctl fifo custom_check 10 2000 50000
For some reason, I'm getting these values on the nodes:
val1 = 10
val2 = 200050000
val3 = 50000
This is the summarized code:
struct mi_root * custom_check(struct mi_root *cmd_tree, void *param )
{
struct mi_node* node;
int val1, val2, val3;
node = cmd_tree->node.kids;
if (!node->value.s || !node->value.len)
return init_mi_tree( 400, MI_SSTR(MI_BAD_PARM));
val1 = atoi(node->value.s);
node = node->next;
if ( !node->value.s || !node->value.len)
return init_mi_tree( 400, MI_SSTR(MI_BAD_PARM));
val2 = atoi(node->value.s);
node = node->next;
if ( !node->value.s || !node->value.len)
return init_mi_tree( 400, MI_SSTR(MI_BAD_PARM));
val3 = atoi(node->value.s);
.....
}
Am I doing something wrong?
Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20160709/e1d799fc/attachment.htm>
More information about the Devel
mailing list