Brian,<br><br>Thanks for the rapid reply.<br><br>I was wanting, in Lua, for example to allow a user to enter either a file number or an asterisk to abort the function and return to an earlier option.<br><br>I originally attempted this with a callback but found that at the end of the recording the callback would return, yet found no way to delay the return short of returning a pause on the first user input. This failed if the user waits until the recording has ended as the function returns. I assumed that stop might keep the callback active but it seems stop, break and false appear equivalent.<br>
<br>So I attempted to apply session:playAndGetDigits which seems to only evaluate input on either, the maximum number of entries defined, or entry of a defined terminator. Where the entry of a terminator might be acceptable for the numeric entry the need for a terminator after an asterisk would seem clumsy.<br>
<br>It would be great if after each digit the entry was matched against a regex, and if valid returned the value, with no need to predefine the terminator or minimum and maximum dtmf signals as everything could be defined in the regex.<br>
<br>Regardless I seem to be unable to even define the regex to match a single asterisk as \* and [*] seem to be interpreted different than I  would expect.<br><br>This reminds me of the usual debit card check prompt &quot;enter you sixteen digit number and press pound when finished&quot;. If the system knows there are only sixteen digits why require the pound.<br>
<br>Compounding the required terminator, the need to evaluate for either an asterisk or a numeric string excapes me.<br><br>Bob<br><br><br><br>In short  <br><br><div class="gmail_quote">2009/3/27 Brian West <span dir="ltr">&lt;<a href="mailto:brian@freeswitch.org">brian@freeswitch.org</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="">What exactly do you want to match?  Can you give me examples?<div><br></div><div>
/b</div><div><div><div></div><div class="h5"><br><div><div>On Mar 26, 2009, at 11:05 PM, Robert Clayton wrote:</div><br><blockquote type="cite"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">All,<br>
<br>Ok I know it must be me but...<br><br>In the Lua regex portion of session:playAndGetDigits what regex would I use to match either a numeric entry, or an asterisk. It seems when I attempt to define an asterisk as a character rather than a metacharacter the regex script is evaluated other than I would assume.<br>
The error code presents \* as a single * and [*] other than a character, leading to the hint that there is no preceding character to multiply.<br><br>I have at most 15 minutes of proficiency in regular expressions, but, are not \* or [*] equivalent to an asterisk character, rather than a metacharacter?<br>
<br>Also it seems that the playAndGetDigits evaluates when either the maximum number of characters is entered or the terminator is pressed. Is there any way to evaluate the regex on each input and therefore dynamically return after an acceptable entry? As in the previous example a numeric string and a single asterisk are, usually, different lengths and if an asterisk was used for, say, abort, entering an asterisk followed by a terminator would seem incorrect.<br>
<br>Bob<span> </span><br></span></blockquote></div><br></div></div><div> <span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div style="">
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div style="">
<div>Brian West</div><div><a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a></div><div><br></div></div></span>-- Meet us a ClueCon!  <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><br>
<div><br></div></div></span><br> </div><br></div></div><br>_______________________________________________<br>
Freeswitch-dev mailing list<br>
<a href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>