<!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">
    Hi Jayesh,<br>
    <br>
    Yes, the missed_call flag is automatically reset after each
    triggering, so basically, in failure route,&nbsp; you need to set it
    again. That is done on purpose.<br>
    <br>
    Regards,<br>
    Bogdan<br>
    <br>
    On 12/03/2011 01:15 PM, Jayesh Nambiar wrote:
    <blockquote
cite="mid:CALvF6vCZ42Ni7u3StP1-gSsW08HhP58kdr9ZgecP2CLLZcJ0tg@mail.gmail.com"
      type="cite">Hello,<br>
      The below problem was because of an error in the configuration.
      Basically you have to set the missed_call flag every time before
      going into the failure route. It works well when configured like
      that !!<br>
      <br>
      Thanks for all the help.<br>
      <br>
      --- Jayesh<br>
      <br>
      <div class="gmail_quote">On Fri, Dec 2, 2011 at 2:51 PM, Jayesh
        Nambiar <span dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:jayesh.voip@gmail.com">jayesh.voip@gmail.com</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          Hi Bogdan,<br>
          Just ran into another challenge while testing this. Basically
          I try 3 carriers for a single call. So what happens now is,
          the first failed call gets inserted into the missed_calls
          table but the second and third one does not enter. Moreover,
          if the first call fails and before the second carrier connects
          if the caller sends a CANCEL, the row with 487 status also
          does not get entered into the missed_calls table.<br>
          How do I make sure that all failed transactions get inserted
          into the missed_call table and successful call get inserted
          into the acc table !!<br>
          Thanks,<br>
          <br>
          --- Jayesh
          <div class="HOEnZb">
            <div class="h5"><br>
              <br>
              <div class="gmail_quote">
                On Tue, Nov 29, 2011 at 12:03 AM, Jayesh Nambiar <span
                  dir="ltr">&lt;<a moz-do-not-send="true"
                    href="mailto:jayesh.voip@gmail.com" target="_blank">jayesh.voip@gmail.com</a>&gt;</span>
                wrote:<br>
                <blockquote class="gmail_quote" style="margin: 0pt 0pt
                  0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204);
                  padding-left: 1ex;">Thanks for the super suggestion.
                  This has just made it very simple and isolated !!<span><font
                      color="#888888"><br>
                      <br>
                      --- Jayesh</font></span>
                  <div>
                    <div><br>
                      <br>
                      <div class="gmail_quote">On Mon, Nov 28, 2011 at
                        5:21 PM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:bogdan@opensips.org"
                            target="_blank">bogdan@opensips.org</a>&gt;</span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:
                          0pt 0pt 0pt 0.8ex; border-left: 1px solid
                          rgb(204, 204, 204); padding-left: 1ex;">
                          <div bgcolor="#ffffff" text="#000000"> Hello
                            Jayesh,<br>
                            <br>
                            For your purpose + needs, I would rather
                            suggest to use, instead of multi-leg
                            accounting, standard accounting + missed
                            calls accounting - so in ACC table you will
                            get a single record showing calls from
                            caller to GWn (successful one), while in
                            MISSED_CALLS table you will get one record
                            per failure (with the corresponding reply
                            info). Probably you can use db_extra to push
                            more than the standard info into the
                            accounting records.<br>
                            <br>
                            Regards,<br>
                            Bogdan
                            <div>
                              <div><br>
                                <br>
                                On 11/28/2011 12:57 PM, Jayesh Nambiar
                                wrote: </div>
                            </div>
                            <blockquote type="cite">
                              <div>
                                <div>Hi All,<br>
                                  I use failure_routes to failover the
                                  calls to multiple carriers. So if 1st
                                  carrier rejects the call, I route it
                                  to another carrier for the call to get
                                  completed. Now, I need the accounting
                                  of first carrier also in the acc
                                  table. Basically I need to know that
                                  this call was rejected from the 1st
                                  carrier and got connected on the
                                  second carrier. I am able to insert
                                  all the carrier related details in the
                                  acc table using multi-leg info
                                  parameter. But I get stuck on the
                                  standard acc columns like sip_code,
                                  sip_reason, to_tag etc.<br>
                                  When the call gets connected on second
                                  carrier, the sip_code and sip_reason
                                  for the first row also shows 200 OK
                                  when in reality the sip_code and
                                  sip_reason for the first attempt was
                                  503 Service Unavailable. Is it
                                  possible to maintain those standard
                                  values also in some variable/AVPs and
                                  insert appropriate values in
                                  appropriate rows??<br>
                                  <br>
                                  I also tried a different approach of
                                  not using acc module and using
                                  avp_db_query for accounting on
                                  reply_routes. Basically this will
                                  insert a record for every initial
                                  INVITE and all BYEs after a reply for
                                  the method is received. Something like
                                  this gives me more control on what is
                                  to be inserted according to my
                                  requirements:<br>
                                  <br>
                                  if(loose_route()) {<br>
                                  if(is_method("BYE")) {<br>
                                  &nbsp;&nbsp; t_on_reply("1");<br>
                                  }<br>
                                  &nbsp;&nbsp; t_relay();<br>
                                  }<br>
                                  <br>
                                  if(is_method("INVITE")) {<br>
                                  &nbsp;&nbsp;&nbsp; &lt;my logic&gt;<br>
                                  &nbsp;&nbsp;&nbsp; t_on_reply("1");<br>
                                  &nbsp;&nbsp;&nbsp; t_relay();<br>
                                  }<br>
                                  <br>
                                  onreply_route[1] {<br>
                                  &nbsp;&nbsp; if(status =~ [2-6][0-9][0-9]) {<br>
                                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; avp_db_query("insert into acc
                                  (sip_method,
                                  sip_to_tag,sip_callid,sip_code,sip_reason,
                                  calling_party, called_party,
                                  source_ip, dst_ip) values ('$rm',
                                  '$tt', '$ci', '$rs', '$rr', '$fU',
                                  '$avp(called_party)',
                                  '$avp(source_ip)', '$avp(dst_ip)' )");<br>
                                  &nbsp;&nbsp; }<br>
                                  }<br>
                                  I set the appropriate AVPs like
                                  $avp(called_party), $avp(dst_ip) etc
                                  after the initial INVITEs according to
                                  my requirements. These are my
                                  questions:<br>
                                  <br>
                                  1) First and foremost will this method
                                  insert proper INVITE and BYE for
                                  accounting purpose?<br>
                                  2) How much roughly will be the
                                  penalty on efficiency as compared to
                                  using the acc module?<br>
                                  3) Can AVP module take advantage of
                                  parameters like query_buffer_time and
                                  query_flush_time for performance
                                  reasons?<br>
                                  4) Can I use prepared_statements while
                                  inserting using avp_db_query for
                                  performance reasons?<br>
                                  <br>
                                  Any help and suggestions regarding the
                                  above queries are very much
                                  appreciated.<br>
                                  Thanks in advance.<br>
                                  <br>
                                  --- Jayesh<br>
                                </div>
                              </div>
                              <pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a moz-do-not-send="true" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><span><font color="#888888">
</font></span></pre>
                              <span><font color="#888888"> </font></span></blockquote>
                            <span><font color="#888888"> <br>
                                <br>
                                <pre cols="72">-- 
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
OpenSIPS solutions and "know-how"</pre>
                              </font></span></div>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </div>
                </blockquote>
              </div>
              <br>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
OpenSIPS solutions and "know-how"</pre>
  </body>
</html>