Propagate the final errors back to the channel doing overlapped dialing.

git-svn-id: http://voip.null.ro/svn/yate@4039 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2011-01-19 10:14:09 +00:00
parent f936d07e75
commit 4df6bf1b6f
1 changed files with 3 additions and 1 deletions

View File

@ -246,10 +246,12 @@ function endRoute($callto,$ok,$err,$params)
}
if ($final) {
Yate::Output("Overlapped got final error '$err' for '$collect'");
Yate::SetLocal("reason",$err);
setState("");
}
else if ($err != "incomplete") {
Yate::Output("Overlapped got error '$err' for '$collect'");
Yate::SetLocal("reason",$err);
setState("");
$final = true;
}
@ -333,7 +335,7 @@ while ($state != "") {
break;
case "answer":
if ($ev->name == "call.route")
endRoute($ev->retval,$ev->handled,$ev->GetValue("error"),$ev->params);
endRoute($ev->retval,$ev->handled,$ev->GetValue("error","noroute"),$ev->params);
break;
}
}