<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">Less repetition:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"> <extension name="DDI_9600"></div><div style="font-family:arial,sans-serif;font-size:13px"> <condition field="destination_number" expression="^441614249600$"></div><div style="font-family:arial,sans-serif;font-size:13px"> <span style="color:rgb(80,0,80)"> <action application="set" data="domain_name=$${domain}"/</span><span style="color:rgb(80,0,80)">></span></div><div style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"> <action application="set" data="effective_caller_id_name=${cidlookup(${caller_id_number})}"/></div><div style="font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80)"> </span><span style="color:rgb(80,0,80)"> </span> </condition></div><div style="font-family:arial,sans-serif;font-size:13px"> <condition field="${office_status}" expression="^open$"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(80,0,80)"> </span><span style="color:rgb(80,0,80)"> </span><span style="color:rgb(80,0,80)"> <action application="ivr" data="bashton_9600_open"/></span></div><div style="font-family:arial,sans-serif;font-size:13px"> <anti-action application="ivr" data="bashton_9600_closed"/></div><div style="font-family:arial,sans-serif;font-size:13px"> </condition><br></div><div style="font-family:arial,sans-serif;font-size:13px"> </extension></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">In fact then you could even</div><div style="font-family:arial,sans-serif;font-size:13px"><div><span style="color:rgb(80,0,80)"> <action application="ivr" data="bashton_9600_${office_status}"/></span><br></div><div>and you don't need the 2nd condition at all then.</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 16 October 2014 12:58, Steven Ayre <span dir="ltr"><<a href="mailto:steveayre@gmail.com" target="_blank">steveayre@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">You have recursion.<div><br></div><div>expression is a regular expression. You need ^ and $ to match the start and end of the string, without them it'll match the expression appearing anywhere in the string. As a result...</div><div><span class=""><div><br></div><div><div style="font-family:arial,sans-serif;font-size:13px"> <extension name="DDI_9600" continue="true"></div><div style="font-family:arial,sans-serif;font-size:13px"> <condition field="destination_number" expression="441614249600"></div><div style="font-family:arial,sans-serif;font-size:13px"> <action application="execute_extension" data="441614249600_${office_status}"/></div><div style="font-family:arial,sans-serif;font-size:13px"> </condition></div><div style="font-family:arial,sans-serif;font-size:13px"> </extension></div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div></span><div style="font-family:arial,sans-serif;font-size:13px">This executes itself again and again and again... it never reaches the next extension.</div></div><div style="font-family:arial,sans-serif;font-size:13px"><div><br></div><div>These conditions would avoid the issue:</div><div> <condition field="destination_number" expression="^441614249600$"></div><div> <condition field="destination_number" expression="^441614249600_open$"></div><div> <condition field="destination_number" expression="^441614249600_closed$"></div><div><br></div></div><div style="font-family:arial,sans-serif;font-size:13px">As an alternative implementation you could also do this in a single extension:</div><div style="font-family:arial,sans-serif;font-size:13px"><div> <extension name="DDI_9600"></div><div> <condition field="destination_number" expression="^441614249600$"/></div><div> <condition field="${office_status}" expression="^open$"></div><div> <!-- open --></div><span class=""><div> <action application="set" data="domain_name=$${domain}"/></div><div> <action application="set" data="effective_caller_id_name=${cidlookup(${caller_id_number})}"/></div><div> <action application="ivr" data="bashton_9600_open"/></div></span><div> <!-- closed --></div><div> <anti-action application="set" data="domain_name=$${domain}"/><br></div><div> <anti-action application="set" data="effective_caller_id_name=${cidlookup(${caller_id_number})}"/></div><div> <anti-action application="ivr" data="bashton_9600_closed"/></div><div> </condition><br></div><div> </extension></div><div><br></div><div>Note this only works because you're setting inline="true" when setting ${office_status}.</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On 16 October 2014 09:09, Gavin Hamill <span dir="ltr"><<a href="mailto:gavin@bashton.com" target="_blank">gavin@bashton.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Hi all,</div><div><br></div><div>I'm using FS 1.4.12 on CentOS 6.5 and I think I'm running into an issue with 'dialplan parsed all at once' when trying to implement the example based on </div><div><a href="https://wiki.freeswitch.org/wiki/Time_of_Day_Routing#Example_for_office_open_09:00-16:00" target="_blank">https://wiki.freeswitch.org/wiki/Time_of_Day_Routing#Example_for_office_open_09:00-16:00</a> :<br></div><div><br></div><div>When I dial our main '9600' external DID, the call is answered and routed exactly as I want, however, there is a lot of ugly logging going on and I suspect that the desired behaviour is by chance rather than design. I'd love to hear some feedback on how to best implement the logic of 'Office open Mon-Fri 8am-6pm':</div><div><br></div><div> </div><div>2014-10-16 08:49:48.515467 [NOTICE] switch_channel.c:1055 New Channel sofia/external/<a href="mailto:nobody@87.238.73.162" target="_blank">nobody@87.238.73.162</a> [ee5fb654-31c0-4c89-977e-b85ad4a0cb23]</div><div>2014-10-16 08:49:48.515467 [NOTICE] switch_core_session.c:2987 Execute execute_extension(441614249600_${office_status})</div><div>2014-10-16 08:49:48.515467 [NOTICE] switch_core_session.c:2987 Execute execute_extension(441614249600_${office_status})<br></div><div>[.. 17 times in total...]</div><div>2014-10-16 08:49:48.515467 [NOTICE] switch_core_session.c:2987 Execute execute_extension(441614249600_${office_status})</div><div>2014-10-16 08:49:48.515467 [ERR] switch_core_session.c:2918 Error sofia/external/<a href="mailto:nobody@87.238.73.162" target="_blank">nobody@87.238.73.162</a> too many stacked extensions</div><div>2014-10-16 08:49:48.515467 [NOTICE] switch_core_session.c:2987 Execute set(domain_name=<a href="http://freeswitch.bashton.eu" target="_blank">freeswitch.bashton.eu</a>)</div><div>2014-10-16 08:49:48.515467 [NOTICE] switch_core_session.c:2987 Execute set(effective_caller_id_name=${cidlookup(${caller_id_number})})</div><div>2014-10-16 08:49:48.515467 [NOTICE] switch_core_session.c:2987 Execute ivr(bashton_9600_open)</div><div>2014-10-16 08:49:48.515467 [NOTICE] mod_sofia.c:2243 Pre-Answer sofia/external/<a href="mailto:nobody@87.238.73.162" target="_blank">nobody@87.238.73.162</a>!</div><div><br></div><div><div> <extension name="are_we_open" continue="true"></div><div> <condition wday="2-6" hour="8-18" break="never"></div><div> <action application="set" data="office_status=open" inline="true"/></div><div> <anti-action application="set" data="office_status=closed" inline="true"/></div><div> </condition></div><div> </extension></div><div><br></div><div> <extension name="DDI_9600" continue="true"></div><div> <condition field="destination_number" expression="441614249600"></div><div> <action application="execute_extension" data="441614249600_${office_status}"/></div><div> </condition></div><div> </extension></div><div><br></div><div> <extension name="DDI_9600_open"></div><div> <condition field="destination_number" expression="441614249600_open"></div><div> <action application="set" data="domain_name=$${domain}"/></div><div> <action application="set" data="effective_caller_id_name=${cidlookup(${caller_id_number})}"/></div><div> <action application="ivr" data="bashton_9600_open"/></div><div> </condition><br></div><div> </extension></div><div><br></div><div> <extension name="DDI_9600_closed"></div><div> <condition field="destination_number" expression="441614249600_closed"></div><div> <action application="set" data="domain_name=$${domain}"/></div><div> <action application="set" data="effective_caller_id_name=${cidlookup(${caller_id_number})}"/></div><div> <action application="ivr" data="bashton_9600_closed"/></div><div> </condition><br></div><div> </extension></div><div><br></div></div><div>Suggestions would be most welcome! :)</div><div><br></div><div>Cheers,</div><div>Gavin.</div><div><br></div><div><br></div></div>
<br></div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div>
</blockquote></div><br></div>