<div dir="ltr">Here it is my failure route where I handle 302 response.<br><br>failure_route[1]<br>{<br>&nbsp;&nbsp;&nbsp; xlog(&quot;------- failure_route[1] ----- \n &quot;);<br>&nbsp;&nbsp;&nbsp; t_on_branch(&quot;1&quot;); <br><br>&nbsp;&nbsp;&nbsp; if(t_check_status(&quot;302&quot;))<br>

&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog(&quot;------- t_check_status(302) ----- \n &quot;);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; get_redirects(&quot;4:1&quot;,&quot;<blockquote>Redirected&quot;);<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(&quot;486&quot;) &amp;&amp; isbflagset(17))<br>

&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog(&quot;------- t_check_status(486) -- isflagset(17) ----- \n &quot;);<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(&quot;SRC-USER: $rU\r\n&quot;);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(avp_pushto(&quot;$ruri&quot;,&quot;$avp(s:cfwdbusy)&quot;))<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; append_hf(&quot;SRC-CALL-TYPE: cfwdbusy\r\n&quot;);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; append_hf(&quot;CFWD: YES\r\n&quot;);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; avp_delete(&quot;$avp(s:cfwdbusy)&quot;);<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(&quot;PREV_STATUS: $T_reply_code\r\n&quot;);<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(&quot;408&quot;) &amp;&amp; isbflagset(18))<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog(&quot;------- t_check_status(408) -- isflagset(18) ----- \n &quot;);<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(&quot;SRC-USER: $rU\r\n&quot;);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(avp_pushto(&quot;$ruri&quot;,&quot;$avp(s:cfwdnoanswer)&quot;))<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(&quot;SRC-CALL-TYPE: cfwdnoanswer\r\n&quot;);<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; append_hf(&quot;CFWD: YES\r\n&quot;);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; avp_delete(&quot;$avp(s:cfwdnoanswer)&quot;);<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(&quot;PREV_STATUS: $T_reply_code\r\n&quot;);<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(&quot;------- t_check_status(408) -- Voicemail ----- \n &quot;);<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(!t_write_unix(&quot;/tmp/sems_sock&quot;,&quot;voicemail/voicemail_headers&quot;))<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(&quot;----------------- Error--- not communicating----------- \n &quot;);<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>}</blockquote><br><br><div class="gmail_quote">On Fri, Aug 1, 2008 at 3:05 PM, Ruchir <span dir="ltr">&lt;<a href="mailto:ruchir.lists@gmail.com">ruchir.lists@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 dir="ltr">It seems it is not possible?<div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">
On Fri, Jul 25, 2008 at 4:20 PM, Ruchir <span dir="ltr">&lt;<a href="mailto:ruchir.lists@gmail.com" target="_blank">ruchir.lists@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 dir="ltr">Now I&#39;m getting the forward reason. But still there&#39;s problem with CDR.<br>

I have set onreply avp by<div><br><pre></pre><blockquote><font size="2"><span style="font-family: arial,sans-serif;">modparam(&quot;tm&quot;, &quot;onreply_avp_mode&quot;, 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&#39;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(&quot;$avp(s:src_call_type)&quot;);</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><br><font size="2"><font face="arial,sans-serif"><font size="2">                xlog(&quot;Client call forwarding to $avp(s:src_user_reply)\n &quot;);</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(&quot;$avp(s:src_user_reply)&quot;, &quot;/(.*)&lt;sip:(.*)@(.*)&gt;;reason=(.*)/\4/&quot;); <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 &quot;unconditional&quot;:</font></font></font><br>


<font size="2"><font face="arial,sans-serif"><font size="2">                                $avp(s:call_type) = &quot;cwfd&quot;;</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 &quot;user-busy&quot;:</font></font></font><br><font size="2"><font face="arial,sans-serif"><font size="2">                                $avp(s:call_type) = &quot;cwfdbusy&quot;;</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 &quot;no-answer&quot;:</font></font></font><br><font size="2"><font face="arial,sans-serif"><font size="2">                                $avp(s:call_type) = &quot;cwfdnoanswer&quot;;</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(&quot;no forwarding\n&quot;);</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><pre></pre>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 &amp; calltype=call) and in next cdr log, it should log with forwarding details(Forwarding user in leg source, forwarded user in leg destination &amp; calltype=cfwd). But it actually generates 5 records(1 failed invite, 2 ok invites &amp; 2 byes, instead of 2 invites &amp; 2 byes) of the call. Also as we set calltype and leg source in onreply route, it&#39;ll store that date for the first leg of the CDR which should not happen.<br>


Any advice how to forward the details to next call leg?<div><div></div><div><br><br><div class="gmail_quote">On Tue, Jul 22, 2008 at 3:59 PM, Ruchir &lt;<a href="mailto:ruchir.lists@gmail.com" target="_blank">ruchir.lists@gmail.com</a>&gt; 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 dir="ltr">I tried this but no luck. I&#39;m storing avp in onreply route. That avp is set in radius_extra param.<div><div></div><div><br><br><div class="gmail_quote">On Mon, Jul 21, 2008 at 10:32 PM, Bogdan-Andrei Iancu &lt;<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>&gt; 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>Ruchir wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I added &quot;modparam(&quot;tm&quot;, &quot;onreply_avp_mode&quot;, 1)&quot; in config file. I&#39;ve stored the diversion header in reply route using following code.<br>
<br>
 &nbsp; &nbsp;if($hdr(Diversion)!=null)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;avp_delete(&quot;$avp(s:src_user_reply)&quot;);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$avp(s:src_user_reply) = $hdr(Diversion);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xlog(&quot;Client call forwarding to<br>
 &nbsp; &nbsp;$avp(s:src_user_reply)\n &quot;);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
<br>
<br>
But I always get NUll value in $avp(s:src_user_reply) when I check in script when new invite arrives.<br>
</blockquote></div>
The AVP will not be visible in a different transaction (for another invite). The AVP will be present only when doing acc for the transaction you set the AVP for.<br>
<br>
Regards,<br>
Bogdan<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>
<br>
On Mon, Jul 21, 2008 at 1:48 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;You may try the following approach:<br>
<br>
 &nbsp; &nbsp;1) in onreply_route, if 3xx, store the info from the reply in an<br>
 &nbsp; &nbsp;AVP (be sure an enable onreply_avp_mode -<br>
 &nbsp; &nbsp;<a href="http://www.openser.org/docs/modules/1.3.x/tm.html#AEN313" target="_blank">http://www.openser.org/docs/modules/1.3.x/tm.html#AEN313</a>)<br>
<br>
 &nbsp; &nbsp;2) in failure route, if the 3xx was selected as final response,<br>
 &nbsp; &nbsp;use the AVP for extra accouting.<br>
<br>
 &nbsp; &nbsp;regards,<br>
 &nbsp; &nbsp;Bogdan<br>
<br>
 &nbsp; &nbsp;Ruchir wrote:<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;I&#39;m using uac_redirect module to handle redirect and<br>
 &nbsp; &nbsp; &nbsp; &nbsp;accounting from openser. Redirect works fine so as cdr but I&#39;m<br>
 &nbsp; &nbsp; &nbsp; &nbsp;not getting how to write redirect reason in cdr. I didn&#39;t find<br>
 &nbsp; &nbsp; &nbsp; &nbsp;any way to find and store redirect reason(call forward, busy,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;no answer) in CDR. Does anyone know how to do it?<br>
 &nbsp; &nbsp; &nbsp; &nbsp;------------------------------------------------------------------------<br>
<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;_______________________________________________<br>
 &nbsp; &nbsp; &nbsp; &nbsp;Users mailing list<br></div>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:Users@lists.openser.org" target="_blank">Users@lists.openser.org</a> &lt;mailto:<a href="mailto:Users@lists.openser.org" target="_blank">Users@lists.openser.org</a>&gt;<div><br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://lists.openser.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser.org/cgi-bin/mailman/listinfo/users</a><br>
 &nbsp; &nbsp; &nbsp; &nbsp; <br>
<br>
<br>
</div></blockquote>
<br>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>