The only
solution for this which I found yet is:
#The only way to really check return code is to check it in onreply_route,
#then set flag which will permit failure_route to hunt this call again.
#You can't check status with t_check_status within failure_route,
#because t_check_status in failure_route returns the lowest value
#of all branches..
onreply_route[1] {
if(status=~"40[48]" || status=~"486") {
#not-so-fatal response, should hunt
setflag(2);
};
}
failure_route[1] {
if(isflagset(2)) {
resetflag(2);
if(avp_pushto("$ruri","$serial_fork")) {
#and then everytingh should work as in example.
You can use t_was_cancelled() in failure route:
http://openser.org/docs/modules/1.1.x/tm.html#AEN479 . It will ensure
that you get the proper status of canceled transactions.
But, this config is not yet complete - with this
configuration
CANCEL's does not hunt after 481 Call leg does not exists, so,
in situation when we need to cancel call on second or third number,
we're not able to do that :(
Just adding another code (481) to our list of not-so-fatal response
does nothing but returns us to initial problem, and the only
solution found is to complicate configuration again to:
#main post-routing code
route[1] {
if(method=="CANCEL") {
t_on_reply("2");
} else {
t_on_reply("1");
};
t_on_failure("1");
t_relay();
};
onreply_route[1] { #onreply for everyting but CANCEL
if(status=~"40[48]" || status=~"486") {
#not-so-fatal response, should hunt
setflag(2);
};
}
onreply_route[2] { #onreply for CANCEL's
if(status=~"481") {
#not-so-fatal response, should hunt
setflag(2);
};
}
failure_route[1] {
if(isflagset(2)) {
resetflag(2);
if(avp_pushto("$ruri","$serial_fork")) {
Please note, that config is in pre-production stage, tested, but
without really massive tests. Also, note that this is not complete
config, just parts to allow serial hunting without noted problem.
If anyone knows more elegant solution for my problem - please, let
me know. Also, if anyone can see a problem with my config - let me
know how to test it...
Could you try the latest version of OpenSER CVS, it is now in
frozen/testing phase, just to be release in a few weeks. Any feedback
will help to fix eventual issues. The part with reply code selections
and CANCEL processing was refurbished and should have fixed some old issues.
Cheers,
Daniel
> PS: another problem may arise with maximal number of branches.
> With default configuration of ser (config.h, #define MAX_BRANCHES 12)
> maximum number of hunts is limited to 11. If you need more hunts than
> this - you need to recompile ser.
>
>
>
>