<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.30.3">
</HEAD>
<BODY>
Yes, a decide to do a lua script for this task.<BR>
<BR>
What I'm doing is a group call that loops all the members until a global timeout is reached.<BR>
<BR>
Is the code:<BR>
<BR>
call_timeout = session:getVariable("call_timeout") or 60<BR>
timestamp_a = os.time()<BR>
-- while the call is not answered<BR>
while session:answered()==false do<BR>
-- dial the group<BR>
session:setVariable("call_timeout", call_timeout)<BR>
session:execute("bridge","\${group_call(<A HREF="mailto:two@commsmundi.com">two@default</A>+F)}")<BR>
<BR>
-- bridge state<BR>
if (session:ready() == false) then break end<BR>
if (session:hangupState()) then break end<BR>
<BR>
-- check global time, and remove the used amount of time already used in the call<BR>
timestamp_b = os.time()<BR>
sec = timestamp_b - timestamp_a<BR>
timestamp_a = timestamp_b<BR>
call_timeout = call_timeout - sec<BR>
if (call_timeout <= 0) then<BR>
session:setVariable("originate_disposition", "ALLOTTED_TIMEOUT")<BR>
debug.info("GROUP: CALL TIMEOUT!")<BR>
break<BR>
end<BR>
end<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
On Mon, 2011-10-17 at 13:12 -0700, Michael Collins wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
Did you figure this out yet? Not sure exactly what you're trying to do here, but you could use the sched_hangup API and schedule a hangup or sched_transfer to schedule a transfer to a specific dialplan extension that does your cleanup work.<BR>
<BR>
<BR>
<FONT SIZE="1"><action application="set" data="api_res=${sched_transfer +60 ${uuid} handle_timeout XML handlers}"/></FONT><BR>
<BR>
<BR>
Then something like this for the dp<BR>
<BR>
<BR>
<FONT SIZE="1"><context name="handlers"></FONT><BR>
<FONT SIZE="1"> <extension name="handle loop timeouts"></FONT><BR>
<BR>
<FONT SIZE="1"> <condition field="destination_number" expression="^handle_timeout$"></FONT><BR>
<FONT SIZE="1"> <action application="log" data="INFO OB call timed out..."/></FONT><BR>
<FONT SIZE="1"> <action application="foo" data="bar"/> <!-- do something useful --></FONT><BR>
<FONT SIZE="1"> <action application="hangup" data="pick_a_hangup_cause_if_you_wish"/></FONT><BR>
<FONT SIZE="1"> </condition></FONT><BR>
<FONT SIZE="1"> </extensions></FONT><BR>
<FONT SIZE="1"></context></FONT><BR>
<BR>
<BR>
-MC<BR>
<BR>
On Thu, Oct 13, 2011 at 10:09 AM, Antonio <<A HREF="mailto:asilva@wirelessmundi.com">asilva@wirelessmundi.com</A>> wrote:<BR>
<BLOCKQUOTE>
<BR>
Hi,<BR>
<BR>
Is it possible to loop a bridge until a global call timeout (or other variable) is reached?<BR>
<BR>
In the wiki is this example is a fixed number of loops...<BR>
<BR>
<extension name="3-way gateway distro">
<PRE>
<condition field="destination_number" expression="^(.*)$">
<action application="set" data="continue_on_fail=true"/>
<action application="set" data="hangup_after_bridge=true"/>
<action application="bridge" data="sofia/gateway/${distributor(3gw)}/$1" loop="3"/>
</condition>
</extension>
My idea is to call a group sequential, but once it reaches the last member it starts over again.
so when calling a group, once the timeout for each user in the group is reach it hangups the call (the normal behavior),
it jumps again to the begin of the group until a global timeout is reached.
For example:
<extension name="group">
<condition field="destination_number" expression="^(.*)$">
<action application="set" data="continue_on_fail=true"/>
<action application="set" data="hangup_after_bridge=true"/>
<action application="set" data="call_timeout=60"/>
<action application="set" data="leg_timeout=10"/>
<action application="bridge" data=""${group_call(group1@default+F)}" loop="3"/>
</condition>
</extension>
In my group i have two members only.
</PRE>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
--
Un cordial saludo / Best regards,
_________________________
António Silva
E-mail:<A HREF="mailto:asilva@wirelessmundi.com">asilva@wirelessmundi.com</A>
</PRE>
</TD>
</TR>
</TABLE>
<BR>
<BR>
FreeSWITCH-users mailing list<BR>
<A HREF="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</A><BR>
<A HREF="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A><BR>
UNSUBSCRIBE:<A HREF="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR>
<A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A><BR>
<BR>
</BLOCKQUOTE>
<BR>
<BR>
<PRE>
FreeSWITCH-users mailing list
<A HREF="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</A>
<A HREF="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A>
UNSUBSCRIBE:<A HREF="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</A>
<A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A>
</PRE>
</BLOCKQUOTE>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
--
Un cordial saludo / Best regards,
_________________________
António Silva
E-mail:<A HREF="mailto:asilva@wirelessmundi.com">asilva@wirelessmundi.com</A>
</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>