Jeremy,<br><br>My apologies for taking so long to reply. I was kicking around ways to do this. Comments inline.<br><br><div class="gmail_quote">On Tue, Oct 5, 2010 at 11:10 AM, Jeremy Stricker <span dir="ltr">&lt;<a href="mailto:jstricker@lightnex.com" target="_blank">jstricker@lightnex.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello all,<br>
<br>
Is there anyway to set a call timeout when a call is valet parked so<br>
that it will ring back to the extension that parked it if it isn&#39;t<br>
answered by the intended recipient?  We have an user who parks calls and<br>
then blindly announces the parking spot over an intercom.  With this<br>
setup there is a great risk of a caller getting stuck in park.  If there<br>
isn&#39;t a timeout method, can anyone recommend any alternate setup that<br>
would allow at least two parking spots with visual indication of calls<br>
parked on the handsets (Aastra 6730i and 6757i).<br></blockquote><div><br>I couldn&#39;t find a simple way to do this but the following method worked for me in a lab environment. Assume that 6100 is the park extension and 6101-6199 are the parking stalls. Add these &lt;condition&gt; blocks to the end of your &quot;global&quot; extension (it needs to be executed for every call):<br>
<br><font size="1"><span style="font-family: courier new,monospace;">      &lt;condition field=&quot;${ani}&quot; expression=&quot;^(10\d\d)$&quot;&gt; &lt;!-- include only &#39;parker&#39; extensions --&gt;</span><br style="font-family: courier new,monospace;">

  <span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;"></span></font><font size="1"><span style="font-family: courier new,monospace;">      &lt;condition field=&quot;destination_number&quot; expression=&quot;^(6100)$&quot;&gt;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">        &lt;anti-action application=&quot;hash&quot; data=&quot;insert/valet_recall/${destination_number}/${uuid}&quot;/&gt;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      &lt;/condition&gt;</span></font><br style="font-family: courier new,monospace;"><br>Then create the valet_park extensions:<br><br><font size="1"><span style="font-family: courier new,monospace;">    &lt;extension name=&quot;valet_park_retrieve&quot;&gt;  </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      &lt;condition field=&quot;destination_number&quot; expression=&quot;^(61\d[1-9])$&quot;&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        &lt;action application=&quot;answer&quot;/&gt;<br>
        &lt;action application=&quot;lua&quot; data=&quot;cancel_valet_recall.lua valet_lot $1&quot;/&gt;<br style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">        &lt;action application=&quot;valet_park&quot; data=&quot;valet_lot $1&quot;/&gt;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">      &lt;/condition&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    &lt;/extension&gt;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    &lt;extension 
name=&quot;valet_park_with_recall_timer&quot;&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
      &lt;condition field=&quot;destination_number&quot; expression=&quot;^(6100)$&quot;&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
        &lt;action application=&quot;answer&quot;/&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        &lt;action application=&quot;set&quot; data=&quot;valet_uuid=${hash(select/valet_recall/${caller_id_number})}&quot;/&gt;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        &lt;action application=&quot;log&quot; data=&quot;INFO Pulled [${valet_uuid}] from hash valet_recall/${caller_id_number}&quot;/&gt;<br>        &lt;!-- the magic happens on the next line. The +30 means 30 seconds later x-fer the call back to the parker --&gt;<br style="font-family: courier new,monospace;">
</span><span style="font-family: courier new,monospace;">        &lt;action application=&quot;set&quot; data=&quot;api_res=${sched_api +30 uuid_transfer ${valet_uuid} ${valet_uuid} ${ani}}&quot;/&gt; </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        &lt;action application=&quot;valet_park&quot; data=&quot;valet_lot auto in 6101 6199&quot;/&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
</span><span style="font-family: courier new,monospace;">      &lt;/condition&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
    &lt;/extension&gt;</span></font><br>
<br>The trick is to use &quot;sched_api&quot; API to schedule the other leg to be transferred back to the parker. We use the hash API to store some information, namely the parker&#39;s extension number and the uuid of the parked leg. Change the +30 to however many seconds you want the call to be parked before recalling. Here&#39;s the catch: if someone does come along and grab that call out of the parking stall then we need to remove the scheduled transfer! I thought a Lua script would be the easiest way to handle that, so when the person picking up the parked call dials 6001 e.g. then it launches a quickie Lua script that removes the sched_api from the task list. Here&#39;s the Lua script:<br>
<br><font size="1"><span style="font-family: courier new,monospace;">-- cancel_valet_recall.lua</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-- </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">-- parse the valet lot in question and find the uuid for the extension</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-- remove the uuid from the sched task list since this call is now being unparked</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">--</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                                                                                                                                                                </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">valet_lot = argv[1]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">valet_ext = argv[2]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">uuid      = session:getVariable(&#39;uuid&#39;) </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                                                                                                                                                                </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">--freeswitch.consoleLog(&#39;INFO&#39;,&#39;Lot: &#39; .. valet_lot .. &#39; , Ext: &#39; .. valet_ext .. &#39; , uuid: &#39; .. uuid .. &quot;\n&quot;)</span><span style="font-family: courier new,monospace;"><br>
                                                                                                                                                                </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">api = freeswitch.API()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">                                                                                                                                                                </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">if ( valet_lot == nil and valet_ext == nil ) then</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    -- improper args... (feel free to do some better error handling)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">else</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    -- sched_del uuid for the uuid in valet_lot, valet_ext</span><span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    valet_info = api:executeString(&#39;valet_info &#39; .. valet_lot)<br></span><span style="font-family: courier new,monospace;">    -- freeswitch.consoleLog(&quot;INFO&quot;,&quot;\n&quot; .. valet_info .. &quot;\n\n&quot;)<br>
</span><span style="font-family: courier new,monospace;">                                                                                                                                                          </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    valet_data = string.match(valet_info,&quot;&lt;extension uuid=.-&gt;&quot; .. valet_ext .. &quot;&lt;/extension&gt;&quot;)<br></span><span style="font-family: courier new,monospace;">    -- freeswitch.consoleLog(&quot;INFO&quot;,&quot;uuid data line is: &quot; .. valet_data .. &quot;\n\n&quot;)<br>
</span><span style="font-family: courier new,monospace;">                                                                                                                                                                </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    valet_uuid = string.gsub(valet_data,&#39;&lt;extension uuid=&quot;(.-)&quot;&gt;&#39; .. valet_ext .. &quot;&lt;/extension&gt;&quot;,&quot;%1&quot;)<br></span><span style="font-family: courier new,monospace;">    --freeswitch.consoleLog(&quot;INFO&quot;,&quot;valet uuid is: &quot; .. valet_uuid .. &quot;\n\n&quot;)<br>
</span><span style="font-family: courier new,monospace;">                                                                                                                                                                </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    -- perform the sched_del<br></span><span style="font-family: courier new,monospace;">    api_res = api:executeString(&#39;sched_del &#39; .. valet_uuid)<br></span><span style="font-family: courier new,monospace;">    --freeswitch.consoleLog(&quot;INFO&quot;,&quot;result of sched_del &quot; .. valet_uuid .. &quot; is &quot; .. api_res .. &quot;\n\n&quot;)<br>
</span><span style="font-family: courier new,monospace;">end    </span></font><br><br>Throw this into conf/scripts/cancel_valet_recall.lua and give it a shot. Let me know how it goes. If it works and if no one has any obvious improvements then I will toss it up on the wiki as an example of how to do a valet_park recall timer. <br>
<br>If you want to learn more about how this works then uncomment the log statements in the Lua script. Also after parking but before picking up the call go to the fs_cli and do &quot;show tasks&quot; and you&#39;ll see what the task looks like. I used the parked leg&#39;s uuid as the &#39;group id&#39; in sched_api so that it is easy to find and remove when unparking the call.<br>
<br>Have fun and let me know if this helps or not.<br>-MC<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Secondly, is there anyway to stop read-back of the parking spot on the<br>
parkee&#39;s side of the call?  Currently, the parker performs an attended<br>
transfer, waits for and hears the spot read-back.  The parkee hears MOH<br>
while the transfer is being performed, but then the spot announcement<br>
themselves as soon as the parker finishes the attended transfer by<br>
hanging up.<br></blockquote><div><br>The parker is hanging up too soon. If he/she waits until he/she hears music and then completes the transfer it should be okay. I just tested this.<br>-MC<br>
</div></div><br>