<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello,<br>
<br>
On 2/11/10 5:42 PM, marius zbihlei wrote:
<blockquote cite="mid:4B743388.7040605@1and1.ro" type="cite">Daniel-Constantin
Mierla wrote:
  <br>
  <blockquote type="cite">Hello,
    <br>
    <br>
On 2/9/10 4:00 PM, marius zbihlei wrote:
    <br>
    <blockquote type="cite">Hello (replying on myself)
      <br>
      <br>
Sorry for the broken output
      <br>
      <br>
Feb&nbsp; 9 16:46:03 marius ../../ser[32584]: ERROR: *** cfgtrace:
c=[(null)] l=0 a=13 descr=seturi(<a class="moz-txt-link-rfc2396E" href="sip:49721123456785@127.0.0.1:10000">"sip:49721123456785@127.0.0.1:10000"</a>);
      <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Feb&nbsp; 9 16:46:03 marius ../../ser[32584]: ERROR:
*** cfgtrace: c=[30.cfg] l=33 a=17 descr=if (type&lt;22&gt;) {} else
{};
      <br>
Feb&nbsp; 9 16:46:03 marius ../../ser[32584]: ERROR: *** cfgtrace:
c=[30.cfg] l=30 a=25 descr=
external_module_call(f_ptr&lt;0xb7dfc13c&gt;, 0);
      <br>
      <br>
I will also check to see why the first line has no config file or line
info...
      <br>
    </blockquote>
    <br>
it is in my roadmap to make it more verbose, but if you can do it is
better :-) (so I can say was in my roadmap).
    <br>
    <br>
The name of the action is in the structure if it is a module function,
for the core functions and statements (if, while, ...) I was thinking
on having a mapping table (type, name).
    <br>
    <br>
Another idea was to open the cfg, read the respective line and print it
next. But would be quite i/o intesive...
    <br>
    <br>
When you have the patch ready, send it over. I will look over it and if
ok I will tell you to commit.
    <br>
    <br>
Thanks,
    <br>
Daniel
    <br>
    <br>
  </blockquote>
Hello Daniel,
  <br>
  <br>
I have attacked a patch that enables print_action like printing of&nbsp;
module functions, core function and statements . It is usefull&nbsp; if the
action line is no longer that 512 characters(it truncates at 512 ..
still to test)
  <br>
  <br>
The module export is printed like this (call to t_relay)
  <br>
cfgtrace: c=[/home/marius/dev/sip-router/test/unit/30.cfg] l=30 a=25
descr=external_module_call(t_relay)(f_ptr&lt;0xb7ee815c&gt;, 0);
  <br>
  <br>
I also liked the file read solution but strangely for some action the
file is NULL (*** cfgtrace: c=[(null)] l=0 a=13
descr=seturi(<a class="moz-txt-link-rfc2396E" href="sip:49721123456787@127.0.0.1:8000">"sip:49721123456787@127.0.0.1:8000"</a>);&nbsp; )
  <br>
</blockquote>
I have to check, should be some value there...<br>
<blockquote cite="mid:4B743388.7040605@1and1.ro" type="cite"><br>
BTW it is normal for a line like xlog(...) to appear as an action:
  <br>
cfgtrace: c=[/home/marius/dev/sip-router/test/unit/30.cfg] l=30 a=17
descr=if
(type&lt;22&gt;external_module_call(xlog)(f_ptr&lt;0xb8062898&gt;, 2,
type&lt;10&gt;); drop(1, 1); } else {};
  <br>
?
  <br>
  <br>
The patch is a little on the long side, and a bit intrusive to my
liking , it you have other suggestion please let me now.
  <br>
</blockquote>
<br>
indeed a bit long. I was thinking to have some static tables:<br>
<br>
struct action_info {<br>
int type;<br>
char *name;<br>
};<br>
<br>
struct action_info _sr_actions_list[] = {<br>
&nbsp; {FORWARD_T, "forward"},<br>
&nbsp; {IF_T, "if"},<br>
...<br>
&nbsp; {0, 0}<br>
};<br>
<br>
Maybe same for expressions, operators, etc. Would become easy
everywhere to get the action name (also easy to generate the list of
actions for documentation purposes). The core print functions will get
simplified a lot, since only few cases need special handling.<br>
<br>
What I do not like about printing to buffer now is alloc every time. I
was thinking to a less verbose version, just to print the action name,
but more details are probably better when debugging.<br>
<br>
Cheers,<br>
Daniel<br>
&nbsp;<br>
<blockquote cite="mid:4B743388.7040605@1and1.ro" type="cite"><br>
Cheers
  <br>
Marius
  <br>
  <br>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
sr-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
  </pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
SIP Server Professional Solutions
* <a class="moz-txt-link-freetext" href="http://www.asipto.com/">http://www.asipto.com/</a>
</pre>
</body>
</html>