Forking accounting

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Forking accounting

ibrahim tunali-2
Hello,

I am dealing with branch routing and multiple leg accounting. I would like to forward call to several PSTN destinations. I want to account the certainly which one get the call

I set destination leg avp with below;

branch_route[1]{
     $avp(s:dst_leg)=$rU;
}

The Avp has a few values with branch request username so final response will create a few Acc rows.

I need to know the winning branch's request username and delete the rest values of dst_leg avp. Please give me an advise how to handle accounting at forking.

Another question; When acc records insert to DB for INVITE request, before or after on_reply_route ?

Best Regards,

Ibrahim TUNALI


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Forking accounting

Bogdan-Andrei Iancu
Hi ibrahim,

For paralel forking you do not need multi-leg accounting.  TM will
select the wining branch (the one that picked up) and acc will use for
accounting the wining branch. So you do not have to do anything about this.

Regards,
Bogdan

ibrahim tunali wrote:

> Hello,
>
> I am dealing with branch routing and multiple leg accounting. I would
> like to forward call to several PSTN destinations. I want to account
> the certainly which one get the call
>
> I set destination leg avp with below;
>
> branch_route[1]{
>      $avp(s:dst_leg)=$rU;
> }
>
> The Avp has a few values with branch request username so final
> response will create a few Acc rows.
>
> I need to know the winning branch's request username and delete the
> rest values of dst_leg avp. Please give me an advise how to handle
> accounting at forking.
>
> Another question; When acc records insert to DB for INVITE request,
> before or after on_reply_route ?
>
> Best Regards,
>
> Ibrahim TUNALI
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Forking accounting

itunali
Hi Bogdan,

I have to use multileg accounting because my application records all
request leg to acc. I use mentioned issue for this scenario;

1. DID call come to my opensips and it add to multileg.
$avp(s:src_leg)=$fU; $avp(s:dst_leg)=$rU;
2. The user owner of the DID was set callforwarding to a few pstn destination.
3. I load these destinations to branch with "avp_pushto("$ru","$avp(s:fwd)/g");"
4. I had set dst_leg from on branch route;
branch_route[1]{
    $avp(s:dst_leg)=$rU;
}

I need to see only wining branch call in acc;

Method   src_leg        dst_leg
----------    ----------        -----------
INVITE    1925XXXXXX 1212XXXXXXXX (DID num)
INVITE    111              1707XXXXXXXX (CallFwd wining branch)

But i see;

Method   src_leg        dst_leg
----------    ----------        -----------
INVITE    1925XXXXXX 1212XXXXXXXX (DID num)
INVITE    111              1707XXXXXXXX (CallFwd branch1)
INVITE    111              1707AAAAAA (CallFwd branch2)
INVITE    111              1707BBBBBB (CallFwd branch3)

Best Regards,
Ibrahim TUNALI




On Thu, Feb 12, 2009 at 17:01, Bogdan-Andrei Iancu
<[hidden email]> wrote:

>
> Hi ibrahim,
>
> For paralel forking you do not need multi-leg accounting.  TM will select the wining branch (the one that picked up) and acc will use for accounting the wining branch. So you do not have to do anything about this.
>
> Regards,
> Bogdan
>
> ibrahim tunali wrote:
>>
>> Hello,
>>
>> I am dealing with branch routing and multiple leg accounting. I would like to forward call to several PSTN destinations. I want to account the certainly which one get the call
>>
>> I set destination leg avp with below;
>>
>> branch_route[1]{
>>     $avp(s:dst_leg)=$rU;
>> }
>>
>> The Avp has a few values with branch request username so final response will create a few Acc rows.
>>
>> I need to know the winning branch's request username and delete the rest values of dst_leg avp. Please give me an advise how to handle accounting at forking.
>>
>> Another question; When acc records insert to DB for INVITE request, before or after on_reply_route ?
>>
>> Best Regards,
>>
>> Ibrahim TUNALI
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Forking accounting

Bogdan-Andrei Iancu
Hi Ibrahim,

For the second leg (from DID to FWD number) the problem seams to be
setting the destination part, because of the multi destination. The
error is you push all the destinations into dst_leg AVP - note that AVPs
are per transaction and not per branch!

What you can do is to set the dst_leg AVP when the call is completed and
you know what is the final destination. Use on reply route to set the
final dst_leg:

onreply_route{
    if (t_check_code("2[0-9][0-9]")) {
          $avp(s:dst_leg)= $T_ruri;
    }
}

NOTE this will work only with 1.5 ; see
http://www.opensips.org/html/docs/modules/devel/tm.html#id268019 for $T_ruri

Also, because you use AVPs in onreply route, enable this in TM: set
onreply_avp_mode  to 1:
    http://www.opensips.org/html/docs/modules/devel/tm.html#id266762

Regards,
Bogdan
   


ibrahim tunali wrote:

> Hi Bogdan,
>
> I have to use multileg accounting because my application records all
> request leg to acc. I use mentioned issue for this scenario;
>
> 1. DID call come to my opensips and it add to multileg.
> $avp(s:src_leg)=$fU; $avp(s:dst_leg)=$rU;
> 2. The user owner of the DID was set callforwarding to a few pstn destination.
> 3. I load these destinations to branch with "avp_pushto("$ru","$avp(s:fwd)/g");"
> 4. I had set dst_leg from on branch route;
> branch_route[1]{
>     $avp(s:dst_leg)=$rU;
> }
>
> I need to see only wining branch call in acc;
>
> Method   src_leg        dst_leg
> ----------    ----------        -----------
> INVITE    1925XXXXXX 1212XXXXXXXX (DID num)
> INVITE    111              1707XXXXXXXX (CallFwd wining branch)
>
> But i see;
>
> Method   src_leg        dst_leg
> ----------    ----------        -----------
> INVITE    1925XXXXXX 1212XXXXXXXX (DID num)
> INVITE    111              1707XXXXXXXX (CallFwd branch1)
> INVITE    111              1707AAAAAA (CallFwd branch2)
> INVITE    111              1707BBBBBB (CallFwd branch3)
>
> Best Regards,
> Ibrahim TUNALI
>
>
>
>
> On Thu, Feb 12, 2009 at 17:01, Bogdan-Andrei Iancu
> <[hidden email]> wrote:
>  
>> Hi ibrahim,
>>
>> For paralel forking you do not need multi-leg accounting.  TM will select the wining branch (the one that picked up) and acc will use for accounting the wining branch. So you do not have to do anything about this.
>>
>> Regards,
>> Bogdan
>>
>> ibrahim tunali wrote:
>>    
>>> Hello,
>>>
>>> I am dealing with branch routing and multiple leg accounting. I would like to forward call to several PSTN destinations. I want to account the certainly which one get the call
>>>
>>> I set destination leg avp with below;
>>>
>>> branch_route[1]{
>>>     $avp(s:dst_leg)=$rU;
>>> }
>>>
>>> The Avp has a few values with branch request username so final response will create a few Acc rows.
>>>
>>> I need to know the winning branch's request username and delete the rest values of dst_leg avp. Please give me an advise how to handle accounting at forking.
>>>
>>> Another question; When acc records insert to DB for INVITE request, before or after on_reply_route ?
>>>
>>> Best Regards,
>>>
>>> Ibrahim TUNALI
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Users mailing list
>>> [hidden email]
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>      
>
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users