[SR-Users] Simulating kamailio config flows

Victor Seva linuxmaniac at torreviejawireless.org
Thu May 23 17:29:48 CEST 2013


2013/5/23 Daniel-Constantin Mierla <miconda at gmail.com>:
> Look for ASSIGN_T in core, one place to go to and check is lval_assign(...)
> function, not sure there are other in core.

Ok. First attempt to get this done.

I've created a new core cfg parameter "log_assign_actions" to
activate/deactivate de log. No problem there.

I've created to new functions on lvalue.c in order to log the assign
action on lval_assign()

questions:
- How can I get the name of the pvar if I only have pv_spec_t struct?
- Why is always called log_assign_action_pvar() with this kamailio.cfg example?

        xdbg("test assign_action: $$var(temp) = $$fu;\n");
        $var(temp) = $fu;
        xdbg("test assign_action: $$var(temp) = $$null;\n");
        $var(temp) = $null;
        xdbg("test assign_action: $$var(temp) = 2;\n");
        $var(temp) = 2;
        xdbg("test assign_action: $$avp(s:temp_avp) = $$si;\n");
        $avp(s:temp_avp) = $si;
        xdbg("test assign_action: $$avp(s:temp_avp) = \"hi\";\n");
        $avp(s:temp_avp) = "hi";
        xdbg("test assign_action: $$avp(s:temp_avp) = 3;\n");
        $avp(s:temp_avp) = 3;


 4(26395) DEBUG: <script>: test assign_action: $var(temp) = $fu;
 4(26395) DEBUG: <core> [parser/parse_addr_spec.c:885]:
parse_addr_spec(): end of header reached, state=10
 4(26395) DEBUG: <core> [lvalue.c:397]: log_assign_action_pvar(): value.flags: 4
 4(26395) DEBUG: <core> [lvalue.c:401]: log_assign_action_pvar():
$var(unknown): sip:janakj at dhcp246.fokus.gmd.de
 4(26395) DEBUG: <script>: test assign_action: $var(temp) = $null;
 4(26395) DEBUG: <core> [lvalue.c:397]: log_assign_action_pvar():
value.flags: 28
 4(26395) DEBUG: <core> [lvalue.c:401]: log_assign_action_pvar():
$var(unknown): 0
 4(26395) DEBUG: <script>: test assign_action: $var(temp) = 2;
 4(26395) DEBUG: <core> [lvalue.c:397]: log_assign_action_pvar():
value.flags: 28
 4(26395) DEBUG: <core> [lvalue.c:401]: log_assign_action_pvar():
$var(unknown): 2
 4(26395) DEBUG: <script>: test assign_action: $avp(s:temp_avp) = $si;
 4(26395) DEBUG: <core> [lvalue.c:397]: log_assign_action_pvar(): value.flags: 4
 4(26395) DEBUG: <core> [lvalue.c:401]: log_assign_action_pvar():
$var(unknown): 127.0.0.1
 4(26395) DEBUG: <script>: test assign_action: $avp(s:temp_avp) = "hi";
 4(26395) DEBUG: <core> [lvalue.c:397]: log_assign_action_pvar(): value.flags: 4
 4(26395) DEBUG: <core> [lvalue.c:401]: log_assign_action_pvar():
$var(unknown): hi
 4(26395) DEBUG: <script>: test assign_action: $avp(s:temp_avp) = 3;
 4(26395) DEBUG: <core> [lvalue.c:397]: log_assign_action_pvar():
value.flags: 28
 4(26395) DEBUG: <core> [lvalue.c:401]: log_assign_action_pvar():
$var(unknown): 3

Thanks in advance,
Victor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: temp.patch
Type: application/octet-stream
Size: 3602 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130523/2795e4e7/attachment-0001.obj>


More information about the sr-users mailing list