Did you try to add logs to make sure sip_trace() is not called twice?<div><br></div><div>Regards,</div><div>Ali Pey<br><br><div class="gmail_quote">On Wed, Oct 10, 2012 at 10:29 AM, Dragomir Haralambiev <span dir="ltr">&lt;<a href="mailto:goup2010@gmail.com" target="_blank">goup2010@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi,</div><div> </div><div>Thanks for your replay.</div><div>The problem is not in IF operator. </div><div> </div><div>
When use sip_trace() Opnesips make two records in sip_trace.</div><div><br>Best regards,</div><div>
PlayMen<br></div><div class="gmail_quote">2012/10/10 <div><div class="h5"><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">
<div>
<div style="font-family:times new roman,new york,times,serif;font-size:10pt"><div>Hi,</div><span style="font-family:times new roman,new york,times,serif"><span style="font-family:arial,helvetica,sans-serif"><span></span></span></span><div style="font-family:times new roman,new york,times,serif;font-size:10pt">

<div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div><div><div style="font-family:times new roman,new york,times,serif;font-size:10pt"><div><div style="font-size:13.33px;font-style:normal;background-color:transparent">

<span style="font-family:times new roman,new york,times,serif"><span style="font-family:arial,helvetica,sans-serif"><span>Do it like this:</span><br></span></span></div><div style="font-size:13.33px;font-style:normal;background-color:transparent">

<span style="font-family:times new roman,new york,times,serif"><span style="font-family:arial,helvetica,sans-serif">if
 (is_avp_set(&quot;$avp(trace_id)&quot;){</span></span></div><div style="font-size:13.33px;font-style:normal;background-color:transparent"><span style="font-family:times new roman,new york,times,serif"><span style="font-family:arial,helvetica,sans-serif"># Do tracing<br>

</span></span></div><div style="font-size:13.33px;font-style:normal;background-color:transparent"><span style="font-family:times new roman,new york,times,serif"><span style="font-family:arial,helvetica,sans-serif">}</span></span></div>

</div><div style="font-size:13.33px;font-style:normal;background-color:transparent"><span style="font-family:times new roman,new york,times,serif"><span style="font-family:arial,helvetica,sans-serif"><div>or like this :<br>

If (!avp_check(&quot;$avp(trace_id)&quot;,&quot;re/^$/&quot;)){<br><br># Do tracing<br>}<br></div>where &quot;/^$/&quot; regex pattern for empty string.<br><br>// Binan<br></span></span><br>  </div><div style="font-family:times new roman,new york,times,serif;font-size:10pt">

 <div style="font-family:times new roman,new york,times,serif;font-size:12pt"> <div dir="ltr"> <font face="Arial"><div> <hr size="1">  <b><span style="font-weight:bold">Från:</span></b> Dragomir Haralambiev &lt;<a href="mailto:goup2010@gmail.com" target="_blank">goup2010@gmail.com</a>&gt;<br>

 <b><span style="font-weight:bold">Till:</span></b> OpenSIPS users mailling list &lt;<a href="mailto:users@lists.opensips.org" target="_blank">users@lists.opensips.org</a>&gt; <br> <b><span style="font-weight:bold">Skickat:</span></b> tisdag, 9 oktober 2012 22:55<br>

 </div><b><span style="font-weight:bold">Ämne:</span></b> [OpenSIPS-Users] duplicate information in sip_trace table<br> </font> </div><div><div> <br>
<div><div>Hello ,</div><div> </div><div>I see duplicate information in sip_trace table (Opensips: 1.8.1): <br>one line with traced_user=empty;<br>other traced_user=$avp(trace_id).</div><div> </div><div>How to setup Opensips to remove traced_user=empty ?</div>


<div>Here is part of opensips.cfg:</div><div> </div><div>modparam(&quot;siptrace&quot;, &quot;db_url&quot;, &quot;mysql://user:password@localhost/opensips&quot;)<br>modparam(&quot;siptrace&quot;, &quot;trace_on&quot;, 1) <br>


modparam(&quot;siptrace&quot;, &quot;enable_ack_trace&quot;, 1) <br>modparam(&quot;siptrace&quot;, &quot;traced_user_avp&quot;, &quot;$avp(trace_id)&quot;)</div><div>......<br>if (is_method(&quot;INVITE&quot;)) {<br>..... receive $avp(trace_id) from radius_send_auth .......</div>


<div>   if ( $avp(trace_id) ) {<br>        xlog(&quot;L_ERR&quot;, &quot;Trace ON. Trace_id=$avp(trace_id)\n&quot;);<br>        sip_trace();<br>    }</div><div>.....<br>}</div><div> </div><div>Best regards,</div><div>PlayMen</div>


<div> </div>
</div><br></div></div><div>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.opensips.org" rel="nofollow" target="_blank">Users@lists.opensips.org</a><br><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>

<br><br> </div></div> </div>  </div></div></div><br><br> </div> </div>  </div></div><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div></div></div><br>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>