Hi,
Puh, it's been a while since I wrote that, so let me think :) As far as I remember, the idea was to extract the first branch and push it into R-URI, then jump somewhere into the route sections where quite some R-URI manipulation and checking is done (and most of the functions can only operate on r-uri, so...)... after that, the ruri is again appended as branch before sending it out. Only problem is that you can only use one destination.
Bogdan, what exactly do you mean by "if it does append_branch somewhere later, it will just duplicate a branch"?
Cheers, Andreas
Bogdan-Andrei Iancu wrote:
Hi Zahid,
To be honest, I do not see the purpose of this:
# get last URI from destination-set and set it as R-URI avp_delete("$avp(s:tmp)/g"); $avp(s:tmp) = $ds; avp_subst("$avp(s:tmp)", "/.*(sip:.+@[^:;>]+).*$/\1/"); avp_pushto("$ru", "$avp(s:tmp)");
This code fetches the first branch (by using the $ds pv and the regexp) and push it as RURI; but if there is no following append_branch(), it has 0 effect. And if it does append_branch somewhere later, it will just duplicate a branch....
Maybe Andreas (here CCed) can give you some details on this.....
Regards, Bogdan
Zahid Mehmood wrote:
Hi, If get_redirect() is already pushing the contacts as branches, then what is the purpose / benefit / drawback of doing something like this:
taken from sipwise online config:
if(!get_redirects("1:1")) { xlog("L_ERROR", "Failed to fetch contact '$ct' from
301/302 - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n"); acc_db_request("480", "acc"); t_reply("480", "Temporarily Unavailable"); exit; } # get last URI from destination-set and set it as R-URI avp_delete("$avp(s:tmp)/g"); $avp(s:tmp) = $ds; avp_subst("$avp(s:tmp)", "/.*(sip:.+@[^:;>]+).*$/\1/"); avp_pushto("$ru", "$avp(s:tmp)");
I'd greatly appreciate your answers as they will help me better understand the use of branches/destination set.
Thanks.