Hi,<br><br>I finally resolved this issue. The problem is in the callcontrol module.<br><br>The original code:<br><br>static int<br>
postprocess_request(struct sip_msg *msg, unsigned int flags, void *_param)<br>
{<br>
    CallInfo *call;<br>
<br>
    if ((msg-&gt;msg_flags &amp; FL_USE_CALL_CONTROL) == 0)<br>
        return 1;<br>
<br>
    // the FL_USE_CALL_CONTROL flag is still set =&gt; the dialog was not created<br>
<br>
    LOG(L_WARN, &quot;dialog to trace controlled call was not created. discarding callcontrol.&quot;);<br>
<br>
    call = get_call_info(msg, CAStop);<br>
    if (!call) {<br>
        LOG(L_ERR, &quot;can&#39;t retrieve call info\n&quot;);<br>
        return -1;<br>
    }<br>
    call_control_stop(msg, call-&gt;callid);<br>
<br>
    return 1;<br>
}<br>
<br>
When I was debugging the whole thing, I found out, that this postprocess routine of the callcontrol module is called EVERYTIME the processing of the main route block of kamailio is being ended.<br>Why? I do not understand, this must be considered as a bug. <br>
<br>When those 3 INVITEs come, the first is processed, but it still has FL_USE_CALL_CONTROL flag. Another 2 INVITEs are absorbed by kamailio. As I said, the postprocess_request block is executed each time the main route block ends. So, it will enter this function, check the FL_USE_CALL_CONTROL flag. And here comes a strange thing, why the flag FL_USE_CALL_CONTROL is shared accross the same INVITEs? I thought every instance of the module which processes every message should have independent variables. But it seems that this flag is shared, that&#39;s why it executes call_control_stop and sends to the callcontrol socket the command of discarding the callcontrol feature (the call is not charged)<br>
<br>I patched the module by adding extra parameter  - actually name of the AVP variable. This variable is set in the main route block when the first INVITE is processed and the call is initiated. Then it is checked in the routing - if the call has initiated bit set, do not discard the callcontrol. If someone is experiencing the similar problem, I can send the patch.<br>
<br>Second simpler approach is to removing  this line<br><br>    call_control_stop(msg, call-&gt;callid);<br><br>The question is, will the dialog expire in the callcontrol daemon? Is there any timeout? If so, it can be clearly fixed by this way ;)<br>
<br>Hope this helps to somebody,<br>Cheers<br><br><br><br><br><br><br><div class="gmail_quote">On Mon, Aug 15, 2011 at 9:59 AM, Mino Haluz <span dir="ltr">&lt;<a href="mailto:mino.haluz@gmail.com">mino.haluz@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;">Any updates on this? I updated callcontrol which has some bug fixed:<br>
<br>
callcontrol (2.0.14) unstable; urgency=low<br>
<br>
  * Avoid handling requests with a duplicated CallID<br>
<br>
But it still does not work. The callcontrol is executed 3 times and in<br>
the config, I have only once the mark &quot;xxx&quot; printed in syslog (see the<br>
config below).<br>
t_newtran before calling callcontrol does not work as well - it is<br>
executed 3 times.<br>
<div><div></div><div class="h5"><br>
On Mon, Jun 13, 2011 at 4:29 PM, Mino Haluz &lt;<a href="mailto:mino.haluz@gmail.com">mino.haluz@gmail.com</a>&gt; wrote:<br>
&gt; It does not work, t_newtran always returns success, so it will never<br>
&gt; absorb the retransmission.<br>
&gt; So what I did was:<br>
&gt;<br>
&gt;           if ($sht(a=&gt;$ci::retrans) == 0) {<br>
&gt;               $sht(a=&gt;$ci::retrans) = 1;<br>
&gt;           } else {<br>
&gt;               exit();<br>
&gt;           }<br>
&gt;<br>
&gt;          xlog(&quot;L_INFO&quot;,&quot;XLOG: xxx&quot;);<br>
&gt;          call_control();<br>
&gt;<br>
&gt; I prepared sipp scenario which generates 3 INVITEs separated by 200ms.<br>
&gt; It will gives me this:<br>
&gt;<br>
&gt; Jun 13 16:07:04 no-testing /sbin/kamailio[5274]: INFO: &lt;script&gt;: XLOG: xxx<br>
&gt; Jun 13 16:07:04 no-testing /sbin/kamailio[5273]: WARNING: call_control<br>
&gt; [call_control.c:1156]: dialog to trace controlled call was not<br>
&gt; created. discarding callcontrol.<br>
&gt; Jun 13 16:07:04 no-testing /sbin/kamailio[5275]: WARNING: call_control<br>
&gt; [call_control.c:1156]: dialog to trace controlled call was not<br>
&gt; created. discarding callcontrol.<br>
&gt;<br>
&gt; So, the first INVITE was processed by call_control, another 2 were<br>
&gt; not. But WHAT executed those two call_control is some kind of miracle<br>
&gt; for me ... Callcontrol module is somehow executed at the beginning of<br>
&gt; the config file where the values are set or why?<br>
&gt;<br>
&gt; This is what I always set at the beginning:<br>
&gt;<br>
&gt; modparam(&quot;dialog&quot;, &quot;dlg_flag&quot;, 4)<br>
&gt; modparam(&quot;call_control&quot;, &quot;diverter_avp_id&quot;, 256)                #used<br>
&gt; to set billing party. default is From uri<br>
&gt; modparam(&quot;call_control&quot;, &quot;canonical_uri_avp&quot;, &quot;$avp(s:can_uri)&quot;)<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Jun 6, 2011 at 10:16 PM, Daniel-Constantin Mierla<br>
&gt; &lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt; wrote:<br>
&gt;&gt; Hello,<br>
&gt;&gt;<br>
&gt;&gt; if it is a retransmission, then just do t_newtran() in your config file<br>
&gt;&gt; before handling it to call control to be sure the retransmitted requests are<br>
&gt;&gt; absorbed.<br>
&gt;&gt; <a href="http://kamailio.org/docs/modules/stable/modules/tm.html#t_newtran" target="_blank">http://kamailio.org/docs/modules/stable/modules/tm.html#t_newtran</a><br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt; Daniel<br>
&gt;&gt;<br>
&gt;&gt; On 6/6/11 4:29 PM, Mino Haluz wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt; my kamailio server is receiving from some customers 3 identical INVITEs when<br>
&gt;&gt; call is initiated (separated by 200ms). Those 3 INVITEs are making a big<br>
&gt;&gt; problem with call_control:<br>
&gt;&gt; WARNING: call_control [call_control.c:1156]: dialog to trace controlled call<br>
&gt;&gt; was not created. discarding callcontrol.<br>
&gt;&gt; That is why, the prepaid limit is not working at all in this case. This way<br>
&gt;&gt; the user can hack the prepaid protection of the account. Otherwise the<br>
&gt;&gt; call_control is fuilly functional.<br>
&gt;&gt; Anybody experienced the similar problem? If so, how to resolve it?<br>
&gt;&gt; Thanks,<br>
&gt;&gt; Mino Haluz<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
&gt;&gt; <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
&gt;&gt; <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
&gt;&gt; <a href="http://linkedin.com/in/miconda" target="_blank">http://linkedin.com/in/miconda</a> -- <a href="http://twitter.com/miconda" target="_blank">http://twitter.com/miconda</a><br>
&gt;<br>
</div></div></blockquote></div><br>