I want to simulate the Asterisk dial(x:y:z) app where (x=total call time, y=warning time, z=warning interval) in Freeswitch. I know it can be done with sched_hangup and sched_broadcast, my question is how can I call a series of "api_on_answer" comands to do it?
You can do multiple api_on_answer calls by using a relatively new syntax: api_on_answer_1=api(arg),api_on_answer_2=api2(arg2),api_on_answer_3=api3(arg3) Same syntax applies to the execute_on_xxx variables. -MC On Wed, Aug 17, 2011 at 12:33 AM, Sam <lakersman2006@yahoo.com> wrote:
I want to simulate the Asterisk dial(x:y:z) app where (x=total call time, y=warning time, z=warning interval) in Freeswitch. I know it can be done with sched_hangup and sched_broadcast, my question is how can I call a series of "api_on_answer" comands to do it?
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
MC, I tried the syntax you suggested but I does not seem to be working <action application="export" data="nolocal:api_on_answer_1=sched_broadcast(+1 ${uuid} playback::sound1.wav aleg), nolocal:api_on_answer_2=sched_hangup(+30 ${uuid})"/> I also tried this syntax and still no luck <action application="export" data="api_on_answer_1=sched_broadcast +1 ${uuid} playback::sound1.wav"/> <action application="export" data="api_on_answer_2=sched_hangup +15 ${uuid}"/> ________________________________ From: Michael Collins <msc@freeswitch.org> To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> Sent: Wednesday, August 17, 2011 3:05 PM Subject: Re: [Freeswitch-users] Simulating Asterisk dial(x:y:z) You can do multiple api_on_answer calls by using a relatively new syntax: api_on_answer_1=api(arg),api_on_answer_2=api2(arg2),api_on_answer_3=api3(arg3) Same syntax applies to the execute_on_xxx variables. -MC On Wed, Aug 17, 2011 at 12:33 AM, Sam <lakersman2006@yahoo.com> wrote: I want to simulate the Asterisk dial(x:y:z) app where (x=total call time, y=warning time, z=warning interval) in Freeswitch. I know it can be done with sched_hangup and sched_broadcast, my question is how can I call a series of "api_on_answer" comands to do it?
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Hmmm, I wonder if the multiple syntax only made it into the execute_on_xxx vars. I'll ask Brian about that. In the meantime it is possible to use execute_on_answer and execute an extension that in turn does all these API calls on your channel: <action application="export" data="nolocal:execute_on_answer=execute_extension do_stuff XML custom_context"/> Then have a simple context. Add file conf/dialplan/custom.xml: <include> <context name="custom_context"> <extension name="do my stuff"> <condition field="destination_number" expression="^do_stuff$"> <action application="set" data="res1=${sched_broadcast(+1 ${uuid} playback::sound1.wav aleg)}"/> <action application="set" data="res2=${sched_hangup(+30 ${uuid})}"/> </condition> </extension> </context> </include> You can try that one for kicks while we research the api_on_answer question. -MC On Wed, Aug 17, 2011 at 4:39 PM, Sam <lakersman2006@yahoo.com> wrote:
MC,
I tried the syntax you suggested but I does not seem to be working
<action application="export" data="nolocal:api_on_answer_1=sched_broadcast(+1 ${uuid} playback::sound1.wav aleg), nolocal:api_on_answer_2=sched_hangup(+30 ${uuid})"/>
I also tried this syntax and still no luck
<action application="export" data="api_on_answer_1=sched_broadcast +1 ${uuid} playback::sound1.wav"/> <action application="export" data="api_on_answer_2=sched_hangup +15 ${uuid}"/>
------------------------------ *From:* Michael Collins <msc@freeswitch.org> *To:* FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> *Sent:* Wednesday, August 17, 2011 3:05 PM *Subject:* Re: [Freeswitch-users] Simulating Asterisk dial(x:y:z)
You can do multiple api_on_answer calls by using a relatively new syntax:
api_on_answer_1=api(arg),api_on_answer_2=api2(arg2),api_on_answer_3=api3(arg3)
Same syntax applies to the execute_on_xxx variables.
-MC
On Wed, Aug 17, 2011 at 12:33 AM, Sam <lakersman2006@yahoo.com> wrote:
I want to simulate the Asterisk dial(x:y:z) app where (x=total call time, y=warning time, z=warning interval) in Freeswitch. I know it can be done with sched_hangup and sched_broadcast, my question is how can I call a series of "api_on_answer" comands to do it?
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
latest git all of the above should work including pushing many vars into execute_on_answer/api_on_answer referenced as an array. On Wed, Aug 17, 2011 at 7:11 PM, Michael Collins <msc@freeswitch.org> wrote:
Hmmm, I wonder if the multiple syntax only made it into the execute_on_xxx vars. I'll ask Brian about that. In the meantime it is possible to use execute_on_answer and execute an extension that in turn does all these API calls on your channel: <action application="export" data="nolocal:execute_on_answer=execute_extension do_stuff XML custom_context"/> Then have a simple context. Add file conf/dialplan/custom.xml: <include> <context name="custom_context"> <extension name="do my stuff"> <condition field="destination_number" expression="^do_stuff$"> <action application="set" data="res1=${sched_broadcast(+1 ${uuid} playback::sound1.wav aleg)}"/> <action application="set" data="res2=${sched_hangup(+30 ${uuid})}"/> </condition> </extension> </context> </include> You can try that one for kicks while we research the api_on_answer question. -MC
On Wed, Aug 17, 2011 at 4:39 PM, Sam <lakersman2006@yahoo.com> wrote:
MC, I tried the syntax you suggested but I does not seem to be working <action application="export" data="nolocal:api_on_answer_1=sched_broadcast(+1 ${uuid} playback::sound1.wav aleg), nolocal:api_on_answer_2=sched_hangup(+30 ${uuid})"/>
I also tried this syntax and still no luck <action application="export" data="api_on_answer_1=sched_broadcast +1 ${uuid} playback::sound1.wav"/> <action application="export" data="api_on_answer_2=sched_hangup +15 ${uuid}"/> ________________________________ From: Michael Collins <msc@freeswitch.org> To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> Sent: Wednesday, August 17, 2011 3:05 PM Subject: Re: [Freeswitch-users] Simulating Asterisk dial(x:y:z)
You can do multiple api_on_answer calls by using a relatively new syntax:
api_on_answer_1=api(arg),api_on_answer_2=api2(arg2),api_on_answer_3=api3(arg3) Same syntax applies to the execute_on_xxx variables. -MC
On Wed, Aug 17, 2011 at 12:33 AM, Sam <lakersman2006@yahoo.com> wrote:
I want to simulate the Asterisk dial(x:y:z) app where (x=total call time, y=warning time, z=warning interval) in Freeswitch. I know it can be done with sched_hangup and sched_broadcast, my question is how can I call a series of "api_on_answer" comands to do it?
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
participants (3)
-
Anthony Minessale
-
Michael Collins
-
Sam