Greger,
Thank you very much for your help! The documentation says only a few
types of actions are legal in failure_route blocks, and route()
commands are not listed among them. I'm happy to know that route()
commands are OK there though, since that makes some kinds of "retry"
strategies easy to program.
Tim
route can be called from failure_route. Just make sure
your function
is safe (i.e a failure_route will on a parallell fork be called
several times with different messages)
g-)
----- Original Message ----- From: "Tim Klein"
<tkpublic(a)timklein.fastmail.fm>
To: <serusers(a)lists.iptel.org>
Sent: Friday, October 21, 2005 01:12 AM
Subject: [Serusers] How to avoid calling route() in a failure_route block?
>I have an unusual need: If a contact in the usrloc database is
>unreachable for any reason, I must immediately delete it from the usrloc
>database. I know how to do the deletion, but I don't know the right way
>to write my configuration script.
>
>Below is the script that I want to write. But I think it won't work,
>because I think it's illegal for a failure_route block to call a route()
>command. (Am I correct about that?)
>
>Can anyone tell me what I should do instead of the following?
>
>Thank you in advance!
>
>Tim
>
>==============
>
>route {
>
> [...irrelevant stuff omitted...]
>
>if (method==INVITE) {
>route(1);
>}
>}
>
>route[1] {
> if (lookup("location")) {
> t_on_failure("99");
> t_relay();
> } else {
> t_reply("404","Not Found");
> }
>}
>
>failure_route[99] {
>delete_location_from_usrloc(); # I will write this function.
>route(1);
>}
>
>==============
>
>
>_______________________________________________
>Serusers mailing list
>serusers(a)lists.iptel.org
>http://lists.iptel.org/mailman/listinfo/serusers