<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi all,<br>
<br>
I'm trying to do a serial call forwarding<br>
if callees don't answer.<br>
<br>
I've added a field in a table which is the number<br>
the users want to forward the call if they don't answer.<br>
<br>
I've a shell script (myScript.sh) which works like that:<br>
&nbsp;&nbsp;&nbsp; If the forward mode is activated for the user,&nbsp; <br>
&nbsp;&nbsp;&nbsp; then the address is overwritten and the script returns 0, <br>
&nbsp;&nbsp;&nbsp; else it returns 1.<br>
<br>
<br>
My main route ends by "t_on_failure("1");" in my ser.cfg,<br>
and I've write these&nbsp; lines after the main route:<br>
<br>
<i>failure_route[1]<br>
{<br>
&nbsp;&nbsp;&nbsp; if (exec_dset("/path/to/myscript/myScript.sh \"$SIP_HF_TO\""));<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; route(2);<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; break;<br>
}<br>
<br>
route[2]<br>
{<br>
&nbsp;&nbsp;&nbsp; sl_send_reply("300","Redirect");<br>
&nbsp;&nbsp;&nbsp; break;<br>
}<br>
</i><br>
I also use the tm module and I've set the fr_inv_timer and the fr_timer
to the values I wanted.<br>
<br>
<br>
In my configuration :<br>
&nbsp;&nbsp;&nbsp; User 1 wants to forward the call to User 2.<br>
&nbsp;&nbsp;&nbsp; User 2 wants to forward the call to User 3.<br>
&nbsp;&nbsp;&nbsp; User 3 wants to forward the call to User 1.<br>
<br>
When User 4 calls User 1, who doesn't answer, the call is well
forwarded to User 2 after <br>
5 ringings. User 2 doesn't answer and the call is well forwarded to
User 3 . Etc.<br>
<br>
So it works fine, if at least one of the callee answers. <br>
<br>
But if the caller hangs up (sending a CANCEL to the callee), the
phones&nbsp; are always ringing and forwarding<br>
the call in the same order.<br>
<br>
Does anybody have an idea to solve this problem?<br>
<br>
Thanks.<br>
<br>
B.R.<br>
Xavier.<br>
</body>
</html>