Using outbound Event Sockets versus using embed language scripts
Unless I'm complicating things, it seems like a drop to write outbound event sockets apps versus writing embedded language apps. However, I'm interested in writing event sockets apps because I can see an advantage in being able to load balance the app by running you app behind a load balancer. One simple thing that I am trying to accomplish is collecting digits and doing something useful with string of digits that have been collected. My first attempt at this is to use the play_and_get_digits dptool, but I don't now how to pull data from stored variable so that I can use in the script. I slightly modified the freeswitch.git/libs/esl/perl/server2.plscript by adding this line: $con->execute('play_and_get_digits', '2 5 3 7000 # ${base_dir}/sounds/en/us/callie/conference/8000/conf-pin.wav /invalid.wav foobar \d+' ); The next thing that I'd like to do is grab the value in foobar is use it in the perl logic. Can someone lead me to the next step? Does anyone with experience with event socket apps and embedded language apps have some useful information about their preferred path? Thanks, Herman
my $e; my $foobar; $e = $con->api("uuid_getvar", "$uuid foobar"); if ($e) { $foobar = $e->getBody(); } On Wed, Feb 23, 2011 at 1:39 AM, Herman Griffin <herman.griffin@gmail.com> wrote:
Unless I'm complicating things, it seems like a drop to write outbound event sockets apps versus writing embedded language apps. However, I'm interested in writing event sockets apps because I can see an advantage in being able to load balance the app by running you app behind a load balancer. One simple thing that I am trying to accomplish is collecting digits and doing something useful with string of digits that have been collected.
My first attempt at this is to use the play_and_get_digits dptool, but I don't now how to pull data from stored variable so that I can use in the script. I slightly modified the freeswitch.git/libs/esl/perl/server2.pl script by adding this line:
$con->execute('play_and_get_digits', '2 5 3 7000 # ${base_dir}/sounds/en/us/callie/conference/8000/conf-pin.wav /invalid.wav foobar \d+' );
The next thing that I'd like to do is grab the value in foobar is use it in the perl logic.
Can someone lead me to the next step? Does anyone with experience with event socket apps and embedded language apps have some useful information about their preferred path?
Thanks, Herman
_______________________________________________ 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
I notice that there are DTMF events that come over the event socket. Is it best practice to use the play_and_get_digits dialplan app to collect digits or is collecting the digits using the DTMF events a better way? On Wed, Feb 23, 2011 at 8:26 AM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
my $e; my $foobar;
$e = $con->api("uuid_getvar", "$uuid foobar");
if ($e) { $foobar = $e->getBody(); }
On Wed, Feb 23, 2011 at 1:39 AM, Herman Griffin <herman.griffin@gmail.com> wrote:
Unless I'm complicating things, it seems like a drop to write outbound event sockets apps versus writing embedded language apps. However, I'm interested in writing event sockets apps because I can see an advantage in being able to load balance the app by running you app behind a load balancer. One simple thing that I am trying to accomplish is collecting digits and doing something useful with string of digits that have been collected.
My first attempt at this is to use the play_and_get_digits dptool, but I don't now how to pull data from stored variable so that I can use in the script. I slightly modified the freeswitch.git/libs/esl/perl/server2.pl script by adding this line:
$con->execute('play_and_get_digits', '2 5 3 7000 # ${base_dir}/sounds/en/us/callie/conference/8000/conf-pin.wav /invalid.wav foobar \d+' );
The next thing that I'd like to do is grab the value in foobar is use it in the perl logic.
Can someone lead me to the next step? Does anyone with experience with event socket apps and embedded language apps have some useful information about their preferred path?
Thanks, Herman
_______________________________________________ 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
_______________________________________________ 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
Using PAGD is the controlled way of collecting digits from the caller. You could rely on the events from the event socket PAGD does a lot of the dirty work for you, like handling invalid input, etc. -MC On Wed, Feb 23, 2011 at 7:49 PM, Herman Griffin <herman.griffin@gmail.com>wrote:
I notice that there are DTMF events that come over the event socket. Is it best practice to use the play_and_get_digits dialplan app to collect digits or is collecting the digits using the DTMF events a better way?
On Wed, Feb 23, 2011 at 8:26 AM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
my $e; my $foobar;
$e = $con->api("uuid_getvar", "$uuid foobar");
if ($e) { $foobar = $e->getBody(); }
On Wed, Feb 23, 2011 at 1:39 AM, Herman Griffin <herman.griffin@gmail.com> wrote:
Unless I'm complicating things, it seems like a drop to write outbound event sockets apps versus writing embedded language apps. However, I'm interested in writing event sockets apps because I can see an advantage in being able to load balance the app by running you app behind a load balancer. One simple thing that I am trying to accomplish is collecting digits and doing something useful with string of digits that have been collected.
My first attempt at this is to use the play_and_get_digits dptool, but I don't now how to pull data from stored variable so that I can use in the script. I slightly modified the freeswitch.git/libs/esl/perl/server2.pl script by adding this line:
$con->execute('play_and_get_digits', '2 5 3 7000 # ${base_dir}/sounds/en/us/callie/conference/8000/conf-pin.wav /invalid.wav foobar \d+' );
The next thing that I'd like to do is grab the value in foobar is use it in the perl logic.
Can someone lead me to the next step? Does anyone with experience with event socket apps and embedded language apps have some useful information about their preferred path?
Thanks, Herman
participants (3)
-
Anthony Minessale
-
Herman Griffin
-
Michael Collins