* Calculate timeout for Follow-me
Need to calculate the timeout for Enterprise RG members that have extensions with follow-me.
The RG timeout should always take precedence over a follow-me timeout value. What we do is take the delay of the follow-me destination and subtract that from the ring group timeout to give us the total timeout of the destination.
Example:
RG 1: x1000 (Delay=0, Timeout=10)
RG 2: x2000 (Delay=10, Timeout=10)
x2000 has follow-me enabled
FM 1: x2000 (Delay=0, Timeout=15)
FM 2: x3000 (Delay=5, Timeout=20)
In this example we would want x2000 ring for 10 seconds and x3000 to ring for 5 seconds.
What if we changed this... FM 2: x3000 (Delay 15, Timeout=20)
In this example we wouldn't want x3000 to ring at all because it would start to ring after the RG timeout has expired. Our calculated value would be a negative value, -5. These negative values don't work as leg_timeouts in the dialstring, so we need to test for them.
* Update index.lua
* Update index.lua
This is related to 9dcaddd814 (diff-b1f5588538149bd825603176ff81d714).
For internal calls the delay needs to be "Delay In Seconds * 500".
For external calls the delay needs to be "Delay In Seconds * 10000".
For external calls I'm am just doubling the value set prior in the script.
We need to make sure that the delay for the leg takes into account the delay from the RG and from Follow-me.
Also, let's use the timeout from the RG instead of the follow-me member
I believe that call_timeout from the original destination should be unset, so that call_timeouts of the various follow-me destinations can work properly.