<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6001.18099" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>up!</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><B>From:</B> <A title=ruchir.lists@gmail.com 
href="mailto:ruchir.lists@gmail.com">Ruchir</A> </DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=bogdan@voice-system.ro 
  href="mailto:bogdan@voice-system.ro">Bogdan-Andrei Iancu</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Cc:</B> <A title=users@lists.opensips.org 
  href="mailto:users@lists.opensips.org">users@lists.opensips.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, August 11, 2008 1:03 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [OpenSIPS-Users] multi-leg 
  accounting in case of redirect</DIV>
  <DIV><BR></DIV>
  <DIV dir=ltr>Here it is. route[1] is relay route.<BR><BR>
  <BLOCKQUOTE>failure_route[1]<BR>{<BR>&nbsp;&nbsp;&nbsp; xlog("------- 
    failure_route[1] ----- \n ");<BR>&nbsp;&nbsp;&nbsp; t_on_branch("1"); 
    <BR><BR>&nbsp;&nbsp;&nbsp; if(t_check_status("302"))<BR>&nbsp;&nbsp;&nbsp; 
    {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("------- t_check_status(302) 
    ----- \n ");<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; get_redirects("4:1","Redirected");<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; route(1);<BR>&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; 
    <BR><BR>&nbsp;&nbsp;&nbsp; if( t_check_status("486") &amp;&amp; 
    isbflagset(17))<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; xlog("------- t_check_status(486) -- isflagset(17) ----- 
    \n 
    ");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    end_media_session();<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    #resetbflag(6);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    append_hf("SRC-USER: $rU\r\n");<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    if(avp_pushto("$ruri","$avp(s:cfwdbusy)"))<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; append_hf("SRC-CALL-TYPE: 
    cfwdbusy\r\n");<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    append_hf("CFWD: YES\r\n");<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; avp_delete("$avp(s:cfwdbusy)");<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; resetbflag(17);<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; append_branch();<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; append_hf("PREV_STATUS: 
    $T_reply_code\r\n");<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; #route(5);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; $avp(i:120) = $avp(s:inv_timeout);<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; route(1);<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit;<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; 
    <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; if( 
    t_check_status("408") &amp;&amp; isbflagset(18))<BR>&nbsp;&nbsp;&nbsp; 
    {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("------- t_check_status(408) 
    -- isflagset(18) ----- \n 
    ");<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    end_media_session();<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    #resetbflag(6);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    append_hf("SRC-USER: 
    $rU\r\n");<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    if(avp_pushto("$ruri","$avp(s:cfwdnoanswer)"))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    append_hf("SRC-CALL-TYPE: cfwdnoanswer\r\n");<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; append_hf("CFWD: 
    YES\r\n");<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    avp_delete("$avp(s:cfwdnoanswer)");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    resetbflag(18);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    append_branch();<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    append_hf("PREV_STATUS: $T_reply_code\r\n");<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; route(5);<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $avp(i:120) = 
    $avp(s:inv_timeout);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; route(1);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; 
    exit;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    else if(isbflagset(4))<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("------- 
    t_check_status(408) -- Voicemail ----- \n ");<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    if(!t_write_unix("/tmp/sems_sock","voicemail/voicemail_headers"))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("----------------- Error--- not 
    communicating----------- \n ");<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit;<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    }<BR><BR>&nbsp;<BR><BR>}<BR></BLOCKQUOTE><BR>
  <DIV class=gmail_quote>On Mon, Aug 11, 2008 at 2:07 AM, Bogdan-Andrei Iancu 
  <SPAN dir=ltr>&lt;<A 
  href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</A>&gt;</SPAN> 
  wrote:<BR>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Could 
    you post your complete failure route (if not a secret;) ) 
    ?<BR><BR>Regards,<BR>Bogdan<BR><BR><BR>Ruchir wrote:<BR>
    <BLOCKQUOTE class=gmail_quote 
    style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
      <DIV class=Ih2E3d>Yes. I've used uac_redirect module and I'm using 
      &nbsp;get_redirects function to load the contacts to redirect 
      to.<BR><BR></DIV>
      <DIV>
      <DIV></DIV>
      <DIV class=Wj3C7c>On Sun, Aug 10, 2008 at 4:02 PM, Bogdan-Andrei Iancu 
      &lt;<A href="mailto:bogdan@voice-system.ro" 
      target=_blank>bogdan@voice-system.ro</A> &lt;mailto:<A 
      href="mailto:bogdan@voice-system.ro" 
      target=_blank>bogdan@voice-system.ro</A>&gt;&gt; wrote:<BR><BR>&nbsp; 
      &nbsp;Hi Ruchir,<BR><BR>&nbsp; &nbsp;Are you using uac_redirect module to 
      process the 3xx replies on<BR>&nbsp; &nbsp;server?<BR><BR>&nbsp; 
      &nbsp;Regards,<BR>&nbsp; &nbsp;Bogdan<BR><BR>&nbsp; &nbsp;Ruchir 
      wrote:<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp;Yes. I've set unconditional 
      forwarding in linksys pap2. So it<BR>&nbsp; &nbsp; &nbsp; &nbsp;sends "302 
      temporarily moved".<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp;On Sat, Aug 9, 2008 
      at 4:36 PM, Bogdan-Andrei Iancu<BR>&nbsp; &nbsp; &nbsp; &nbsp;&lt;<A 
      href="mailto:bogdan@voice-system.ro" 
      target=_blank>bogdan@voice-system.ro</A> &lt;mailto:<A 
      href="mailto:bogdan@voice-system.ro" 
      target=_blank>bogdan@voice-system.ro</A>&gt;<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;&lt;mailto:<A href="mailto:bogdan@voice-system.ro" 
      target=_blank>bogdan@voice-system.ro</A><BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;&lt;mailto:<A href="mailto:bogdan@voice-system.ro" 
      target=_blank>bogdan@voice-system.ro</A>&gt;&gt;&gt; wrote:<BR><BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; Hi Ruchir,<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; The redirect on the phone is done via the 3xx 
      replies?<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Regards,<BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; Bogdan<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; Ruchir wrote:<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; I've set avp and radius_extra param properly. If I<BR>&nbsp; &nbsp; 
      &nbsp; &nbsp;handle call<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; forwarding from server side, everything works fine. I<BR>&nbsp; 
      &nbsp; &nbsp; &nbsp;get leg<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; source, destination, forward reason, etc. perfectly. The<BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; problem is there only when I do 
      call forwarding from phone.<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; On Fri, Aug 8, 2008 at 8:08 PM, Pablo Hernan Saro<BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<A 
      href="mailto:pablosaro@gmail.com" target=_blank>pablosaro@gmail.com</A> 
      &lt;mailto:<A href="mailto:pablosaro@gmail.com" 
      target=_blank>pablosaro@gmail.com</A>&gt;<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;&lt;mailto:<A href="mailto:pablosaro@gmail.com" 
      target=_blank>pablosaro@gmail.com</A> &lt;mailto:<A 
      href="mailto:pablosaro@gmail.com" 
      target=_blank>pablosaro@gmail.com</A>&gt;&gt;<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &lt;mailto:<A 
      href="mailto:pablosaro@gmail.com" 
      target=_blank>pablosaro@gmail.com</A><BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;&lt;mailto:<A href="mailto:pablosaro@gmail.com" 
      target=_blank>pablosaro@gmail.com</A>&gt; &lt;mailto:<A 
      href="mailto:pablosaro@gmail.com" 
      target=_blank>pablosaro@gmail.com</A><BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;&lt;mailto:<A href="mailto:pablosaro@gmail.com" 
      target=_blank>pablosaro@gmail.com</A>&gt;&gt;&gt;&gt; wrote:<BR><BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;I believe that it's 
      not about how OpenSER or OpenSIPS<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; implements<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp;multi-leg accounting, it's about how you do.<BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Particularly how 
      you set up two important parameters for<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; the acc<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp;module: multi_leg_info and db_extra. In my case, 
      I<BR>&nbsp; &nbsp; &nbsp; &nbsp;set up<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; one avp<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp;for source leg, another for destination leg and two 
      avps<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for 
      extra<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp;information: the state of the call and a<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;classification of<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; the dst.<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp;The "state of the call", for me, means when it's a<BR>&nbsp; &nbsp; 
      &nbsp; &nbsp;call, a<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      fw or<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp;whatever; while the "classification of the dst"<BR>&nbsp; &nbsp; 
      &nbsp; &nbsp;means if dst is<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp;national, long distance, international.<BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;So, you have to set 
      up avps as the information you<BR>&nbsp; &nbsp; &nbsp; &nbsp;need 
      and<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; make<BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sure to set it to 
      proper values before the acc module<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; writes the<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp;row in your db.<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp;BTW, take care of using Diversion header... 
      It's a draft<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from 
      2004<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;and 
      it's expired. Not all UAC/UAS has this implemented.<BR>&nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;I hope it helps.<BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp;Cheers<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp;Pablo<BR><BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp;On Fri, Aug 8, 2008 at 4:05 AM, Ruchir<BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;<A 
      href="mailto:ruchir.lists@gmail.com" 
      target=_blank>ruchir.lists@gmail.com</A> &lt;mailto:<A 
      href="mailto:ruchir.lists@gmail.com" 
      target=_blank>ruchir.lists@gmail.com</A>&gt;<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;&lt;mailto:<A href="mailto:ruchir.lists@gmail.com" 
      target=_blank>ruchir.lists@gmail.com</A> &lt;mailto:<A 
      href="mailto:ruchir.lists@gmail.com" 
      target=_blank>ruchir.lists@gmail.com</A>&gt;&gt;<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;mailto:<A 
      href="mailto:ruchir.lists@gmail.com" 
      target=_blank>ruchir.lists@gmail.com</A><BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;&lt;mailto:<A href="mailto:ruchir.lists@gmail.com" 
      target=_blank>ruchir.lists@gmail.com</A>&gt;<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &lt;mailto:<A 
      href="mailto:ruchir.lists@gmail.com" 
      target=_blank>ruchir.lists@gmail.com</A><BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;&lt;mailto:<A href="mailto:ruchir.lists@gmail.com" 
      target=_blank>ruchir.lists@gmail.com</A>&gt;&gt;&gt;&gt; 
      wrote:<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp;I'm using uac_redirect module to handle 
      redirect<BR>&nbsp; &nbsp; &nbsp; &nbsp;from<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; UA and<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;doing accounting from openser. Redirect 
      works<BR>&nbsp; &nbsp; &nbsp; &nbsp;fine so<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; as cdr<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;but I'm not able to store CDR records 
      for multi-leg<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      accounting<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp;properly.<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;I have set onreply avp 
      by<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp;modparam("tm", "onreply_avp_mode", 
      1)<BR><BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp;I've set following in onreply route<BR><BR><BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp;if($hdr(Diversion)!=null)<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp;avp_delete("$avp(s:src_call_type)");<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp;$avp(s:src_call_type) = $hdr(Diversion);<BR><BR>&nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp;xlog("Client call forwarding to<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; $avp(s:src_user_reply)\n ");<BR><BR>&nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp;avp_subst("$avp(s:src_user_reply)",<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp;"/(.*)&lt;sip:(.*)@(.*)&gt;;reason=(.*)/\4/");<BR><BR><BR><BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp;switch($avp(s:src_call_type))<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp;case "unconditional":<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$avp(s:call_type) = 
      "cwfd";<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp;break;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case 
      "user-busy":<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$avp(s:call_type) = 
      "cwfdbusy";<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case 
      "no-answer":<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$avp(s:call_type) = 
      "cwfdnoanswer";<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp;default:<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;log("no forwarding\n");<BR>&nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp;}<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;But the problem is that 
      records are not<BR>&nbsp; &nbsp; &nbsp; &nbsp;generated the<BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; way we<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;expect and the way 
      it works in normal forwarding<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;using<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp;usr_preferences. For example call is 
      forwarded<BR>&nbsp; &nbsp; &nbsp; &nbsp;from one<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; user<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;to another, the first leg of the 
      call should be<BR>&nbsp; &nbsp; &nbsp; &nbsp;logged<BR>&nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; as it<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;should normally be($fU in 
      leg source, $rU in leg<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      destination &amp;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp;calltype=call) and in next cdr log, it 
      should<BR>&nbsp; &nbsp; &nbsp; &nbsp;log with<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;forwarding 
      details(Forwarding user in leg<BR>&nbsp; &nbsp; &nbsp; &nbsp;source, 
      forwarded<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp;user in leg destination &amp; calltype=cfwd). But 
      it<BR>&nbsp; &nbsp; &nbsp; &nbsp;actually<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;generates 5 records(1 
      failed invite, 2 ok<BR>&nbsp; &nbsp; &nbsp; &nbsp;invites &amp; 2 
      byes,<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp;instead of 2 invites &amp; 2 byes) of the call. 
      Also<BR>&nbsp; &nbsp; &nbsp; &nbsp;as we set<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;calltype and leg 
      source in onreply route, it'll<BR>&nbsp; &nbsp; &nbsp; &nbsp;store 
      that<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp;date for the first leg of the CDR which should<BR>&nbsp; 
      &nbsp; &nbsp; &nbsp;not happen.<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Is the same limitation is there 
      in OpenSIPS or<BR>&nbsp; &nbsp; &nbsp; &nbsp;it has<BR>&nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; better<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;uac_redirect 
      module?<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp;I'll consider switching to OpenSIPS if it 
      solves<BR>&nbsp; &nbsp; &nbsp; &nbsp;this<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; issue.<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp;_______________________________________________<BR>&nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Users 
      mailing list<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp;<A href="mailto:Users@lists.opensips.org" 
      target=_blank>Users@lists.opensips.org</A><BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;&lt;mailto:<A href="mailto:Users@lists.opensips.org" 
      target=_blank>Users@lists.opensips.org</A>&gt;<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &lt;mailto:<A 
      href="mailto:Users@lists.opensips.org" 
      target=_blank>Users@lists.opensips.org</A><BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;&lt;mailto:<A href="mailto:Users@lists.opensips.org" 
      target=_blank>Users@lists.opensips.org</A>&gt;&gt;<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &lt;mailto:<A 
      href="mailto:Users@lists.opensips.org" 
      target=_blank>Users@lists.opensips.org</A><BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;&lt;mailto:<A href="mailto:Users@lists.opensips.org" 
      target=_blank>Users@lists.opensips.org</A>&gt;<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &lt;mailto:<A 
      href="mailto:Users@lists.opensips.org" 
      target=_blank>Users@lists.opensips.org</A><BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;&lt;mailto:<A href="mailto:Users@lists.opensips.org" 
      target=_blank>Users@lists.opensips.org</A>&gt;&gt;&gt;<BR><BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp;<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><BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      ------------------------------------------------------------------------<BR><BR><BR><BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
      _______________________________________________<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; Users mailing list<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; <A href="mailto:Users@lists.opensips.org" 
      target=_blank>Users@lists.opensips.org</A><BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;&lt;mailto:<A href="mailto:Users@lists.opensips.org" 
      target=_blank>Users@lists.opensips.org</A>&gt;<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;&lt;mailto:<A href="mailto:Users@lists.opensips.org" 
      target=_blank>Users@lists.opensips.org</A><BR>&nbsp; &nbsp; &nbsp; 
      &nbsp;&lt;mailto:<A href="mailto:Users@lists.opensips.org" 
      target=_blank>Users@lists.opensips.org</A>&gt;&gt;<BR>&nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; <A 
      href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" 
      target=_blank>http://lists.opensips.org/cgi-bin/mailman/listinfo/users</A><BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
    <BR><BR><BR><BR></DIV></DIV></BLOCKQUOTE><BR></BLOCKQUOTE></DIV><BR></DIV>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>Users mailing 
  list<BR>Users@lists.opensips.org<BR>http://lists.opensips.org/cgi-bin/mailman/listinfo/users<BR></BLOCKQUOTE></BODY></HTML>