<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-03-23 14:38 GMT+01:00 A J Stiles <span dir="ltr"><<a href="mailto:asterisk_list@earthshod.co.uk" target="_blank">asterisk_list@earthshod.co.uk</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wednesday 23 Mar 2016, Olivier wrote:<br>
> Hello,<br>
><br>
> I'm wonddering if it is possible, with Asterisk and any third party module<br>
> or service, to build the following feature:<br>
><br>
> - caller dials a given extension dedicated to a given language (german,<br>
> english, ...)<br>
> - Asterisk plays a welcome audio prompt<br>
> - caller spells his or her first name letter by letter (for example, caller<br>
> spell "A", "L", "I", ...)<br>
> - Asterisk repeats spelled letters to caller.<br>
><br>
> If possible, which module is needed ?<br>
><br>
> Best regards<br>
<br>
</div></div>Well, I'd do the whole thing in Dialplan (it's fairly computationally-<br>
complete per Church and Turing), but I'm a masochist like that :p<br>
<br>
What you need to do is have an inner loop; in which you use WaitExten() with a<br>
short timeout to read a digit. If a digit is pressed within the timeout, you<br>
will get directed to another extension. There you need to compare the digit<br>
just pressed against the last digit pressed; and if it is the same, then you<br>
select the next letter on that key. Otherwise you announce the last letter<br>
selected, append it to the name so far, and select the first letter on that<br>
key. If you timeout, then you announce the currently selected letter, append<br>
it to the name so far and set no letter selected. (This is needed, because<br>
you may have two letters in succession on the same key; so you must allow it<br>
to timeout before you can enter the next letter.) If you timeout with no<br>
letter selected, you increase a counter; and if this gets to some critical<br>
number, you repeat the prompt: Background() the original announcement to<br>
spell their name, and announce the letters entered so far. If the 1 key is<br>
pressed once, backspace (and after the timeout, announce the remaining<br>
letters); two presses within timeout clears the name entered so far and<br>
starts again from scratch.<br>
<br>
<br>
So, for example, someone might enter:<br>
2 [set current letter to "A"]<br>
(user waits for timeout) [Store and say "A". Set current letter to ""]<br>
5 [Set current letter to "J"]<br>
5 [set current letter to "K"]<br>
5 [set current letter to "L"]<br>
4 [4 != 5, so store and say "L". Set current letter to "G"]<br>
4 [set current letter to "H"]<br>
4 [set current letter to "I"]<br>
7 [7 != 4, so store and say "I". Set current letter to "P"]<br>
7 [set current letter to "Q"]<br>
7 [set current letter to "R"]<br>
7 [set current letter to "S"]<br>
6 [6 != 7, so store and say "S". Set current letter to "M"]<br>
6 [set current letter to "N"]<br>
6 [set current letter to "O"]<br>
(User waits for timeout) [Store and say "O". Set current letter to ""]<br>
6 [set current letter to "M"]<br>
6 [set current letter to "N"]<br>
* [store and say "N". We now have "ALISON". Go to next context]<br>
<br>
For the sake of your own sanity (or that of your unlucky successor), use<br>
maningful labels in your GoToIf() statements; and be sure to comment the<br>
resulting code liberally, so it looks a little bit less of an unwholesome<br>
mess.<br></blockquote><div><br></div><div>Yes I agree.<br><br></div><div>I also thought of using some IP Phone supporting custom XML application as having a feedback on screen is helpful.<br><br></div><div>Anyway, my question is about Speech recognition as this could be faster and portable to any handset.<br></div><div>I've given Google Speech Web API a short try, and it is not capable to recognize letters: when I spelled "A", it recognized "Air" !<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
AJS<br>
<br>
Note: Originating address only accepts e-mail from list! If replying off-<br>
list, change address to asterisk1list at earthshod dot co dot uk .<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" rel="noreferrer" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</font></span></blockquote></div><br></div></div>