<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 22, 2014 at 10:46 AM, Tim Chubb <span dir="ltr"><<a href="mailto:tim.chubb@voicesimplified.com" target="_blank">tim.chubb@voicesimplified.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div link="#0563C1" vlink="#954F72" lang="EN-GB">
<br><div>
<p class="MsoNormal">Hi<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I was wondering if the following scenario is possible and if it is how I would go about implementing it:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I would like to be able read from a database a list of destinations associated with a given dialled number which are tried in order of priority with each destination having a user definable ring duration before the next destination is tried.<u></u><u></u></p>
<p class="MsoNormal">i.e. <u></u><u></u></p>
<p class="MsoNormal">A Call is received from the PSTN, the number the caller dialled is looked up, it has 3 destinations attached to it, the users deskphone which is configured to ring for 10 seconds before the call is forwarded to their Mobile phone with a
 ring duration of 15 seconds, which if unanswered would be redirected to the main switchboard IVR.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I think im looking for the equivalent of the Asterisk Dial app, where you can specify a timeout as an argument, is this possible to do with kamailio?  All examples I have seen use a global timer value, which is unsuitable for this requirement,
 as each user could define n failover routes each with a distinct timeout before the next route is tried.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Currently I have got as far as querying the database to retrieve the data but im a bit stumped as to how to handle the timeout variable.<u></u><u></u></p>
</div></div></blockquote><div><br></div><div>Set fr_inv_timer_avp module parameter:<br><br></div><div>    modparam("tm", "fr_inv_timer_avp", "$avp(my_fr_inv_timer)")<br></div><div><br></div><div>Then put your database value into the avp. Tm module will time out after that many milliseconds and call your failure_route, where you can try the next destination or generate an error.<br><br><a href="http://kamailio.org/docs/modules/4.1.x/modules/tm.html#fr_inv_timer_avp">http://kamailio.org/docs/modules/4.1.x/modules/tm.html#fr_inv_timer_avp</a><br><br></div><div>Corey<br><br></div><div><br></div></div></div></div>