<div dir="ltr">I'm using uac_redirect module to handle redirect from UA and doing accounting from
openser. Redirect works fine so as cdr but I'm not able to store CDR records for multi-leg accounting properly. <br><br>I have set onreply avp by<div class="Ih2E3d"><br><blockquote><font size="2"><span style="font-family: arial,sans-serif;">modparam("tm", "onreply_avp_mode", 1)</span></font><br style="font-family: arial,sans-serif;">
</blockquote></div><pre><font size="2"><br><font face="arial,sans-serif"><font size="2">I've set following in onreply route<br><br></font></font></font></pre><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
<font size="2"><font face="arial,sans-serif"><font size="2">if($hdr(Diversion)!=null)</font></font></font><br><font size="2"><font face="arial,sans-serif"><font size="2">        {</font></font></font><br><font size="2"><font face="arial,sans-serif"><font size="2">                avp_delete("$avp(s:src_call_type)");</font></font></font><br>
<font size="2"><font face="arial,sans-serif"><font size="2">                $avp(s:src_call_type) = $hdr(Diversion);</font></font></font><div class="Ih2E3d"><br><font size="2"><font face="arial,sans-serif"><font size="2">                xlog("Client call forwarding to $avp(s:src_user_reply)\n ");</font></font></font></div>
</blockquote>
<div><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">avp_subst("$avp(s:src_user_reply)", "/(.*)<sip:(.*)@(.*)>;reason=(.*)/\4/"); <br>
</blockquote></div><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><br><font size="2"><font face="arial,sans-serif"><font size="2">                                </font></font></font><br>
<font size="2"><font face="arial,sans-serif"><font size="2">                switch($avp(s:src_call_type))</font></font></font><br><font size="2"><font face="arial,sans-serif"><font size="2">                {</font></font></font><br><font size="2"><font face="arial,sans-serif"><font size="2">                        case "unconditional":</font></font></font><br>
<font size="2"><font face="arial,sans-serif"><font size="2">                                $avp(s:call_type) = "cwfd";</font></font></font><br><font size="2"><font face="arial,sans-serif"><font size="2">                                break;</font></font></font><br>
<font size="2"><font face="arial,sans-serif"><font size="2">                        case "user-busy":</font></font></font><br><font size="2"><font face="arial,sans-serif"><font size="2">                                $avp(s:call_type) = "cwfdbusy";</font></font></font><br>
<font size="2"><font face="arial,sans-serif"><font size="2">                                break;</font></font></font><br><font size="2"><font face="arial,sans-serif"><font size="2">                        case "no-answer":</font></font></font><br><font size="2"><font face="arial,sans-serif"><font size="2">                                $avp(s:call_type) = "cwfdnoanswer";</font></font></font><br>
<font size="2"><font face="arial,sans-serif"><font size="2">                                break;</font></font></font><br><font size="2"><font face="arial,sans-serif"><font size="2">                        default:</font></font></font><br><font size="2"><font face="arial,sans-serif"><font size="2">                                log("no forwarding\n");</font></font></font><br>
<font size="2"><font face="arial,sans-serif"><font size="2">                }</font></font></font><br><br><font size="2"><font face="arial,sans-serif"><font size="2">        }</font></font></font><br style="font-family: arial,sans-serif;"><br>
</blockquote>But the problem is that records are not
generated the way we expect and the way it works in normal forwarding
using usr_preferences. For example call is forwarded from one user to
another, the first leg of the call should be logged as it should
normally be($fU in leg source, $rU in leg destination &
calltype=call) and in next cdr log, it should log with forwarding
details(Forwarding user in leg source, forwarded user in leg
destination & calltype=cfwd). But it actually generates 5 records(1
failed invite, 2 ok invites & 2 byes, instead of 2 invites & 2
byes) of the call. Also as we set calltype and leg source in onreply
route, it'll store that date for the first leg of the CDR which should
not happen.<br><br>Is the same limitation is there in OpenSIPS or it has better uac_redirect module?<br><br>I'll consider switching to OpenSIPS if it solves this issue.<br></div>