<div dir="ltr">Here it is my failure route where I handle 302 response.<br><br>failure_route[1]<br>{<br> xlog("------- failure_route[1] ----- \n ");<br> t_on_branch("1"); <br><br> if(t_check_status("302"))<br>
{<br> xlog("------- t_check_status(302) ----- \n ");<br> <br> get_redirects("4:1","<blockquote>Redirected");<br> route(1);<br> } <br><br> if( t_check_status("486") && isbflagset(17))<br>
{<br> xlog("------- t_check_status(486) -- isflagset(17) ----- \n ");<br> end_media_session();<br> #resetbflag(6);<br> append_hf("SRC-USER: $rU\r\n");<br> if(avp_pushto("$ruri","$avp(s:cfwdbusy)"))<br>
{<br> append_hf("SRC-CALL-TYPE: cfwdbusy\r\n");<br> append_hf("CFWD: YES\r\n");<br> avp_delete("$avp(s:cfwdbusy)");<br> resetbflag(17);<br>
append_branch();<br> append_hf("PREV_STATUS: $T_reply_code\r\n");<br> #route(5);<br> $avp(i:120) = $avp(s:inv_timeout);<br> route(1);<br> exit;<br>
}<br> } <br> <br> if( t_check_status("408") && isbflagset(18))<br> {<br> xlog("------- t_check_status(408) -- isflagset(18) ----- \n ");<br><br> end_media_session();<br>
#resetbflag(6);<br> append_hf("SRC-USER: $rU\r\n");<br><br> if(avp_pushto("$ruri","$avp(s:cfwdnoanswer)"))<br> {<br> append_hf("SRC-CALL-TYPE: cfwdnoanswer\r\n");<br>
append_hf("CFWD: YES\r\n");<br> avp_delete("$avp(s:cfwdnoanswer)");<br> resetbflag(18);<br> append_branch();<br> append_hf("PREV_STATUS: $T_reply_code\r\n");<br>
route(5);<br> $avp(i:120) = $avp(s:inv_timeout);<br> route(1);<br> exit;<br><br> }<br> else if(isbflagset(4))<br> {<br> xlog("------- t_check_status(408) -- Voicemail ----- \n ");<br>
if(!t_write_unix("/tmp/sems_sock","voicemail/voicemail_headers"))<br> {<br> xlog("----------------- Error--- not communicating----------- \n ");<br>
exit;<br> }<br> exit;<br> }<br> }<br><br> <br><br>}</blockquote><br><br><div class="gmail_quote">On Fri, Aug 1, 2008 at 3:05 PM, Ruchir <span dir="ltr"><<a href="mailto:ruchir.lists@gmail.com">ruchir.lists@gmail.com</a>></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"><<a href="mailto:ruchir.lists@gmail.com" target="_blank">ruchir.lists@gmail.com</a>></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'm getting the forward reason. But still there'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("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><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><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 & 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>
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 <<a href="mailto:ruchir.lists@gmail.com" target="_blank">ruchir.lists@gmail.com</a>> 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'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 <<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>> 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 "modparam("tm", "onreply_avp_mode", 1)" in config file. I've stored the diversion header in reply route using following code.<br>
<br>
if($hdr(Diversion)!=null)<br>
{<br>
avp_delete("$avp(s:src_user_reply)");<br>
$avp(s:src_user_reply) = $hdr(Diversion);<br>
xlog("Client call forwarding to<br>
$avp(s:src_user_reply)\n ");<br>
}<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 <<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a> <mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>>> wrote:<br>
<br>
Hi Ruchir,<br>
<br>
You may try the following approach:<br>
<br>
1) in onreply_route, if 3xx, store the info from the reply in an<br>
AVP (be sure an enable onreply_avp_mode -<br>
<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>
2) in failure route, if the 3xx was selected as final response,<br>
use the AVP for extra accouting.<br>
<br>
regards,<br>
Bogdan<br>
<br>
Ruchir wrote:<br>
<br>
I'm using uac_redirect module to handle redirect and<br>
accounting from openser. Redirect works fine so as cdr but I'm<br>
not getting how to write redirect reason in cdr. I didn't find<br>
any way to find and store redirect reason(call forward, busy,<br>
no answer) in CDR. Does anyone know how to do it?<br>
------------------------------------------------------------------------<br>
<br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br></div>
<a href="mailto:Users@lists.openser.org" target="_blank">Users@lists.openser.org</a> <mailto:<a href="mailto:Users@lists.openser.org" target="_blank">Users@lists.openser.org</a>><div><br>
<a href="http://lists.openser.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser.org/cgi-bin/mailman/listinfo/users</a><br>
<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>