<div>The sip_trace called only one, but opensips make two records.</div><div> </div><div>Here is log:</div><div> </div><div>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: Trace ON. Trace_id=8<br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:core:parse_headers: flags=40<br>
Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: <strong>DBG:siptrace:sip_trace: sip_trace called</strong> <br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:siptrace:save_siptrace: saving siptrace<br>
Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:siptrace:insert_siptrace_flag: storing info 1...<br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:has_stmt_ctx: ctx found for sip_trace<br>
Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_do_prepared_query: conn=0x7f277f5fc4b8 (tail=139807617425128) MC=0x7f277f5f9f48<br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_do_prepared_query: set values for the statement run<br>
Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (0): len=905; type=252; is_null=0<br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (1): len=44; type=254; is_null=0<br>
Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (2): len=6; type=254; is_null=0<br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (3): len=0; type=254; is_null=0<br>
Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (4): len=23; type=254; is_null=0<br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (5): len=23; type=254; is_null=0<br>
Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (6): len=40; type=12; is_null=0<br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (7): len=2; type=254; is_null=0<br>
Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (8): len=8; type=254; is_null=0<br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (9): len=0; type=254; is_null=0<br>
Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_do_prepared_query: doing BIND_PARAM in...<br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:siptrace:insert_siptrace_avp: int val [8]<br>
Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:siptrace:insert_siptrace_avp: storing info 14...<br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:has_stmt_ctx: ctx found for sip_trace<br>
Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_do_prepared_query: conn=0x7f277f5fc4b8 (tail=139807617425128) MC=0x7f277f5f9f48<br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_do_prepared_query: set values for the statement run<br>
Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (0): len=905; type=252; is_null=0<br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (1): len=44; type=254; is_null=0<br>
Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (2): len=6; type=254; is_null=0<br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (3): len=0; type=254; is_null=0<br>
Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (4): len=23; type=254; is_null=0<br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (5): len=23; type=254; is_null=0<br>
Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (6): len=40; type=12; is_null=0<br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (7): len=2; type=254; is_null=0<br>
Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (8): len=8; type=254; is_null=0<br>Oct 12 00:34:47 routecall /usr/local/sbin/opensips[2191]: DBG:db_mysql:db_mysql_val2bind: added val (9): len=1; type=254; is_null=0<br>
<br></div><div class="gmail_quote">2012/10/11 Ali Pey <span dir="ltr">&lt;<a href="mailto:alipey@gmail.com" target="_blank">alipey@gmail.com</a>&gt;</span><br><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">
Did you try to add logs to make sure sip_trace() is not called twice?<div><br></div><div>Regards,</div><div>Ali Pey<div><div class="h5"><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 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>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><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" 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><br></div></div></div>
<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>