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.<div><br></div><div>-MC<br>
<br><div class="gmail_quote">On Wed, Feb 23, 2011 at 7:49 PM, Herman Griffin <span dir="ltr"><<a href="mailto:herman.griffin@gmail.com">herman.griffin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
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?<br><br>
<div class="gmail_quote">On Wed, Feb 23, 2011 at 8:26 AM, Anthony Minessale <span dir="ltr"><<a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a>></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">
my $e;<br>
my $foobar;<br>
<br>
$e = $con->api("uuid_getvar", "$uuid foobar");<br>
<br>
if ($e) {<br>
$foobar = $e->getBody();<br>
<div><div></div><div>}<br>
<br>
<br>
On Wed, Feb 23, 2011 at 1:39 AM, Herman Griffin<br>
<<a href="mailto:herman.griffin@gmail.com" target="_blank">herman.griffin@gmail.com</a>> wrote:<br>
> Unless I'm complicating things, it seems like a drop to write outbound event<br>
> sockets apps versus writing embedded language apps. However, I'm interested<br>
> in writing event sockets apps because I can see an advantage in being able<br>
> to load balance the app by running you app behind a load balancer. One<br>
> simple thing that I am trying to accomplish is collecting digits and doing<br>
> something useful with string of digits that have been collected.<br>
><br>
> My first attempt at this is to use the play_and_get_digits dptool, but I<br>
> don't now how to pull data from stored variable so that I can use in the<br>
> script. I slightly modified the freeswitch.git/libs/esl/perl/<a href="http://server2.pl" target="_blank">server2.pl</a><br>
> script by adding this line:<br>
><br>
> $con->execute('play_and_get_digits', '2 5 3 7000 #<br>
> ${base_dir}/sounds/en/us/callie/conference/8000/conf-pin.wav /invalid.wav<br>
> foobar \d+' );<br>
><br>
> The next thing that I'd like to do is grab the value in foobar is use it in<br>
> the perl logic.<br>
><br>
> Can someone lead me to the next step?<br>
> Does anyone with experience with event socket apps and embedded language<br>
> apps have some useful information about their preferred path?<br>
><br>
> Thanks,<br>
> Herman</div></div></blockquote></div></blockquote></div></div>