<!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.18063" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>maybe you can post this on the kamailio
list,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>then you should receive an answer.</FONT></DIV>
<DIV><FONT face=Arial size=2>Here seems nobody take care about it.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Regards</FONT></DIV>
<DIV><FONT face=Arial size=2>Ros</FONT></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">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=ruchir.lists@gmail.com
href="mailto:ruchir.lists@gmail.com">Ruchir</A> </DIV>
<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> 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","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>}<BR></BLOCKQUOTE><BR>
<DIV class=gmail_quote>On Mon, Aug 11, 2008 at 2:07 AM, Bogdan-Andrei Iancu
<SPAN dir=ltr><<A
href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</A>></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
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
<<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> Are you using uac_redirect module to
process the 3xx replies on<BR> server?<BR><BR>
Regards,<BR> Bogdan<BR><BR> Ruchir
wrote:<BR><BR> Yes. I've set unconditional
forwarding in linksys pap2. So it<BR> sends "302
temporarily moved".<BR><BR> On Sat, Aug 9, 2008
at 4:36 PM, Bogdan-Andrei Iancu<BR> <<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>><BR>
<mailto:<A href="mailto:bogdan@voice-system.ro"
target=_blank>bogdan@voice-system.ro</A><BR>
<mailto:<A href="mailto:bogdan@voice-system.ro"
target=_blank>bogdan@voice-system.ro</A>>>> wrote:<BR><BR>
Hi Ruchir,<BR><BR>
The redirect on the phone is done via the 3xx
replies?<BR><BR> Regards,<BR>
Bogdan<BR><BR>
Ruchir wrote:<BR><BR>
I've set avp and radius_extra param properly. If I<BR>
handle call<BR>
forwarding from server side, everything works fine. I<BR>
get leg<BR>
source, destination, forward reason, etc. perfectly. The<BR>
problem is there only when I do
call forwarding from phone.<BR><BR>
On Fri, Aug 8, 2008 at 8:08 PM, Pablo Hernan Saro<BR>
<<A
href="mailto:pablosaro@gmail.com" target=_blank>pablosaro@gmail.com</A>
<mailto:<A href="mailto:pablosaro@gmail.com"
target=_blank>pablosaro@gmail.com</A>><BR>
<mailto:<A href="mailto:pablosaro@gmail.com"
target=_blank>pablosaro@gmail.com</A> <mailto:<A
href="mailto:pablosaro@gmail.com"
target=_blank>pablosaro@gmail.com</A>>><BR>
<mailto:<A
href="mailto:pablosaro@gmail.com"
target=_blank>pablosaro@gmail.com</A><BR>
<mailto:<A href="mailto:pablosaro@gmail.com"
target=_blank>pablosaro@gmail.com</A>> <mailto:<A
href="mailto:pablosaro@gmail.com"
target=_blank>pablosaro@gmail.com</A><BR>
<mailto:<A href="mailto:pablosaro@gmail.com"
target=_blank>pablosaro@gmail.com</A>>>>> wrote:<BR><BR>
I believe that it's
not about how OpenSER or OpenSIPS<BR>
implements<BR>
multi-leg accounting, it's about how you do.<BR>
Particularly how
you set up two important parameters for<BR>
the acc<BR>
module: multi_leg_info and db_extra. In my case,
I<BR> set up<BR>
one avp<BR>
for source leg, another for destination leg and two
avps<BR> for
extra<BR>
information: the state of the call and a<BR>
classification of<BR>
the dst.<BR>
The "state of the call", for me, means when it's a<BR>
call, a<BR>
fw or<BR>
whatever; while the "classification of the dst"<BR>
means if dst is<BR>
national, long distance, international.<BR>
So, you have to set
up avps as the information you<BR> need
and<BR> make<BR>
sure to set it to
proper values before the acc module<BR>
writes the<BR>
row in your db.<BR>
BTW, take care of using Diversion header...
It's a draft<BR> from
2004<BR> and
it's expired. Not all UAC/UAS has this implemented.<BR>
I hope it helps.<BR>
Cheers<BR><BR>
Pablo<BR><BR><BR>
On Fri, Aug 8, 2008 at 4:05 AM, Ruchir<BR>
<<A
href="mailto:ruchir.lists@gmail.com"
target=_blank>ruchir.lists@gmail.com</A> <mailto:<A
href="mailto:ruchir.lists@gmail.com"
target=_blank>ruchir.lists@gmail.com</A>><BR>
<mailto:<A href="mailto:ruchir.lists@gmail.com"
target=_blank>ruchir.lists@gmail.com</A> <mailto:<A
href="mailto:ruchir.lists@gmail.com"
target=_blank>ruchir.lists@gmail.com</A>>><BR>
<mailto:<A
href="mailto:ruchir.lists@gmail.com"
target=_blank>ruchir.lists@gmail.com</A><BR>
<mailto:<A href="mailto:ruchir.lists@gmail.com"
target=_blank>ruchir.lists@gmail.com</A>><BR>
<mailto:<A
href="mailto:ruchir.lists@gmail.com"
target=_blank>ruchir.lists@gmail.com</A><BR>
<mailto:<A href="mailto:ruchir.lists@gmail.com"
target=_blank>ruchir.lists@gmail.com</A>>>>>
wrote:<BR><BR>
I'm using uac_redirect module to handle
redirect<BR> from<BR>
UA and<BR>
doing accounting from openser. Redirect
works<BR> fine so<BR>
as cdr<BR>
but I'm not able to store CDR records
for multi-leg<BR>
accounting<BR>
properly.<BR><BR>
I have set onreply avp
by<BR><BR>
modparam("tm", "onreply_avp_mode",
1)<BR><BR><BR>
I've set following in onreply route<BR><BR><BR>
if($hdr(Diversion)!=null)<BR>
{<BR>
avp_delete("$avp(s:src_call_type)");<BR>
$avp(s:src_call_type) = $hdr(Diversion);<BR><BR>
xlog("Client call forwarding to<BR>
$avp(s:src_user_reply)\n ");<BR><BR>
avp_subst("$avp(s:src_user_reply)",<BR>
"/(.*)<sip:(.*)@(.*)>;reason=(.*)/\4/");<BR><BR><BR><BR>
switch($avp(s:src_call_type))<BR>
{<BR>
case "unconditional":<BR>
$avp(s:call_type) =
"cwfd";<BR>
break;<BR>
case
"user-busy":<BR>
$avp(s:call_type) =
"cwfdbusy";<BR>
break;<BR>
case
"no-answer":<BR>
$avp(s:call_type) =
"cwfdnoanswer";<BR>
break;<BR>
default:<BR>
log("no forwarding\n");<BR>
}<BR><BR>
}<BR><BR>
But the problem is that
records are not<BR> generated the<BR>
way we<BR>
expect and the way
it works in normal forwarding<BR>
using<BR>
usr_preferences. For example call is
forwarded<BR> from one<BR>
user<BR>
to another, the first leg of the
call should be<BR> logged<BR>
as it<BR>
should normally be($fU in
leg source, $rU in leg<BR>
destination &<BR>
calltype=call) and in next cdr log, it
should<BR> log with<BR>
forwarding
details(Forwarding user in leg<BR> source,
forwarded<BR>
user in leg destination & calltype=cfwd). But
it<BR> actually<BR>
generates 5 records(1
failed invite, 2 ok<BR> invites & 2
byes,<BR>
instead of 2 invites & 2 byes) of the call.
Also<BR> as we set<BR>
calltype and leg
source in onreply route, it'll<BR> store
that<BR>
date for the first leg of the CDR which should<BR>
not happen.<BR><BR>
Is the same limitation is there
in OpenSIPS or<BR> it has<BR>
better<BR>
uac_redirect
module?<BR><BR>
I'll consider switching to OpenSIPS if it
solves<BR> this<BR>
issue.<BR><BR>
_______________________________________________<BR>
Users
mailing list<BR>
<A href="mailto:Users@lists.opensips.org"
target=_blank>Users@lists.opensips.org</A><BR>
<mailto:<A href="mailto:Users@lists.opensips.org"
target=_blank>Users@lists.opensips.org</A>><BR>
<mailto:<A
href="mailto:Users@lists.opensips.org"
target=_blank>Users@lists.opensips.org</A><BR>
<mailto:<A href="mailto:Users@lists.opensips.org"
target=_blank>Users@lists.opensips.org</A>>><BR>
<mailto:<A
href="mailto:Users@lists.opensips.org"
target=_blank>Users@lists.opensips.org</A><BR>
<mailto:<A href="mailto:Users@lists.opensips.org"
target=_blank>Users@lists.opensips.org</A>><BR>
<mailto:<A
href="mailto:Users@lists.opensips.org"
target=_blank>Users@lists.opensips.org</A><BR>
<mailto:<A href="mailto:Users@lists.opensips.org"
target=_blank>Users@lists.opensips.org</A>>>><BR><BR>
<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>
------------------------------------------------------------------------<BR><BR><BR><BR>
_______________________________________________<BR>
Users mailing list<BR>
<A href="mailto:Users@lists.opensips.org"
target=_blank>Users@lists.opensips.org</A><BR>
<mailto:<A href="mailto:Users@lists.opensips.org"
target=_blank>Users@lists.opensips.org</A>><BR>
<mailto:<A href="mailto:Users@lists.opensips.org"
target=_blank>Users@lists.opensips.org</A><BR>
<mailto:<A href="mailto:Users@lists.opensips.org"
target=_blank>Users@lists.opensips.org</A>>><BR>
<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><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>