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@timklein.fastmail.fm To: serusers@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@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers