[OpenSIPS-Users] DB Aliases and branches

Bogdan-Andrei Iancu bogdan at voice-system.ro
Mon Apr 26 13:40:53 CEST 2010


Hi Doug,

A simple solution will be to move all the branches into some AVPs that 
you can consume (one by one) in a failure route.

to move branches try:
    $var(i) = -1;
    while ( $(branch(uri)[$var(i)])!=NULL) {
        $avp(i:100) = $(branch(uri)[$var(i)]);
        $var(i) = $var(i) -1;
    }

Note that I'm iterating through the branches from end to head, as the 
AVPs work as a stack (first inserted value will be the last).

Regards,
Bogdan

Douglas Lane wrote:
> Hey guys,
>
> I'm using aliases for all my inbound calls to my users, but some of them 
> will have multiple users to a single alias. So after some digging 
> around, I cam across the following param:
>
> modparam("alias_db", "append_branches", 1)
>
> And it works, I see the branch being added to the transaction, however, 
> I'm not 100% sure on how to "loop" the callflow so that if the first 
> account is not available, then I copy the first branch over to the RURI 
> and shift all other branches left.
>
> This should happen till there are no more branches left, and the final 
> failover routing should apply where by I send the call to voicemail (or 
> something similar).
>
> I guess most of it I can do, just not sure how to loop through each 
> branch, copy it to the RURI (I can do this), remove the copied branch, 
> and then shift all other branches left (not sure if I would have to do 
> this if I remove the branch I've just copied to the RURI).
>
> Some guidance would be highly appreciated.
>
> Thanks
> Doug
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list