<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
I am trying to add relative path support for digits/letters/phonetics for all "say" functions that are located in say.c. There are many ways to do this and I'm&nbsp;trying to choose&nbsp;the least obstructive as far as I can tell. I'd like some input if possible:<BR>&nbsp;<BR>*** Reasoning ***<BR>&nbsp;<BR>normal voice files using playback (background, ...) can have a prefix added to the language&nbsp;<BR>&nbsp;<BR>ie. playback(welcome), playback(path1/welcome), playback(sub1/path1/welcome) ...<BR>&nbsp;<BR>whereas "say" functions can't =&gt; SayNumber(1000)<BR>&nbsp;<BR>this limits us to a single voice under a specific language for any digits/letters and phonetics (what I call VOCAB files). We need to able to use multiple voices under an existing language for digits/letters amd phonetics. For example:<BR>&nbsp;<BR>Consider the following sound file directory structure:<BR><BR>(English)<BR>sounds/digits<BR>sounds/letters<BR>sounds/phonetics<BR>sounds/customer1<BR>sounds/customer2<BR>sounds/customer3<BR>sounds/customer1/digits<BR>sounds/customer1/letters<BR>sounds/customer1/phonetics<BR><BR>(French)<BR>sounds/fr/digits<BR>sounds/fr/letters<BR>sounds/fr/phonetics<BR>sounds/fr/customer1<BR>sounds/fr/customer2<BR>sounds/fr/customer3<BR>sounds/fr/customer1/digits<BR>sounds/fr/customer1/letters<BR>sounds/fr/customer1/phonetics<BR><BR>there is no way to use the files under customer1 when using any of the "say" functions, as they are hard coded to look in the root language path.<BR>&nbsp;<BR>*** Implementation ***<BR>&nbsp;<BR>Method 1 (what I would prefer):<BR>One way to add this would be to add an element in the ast_chan structure, but I do not want to do this as I feel that it is too obstructive, unless the&nbsp;API has previsions for this.<BR>&nbsp;<BR>Method 2:<BR>Add the ability to pass in a relative path in each "say" function, but again this changes the way existing functions are called, and also requires a change to each "say" function (to obstructive). <BR>&nbsp;<BR>Method 3 (what I chose):<BR>Add an optional CHANNEL variable and use it to prefix&nbsp;the path in ast_say_streamfile. By using this method, I only need to change 1 function (ast_say_streamfile) which is called in ALL "say" functions, as well as add 2 functions that checks/builds the filename with the prefix. This method only applies to functions in say.c&nbsp;and does not affect existing syntax.<BR>&nbsp;<BR>***&nbsp;How it works&nbsp;***<BR>&nbsp;<BR>Add a&nbsp;channel variable called VOCAB_RELATIVE_PATH to enable this feature (simply call the dialplan Set function to enable it). If this variable exists, then the relative path defined by it is used, otherwise it defaults to it's usual location. If the file is not found under the relative path, it also defaults to it's usual location. <BR>&nbsp;<BR>example using sound file structure above:<BR>&nbsp;<BR>exten =&gt; 111,1,Answer()<BR>; play 1234 using the default digits path<BR>exten =&gt; 111,n,SayNumber(1234)<BR>&nbsp;<BR>; set a relative digits path to customer1<BR>exten =&gt; 111,n,Set(VOCAB_RELATIVE_PATH=customer1)<BR>exten =&gt; 111,n,SayNumber(1234)<BR>&nbsp;<BR>; set an invalid relative path, which will result in digits played from it's default location<BR>exten =&gt; 111,n,Set(VOCAB_RELATIVE_PATH=customer2)<BR>exten =&gt; 111,n,say_number(1234)<BR>&nbsp;<BR>Testing: All functions have been tested and work. We actually use it on all out boxes and it is working well.&nbsp;I tested&nbsp;the following scenarios for english and french languages (any language applies):<BR><BR>- No VOCAB_RELATIVE_PATH<BR>- invalid VOCAB_RELATIVE_PATH<BR>- valid VOCAB_RELATIVE_PATH - missing files<BR>- valid VOCAB_RELATIVE_PATH - files present<BR><BR>Other notes: <BR><BR>- Does not affect files used in other modules, such as voicemail and meetme.&nbsp;<BR>- see <A href="https://issues.asterisk.org/view.php?id=14749">https://issues.asterisk.org/view.php?id=14749</A>&nbsp;for patch and notes<BR>&nbsp;<BR>Any (constructive) input or thoughts&nbsp;would be great!<BR>&nbsp;<BR>NicChap.<BR></body>
</html>