<br><br><div class="gmail_quote"> <br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Daniel,<br><br>This is my ACC configuration:<br><br>
# ----- acc params -----<br>/* what sepcial events should be accounted ? */<br>modparam(&quot;acc&quot;, &quot;early_media&quot;, 1)<br>modparam(&quot;acc&quot;, &quot;report_ack&quot;, 1)<br>
modparam(&quot;acc&quot;, &quot;report_cancels&quot;, 1)<br>/* by default ww do not adjust the direct of the sequential requests.<br>   if you enable this parameter, be sure the enable &quot;append_fromtag&quot;<br>   in &quot;rr&quot; module */<br>

modparam(&quot;acc&quot;, &quot;detect_direction&quot;, 0)<br>/* account triggers (flags) */<br><b>modparam(&quot;acc&quot;, &quot;failed_transaction_flag&quot;, 3)</b><br>modparam(&quot;acc&quot;, &quot;log_flag&quot;, 1)<br>

modparam(&quot;acc&quot;, &quot;log_missed_flag&quot;, 2)<br>modparam(&quot;acc&quot;, &quot;log_extra&quot;,<br>       &quot;src_user=$fU;src_domain=$fd;dst_to_user=$tU;dst_user=$rU;dst_domain=$rd;diversion_uri=$di;destination_uri=$du;display_name=$fn;orig_src_domain=$od;orig_req_uri=$ou;orig_username=$oU;prefered_identity=$pd;display_name_pref_ident=$pn;proxy_ip=$Ri;proxy_port=$Rp;src_ip=$si;dst_dom_uri=$td;user_agent=$ua&quot;)<br>

/* uncomment the following lines to enable DB accounting also */<br>modparam(&quot;acc&quot;, &quot;db_flag&quot;, 1)<br>modparam(&quot;acc&quot;, &quot;db_missed_flag&quot;, 2)<br>modparam(&quot;acc&quot;, &quot;db_url&quot;,<br>

        &quot;mysql://openser:openserrw@localhost/openser10&quot;)<br>modparam(&quot;acc&quot;, &quot;db_extra&quot;,<br>        &quot;src_user=$fU;src_domain=$fd;dst_to_user=$tU;dst_user=$rU;dst_domain=$rd;diversion_uri=$di;destination_uri=$du;display_name=$fn;orig_src_domain=$od;orig_req_uri=$ou;orig_username=$oU;prefered_identity=$pd;display_name_pref_ident=$pn;proxy_ip=$Ri;proxy_port=$Rp;src_ip=$si;dst_dom_uri=$td;user_agent=$ua&quot;)<br>

<br>I run kamailio-1.5.3 no TLS<br><br>What exactly is iirc?<br><br>When i call from an user to an other and the call is passing in case of failure from failure route1 then I get an extra cdr from the failure route1 BUT when I call pstn and the call goes to Failure route2 then I don&#39;t get the extra CDRs. One important diference between Failure route1 and 2 is that in the Failure route2 I have an extra  <b>append_branch();</b><br>

<br> Failure Route 1 (default)<br><br>failure_route[1] {<br>        xlog(&quot;alx ------- Failure Route 1 -------&quot;);<br>#n#     if (is_method(&quot;INVITE&quot;)<br>#n#                     &amp;&amp; (isbflagset(6) || isflagset(5))) {<br>
#n#             unforce_rtp_proxy();<br>#n#     }<br><br>        if (t_was_cancelled()) {<br>                exit;<br>        }<br><br>        # uncomment the following lines if you want to block client<br>        # redirect based on 3xx replies.<br>
        ##if (t_check_status(&quot;3[0-9][0-9]&quot;)) {<br>        ##t_reply(&quot;404&quot;,&quot;Not found&quot;);<br>        ##      exit;<br>        ##}<br><br>        # uncomment the following lines if you want to redirect the failed<br>
        # calls to a different new destination<br>        ##if (t_check_status(&quot;486|408&quot;)) {<br>        ##      sethostport(&quot;<a href="http://192.168.2.100:5060">192.168.2.100:5060</a>&quot;);<br>        ##      append_branch();<br>
        ##      # do not set the missed call flag again<br>        ##      t_relay();<br>        ##}<br>}<br><br>Failure Route2 <br><br><br>failure_route[2] {<br>  <br>  if(t_was_cancelled()) {<br>        exit;<br>  }<br>
<br>  if(t_check_status(&quot;4[0-9][0-9]|5[0-9][0-9]&quot;))<br>  {<br><br>     #xlog(&quot;ACCOUNTING: src_user=$fU;src_domain=$fd;dst_to_user=$tU;dst_user=$rU;dst_domain=$rd;diversion_uri=$di;destination_uri=$du;display_name=$fn;orig_src_domain=$od;orig_req_uri=$ou;orig_username=$oU;prefered_identity=$pd;display_name_pref_ident=$pn;proxy_ip=$Ri;proxy_port=$Rp;src_ip=$si;dst_dom_uri=$td;user_agent=$ua;sip_replay_reson=$rr;sip_replay_status=$T_reply_code&quot;);<br>
     <br>     if(ds_next_domain())<br>     {<br>          xlog(&quot;alx ------------------------------------- The final RU is $rU and the cust_prefix:$avp(s:cust_prefix) --------&quot;);<br>          xlog(&quot;alx ------- [ FAILURE ROUTE 2 ] First part of failure with rd = $rd and prefix = $(ru{uri.param,prefix}) ---&quot;);<br>
            # more destinations from same dispatcher group<br><br>            # add prefix if set and remove the param from R-URI<br>            if($(ru{uri.param,prefix})!=null)<br>            {<br>                $ru = &quot;sip:&quot; + $avp(s:cust_prefix) + $(ru{uri.param,prefix}) + $avp(s:user) + &quot;@&quot; + $rd;<br>
            } else {<br>                $ru = &quot;sip:&quot; + $avp(s:cust_prefix) + $avp(s:user) + &quot;@&quot; + $rd;<br>            }<br>            #rewriteport(5065);<br>            #setport(&quot;5065&quot;);<br>
            t_on_failure(&quot;2&quot;);<br>            <b>append_branch();</b> ##################################################################### This is different !!!!!!!!!!!!!!!!!!<br>            t_relay();<br>            exit;<br>
     } else {<br>            # go to next dispatcher group<br>            xlog(&quot;alx ------- This is the next DST group = $avp(s:dstgrp) -------&quot;);<br>            <br>            <br>            if($avp(s:dstgrp)!=null)<br>
            {<br>                 # select destination<br>                 if(ds_select_domain(&quot;$avp(s:dstgrp)&quot;, &quot;4&quot;))<br>                 {<br>                     xlog(&quot;alx ------- [ FAILURE ROUTE 2 ] Second part of failure with rd = $rd and prefix = $(ru{uri.param,prefix}) ---&quot;);<br>
                     xlog(&quot;alx ------------------------------------- The final RU is $rU and the cust_prefix:$avp(s:cust_prefix) --------&quot;);<br>                     # add prefix if set and remove the param from R-URI<br>
                     if($(ru{uri.param,prefix})!=null)<br>                     {<br>                         $ru = &quot;sip:&quot; + $avp(s:cust_prefix) + $(ru{uri.param,prefix}) + $avp(s:user) + &quot;@&quot; + $rd;<br>
                     } else {<br>                         $ru = &quot;sip:&quot; + $avp(s:cust_prefix) + $avp(s:user) + &quot;@&quot; + $rd;<br>                     }<br>                     $avp(s:dstgrp) = null;<br>                     xlog(&quot;alx ------- This is the next DST group after NULL = $avp(s:dstgrp) -------&quot;);<br>
                     xlog(&quot;alx ------- The final RURI is $ru ------- &quot;);<br>                     t_on_failure(&quot;2&quot;);<br>                     <b>append_branch();</b>##################################################################### This is different !!!!!!!!!!!!!!!!!!<br>
                     t_relay();<br>                     exit;<br>                }<br>         } else {<br>                t_reply(&quot;444&quot;, &quot;No more tries for you!&quot;);<br>                }<br>    }<br>}<br>
<br><br><br>Thanks<br><font color="#888888">Alex</font><div><div></div><div class="h5"><br><br><br><br><div class="gmail_quote">On Mon, Jan 25, 2010 at 12:39 PM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


  

<div bgcolor="#ffffff" text="#000000">
Hi Alex,<div><br>
<br>
On 1/25/10 11:03 AM, alex pappas wrote:
<blockquote type="cite">Hi Daniel,<br>
  <br>
We make a call and the call tries from the Failure Route 5 times new
gateway (with dispatcher) but  WITHOUT success in termination. In every
try we get back 503 Congestion. In this case how many CDRs we should
see in our LOG.<br>
 <br>
We have the modparam(&quot;acc&quot;, &quot;failed_transaction_flag&quot;, 6) and we
setflag(6) for every INVITE.<br>
</blockquote></div>
iirc, at some point was an option to get all failed legs accounted. I
don&#39;t remember using it so I have to check the sources (you are on
1.5.x, right?).<br>
<br>
For next version I plan to make acc functions available on rest of the
routes, should be few updates to take sip method from cseq header and
ignore r-uri if it is a reply processed, in failure route should work
by default, I see no reasons now what could be the problem.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<blockquote type="cite"><div><br>
  <div class="gmail_quote">On Fri, Jan 22, 2010 at 3:33 PM,
Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span> wrote:<br>
  <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello,
    <div>
    <div><br>
    <br>
On 1/22/10 1:08 PM, alex pappas wrote:<br>
    <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dear Friends,<br>
      <br>
In case of a call failure I&#39;m trying from failure route to send the
call through other gateways with Dispatcher module.<br>
I would like to have ACC for all failures that a call can possibly
pass. If the call fails in the 3 first gateways  I want them also in my
mysql ACC table. I tried that with AVPs in the syslog and it works fine
BUT is there any way that I can simply setflag(1) for accounting and I
can have ACC for every try?<br>
      <br>
I tryied to add  in failure route :<br>
      <br>
setflag(1); # do accounting ...<br>
setflag(3); # ... even if the transaction fails<br>
      <br>
but I&#39;m getting ACC only the last try.<br>
      <br>
    </blockquote>
    </div>
    </div>
last failed try? Or what you mean by &quot;the last try&quot;? IIRC, failed
transaction flag should be set for each leg if you want all failures.<br>
    <br>
Cheers,<br>
Daniel<br>
    <font color="#888888"><br>
-- <br>
Daniel-Constantin Mierla<br>
* <a href="http://www.asipto.com/" target="_blank">http://www.asipto.com/</a><br>
    <br>
    </font></blockquote>
  </div>
  <br>
  </div><pre><fieldset></fieldset>
_______________________________________________
Kamailio (OpenSER) - Users mailing list
<div><a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a>
<a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a>
<a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a></div></pre>
</blockquote>
<br><div>
<pre cols="72">-- 
Daniel-Constantin Mierla
* <a href="http://www.asipto.com/" target="_blank">http://www.asipto.com/</a>
</pre>
</div></div>

</blockquote></div><br>
</div></div></blockquote></div><br>