[asterisk-dev] [Code Review] 3028: ari: Add 'number', 'digits', and 'characters' URI scheme playback implementations

Matt Jordan reviewboard at asterisk.org
Sun Nov 24 22:06:18 CST 2013



> On Nov. 23, 2013, 5:38 p.m., Paul Belanger wrote:
> > Wouldn't this be the same path as /dial? I know asterisk has native functionality to play numbers however, feel like libraries on top of ARI could handle this.  /me shrugs.
> 
> Joshua Colp wrote:
>     To play numbers in various languages is complicated... so every library would then need to implement that logic. It's non-trivial.
> 
> Paul Belanger wrote:
>     I agree, I don't think it would be trivial.  However, if ARI is basically to remove the app/* folder, maybe some of the heavy lifting needs to be done by the libraries.  I'm not opposed of having this functionality in ARI but do we want it in ARI is the question.
>     
>     Just look at the issue we have today with different languages and syntax in Asterisk, Steve even had a talk at Astridevcon about it.
>     
>     I'd rather see us expose the logic to have people write something, then embedded into ARI.
> 
> Joshua Colp wrote:
>     Nothing needs to be explicitly done to allow that, everything exists as sound files which can be played using the existing playback functionality.

First, on Steve's talk:

Steve's talk at AstriDevCon served two purposes:
(1) Provide a different mechanism than the existing say.conf mechanism to configure text to speech, focusing on phrases instead of words
(2) Provide a different mechanism to add in localization efforts

Neither of these goals impact this proposal. Even if you integrated all of Steve's work, you still would need an external mechanism to make use of it. Performing a /play of digits/1; digits/2 will still play "1" followed by "2", and not "12" - with or without his work incorporated.

Asterisk already has internal mechanisms to handle much of the digit/character/number logic. That logic already has localization support in say.conf. Assuming Steve's proposal was included in some future version, you would simply have a different configuration mechanism and a different engine - but you would still have to have a way to make use of that engine externally. The implementation of how these things are transformed into sound changing does not have to impact how ARI instructs Asterisk to perform a playback of said resources.

Second, on whether or not this should exist in Asterisk or be implemented in an external library:

Yes, you can re-implement that logic outside of Asterisk - but is that something useful to do? Do library writers want to write routines that turn 101 into "one hundred and one" or "one zero one"? Or would you rather be implementing actual applications? (Rhetorical question here). If the answer is "yes, I want to write my own digitization logic", then by all means, you can still do that: the basic /play operation will still let you dictate exactly how you want digits played. That doesn't change. This just makes some common use cases much easier (and this is also rather needed for directory/voicemail like functionality).

Third, on whether or not we are falling into the /dial trap:

I don't think this is the same thing as dial. Dial's fatal flaw - that we admittedly did step into - was that it attempted to combine many Asterisk operations into a single operation. That resulted in a situation where the only way to control the overall operation was through lots of little options - and those options started to make the whole thing inherently complex. This is different. In this case, we aren't attempting to combine operations - we're attempting to expose a mapping of text to sound files that already exists in Asterisk.


- Matt


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3028/#review10268
-----------------------------------------------------------


On Nov. 23, 2013, 2:35 p.m., Joshua Colp wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3028/
> -----------------------------------------------------------
> 
> (Updated Nov. 23, 2013, 2:35 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> There is currently no way in ARI to easily say a number, digits, or a string of characters. You can do it manually but this is extremely cumbersome. The attached change implements this functionality using new URI schemes in the Playback operation.
> 
> number:<number> will play the provided number
> digits:<digits> will play the provided digits
> characters:<characters> will play the provided characters
> 
> By using the existing playback operation these can be queued up just like any other sound file, allowing you to construct a complete sentence if you desire.
> 
> 
> Diffs
> -----
> 
>   /branches/12/res/res_stasis_playback.c 403119 
> 
> Diff: https://reviewboard.asterisk.org/r/3028/diff/
> 
> 
> Testing
> -------
> 
> Executed playback with the various URI schemes.
> 
> 
> Thanks,
> 
> Joshua Colp
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131125/c2ab0d26/attachment.html>


More information about the asterisk-dev mailing list