id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,confirmation,distro,engine,distro_ver,engine_version,svn_rev
5648,Text To Speech destinations reported as BAD fix (implemented _getdest & _getdestinfo),phwhite,,FreePBX Version: 2.9.0.10\r\nText To Speech Module Version: 1.3.1.3\r\nRelated Tickets: ticket:1012\r\n\r\nWhen using a text-to-speech destination in another module such as IVR_ you will get a FreePBX Notice similar to this after applying:\r\n\r\n{{{\r\n'''There are 3 bad destinations\r\nIgnore this\r\nDEST STATUS: CUSTOM\r\nIVR: ivr-admin / Option: 1\r\nIVR: ivr-admin / Option: 2\r\nIVR: ivr-admin / Option: 3\r\n\r\nAdded 4 seconds ago\r\n(retrieve_conf.BADDEST)'''\r\n}}}\r\n\r\nThis is because the current version of the texttospeech module does not have the _getdest() and _getdestinfo() functions implemented.  I took the time to implement and test these functions_ thus fixing the false bad destination notices.  I've attached the patch file to this ticket.\r\n\r\nI'm not sure if creating a new trac ticket is the right thing for this patch_ or if I should have only replied to ticket:1012_ but I figure it's better to accidentally duplicate my effort then have the patch/fix get lost!  My apologies if I did this wrong.\r\n\r\nThis bug fix is only for a cosmetic issue and I hope this entry is found by other users searching for a solution/description to the problem it fixes. \r\n\r\nHere's the patch:\r\n----\r\n\r\n{{{\r\ndiff -ruN texttospeech.orig/functions.inc.php texttospeech/functions.inc.php\r\n--- texttospeech.orig/functions.inc.php 2012-03-02 11:27:42.000000000 -0800\r\n+++ texttospeech/functions.inc.php      2012-03-02 11:52:41.000000000 -0800\r\n@@ -11_6 +11_9 @@\r\n \r\n $debug = false;\r\n \r\n+// Asterisk Context Prefix\r\n+$context_prefix = 'ext-texttospeech-';\r\n+\r\n // Asterisk Lib Folder Get\r\n $astvarlib_path = $asterisk_conf['astvarlibdir'];\r\n \r\n@@ -29_9 +32_6 @@\r\n \r\n // Destinations Array Return\r\n function texttospeech_destinations() {\r\n-\r\n-               $context_prefix = 'ext-texttospeech-';\r\n-\r\n                foreach( texttospeech_list() as $row ){\r\n                        $destinations[] = array( 'destination' => $context_prefix . $row['id'] . '_s_1'_ 'description' => $row['name'] );\r\n                }\r\n@@ -51_9 +51_6 @@\r\n        switch( $pbx ) {\r\n \r\n                case "asterisk":\r\n-\r\n-                       $context_prefix = 'ext-texttospeech-';\r\n-\r\n                        foreach( texttospeech_list() as $entry ) {\r\n                        \r\n                                // Row All Settings Retrieve\r\n@@ -209_7 +206_30 @@\r\n        return $result;\r\n }\r\n \r\n+// Get Destination\r\n+function texttospeech_getdest( $id ) {\r\n+       return array($context_prefix.$id.'_s_1');\r\n+}\r\n \r\n+// Get Destination Info\r\n+function texttospeech_getdestinfo( $dest ) {\r\n+       if (substr(trim($dest)_0_strlen($context_prefix)) == $context_prefix) {\r\n+               $id = explode('_'_ $dest);\r\n+               $id = substr($id[0]_ 17);\r\n+\r\n+               $thisid = texttospeech_get($id);\r\n+               if (empty($thisid)) {\r\n+                       return array();\r\n+               }\r\n+               else {\r\n+                       return array('description' => sprintf(_("TTS: %s")_ $thisid['name'])_\r\n+                               'edit_url' => 'config.php?display=texttospeech&type=setup&id='.urlencode($id));\r\n+               }\r\n+       }\r\n+       else {\r\n+               return false;\r\n+       }\r\n+}\r\n \r\n // Get\r\n function texttospeech_get( $id ) {\r\n}}}\r\n,Patches,closed,trivial,2.11,Third Party Module,2.9-branch,fixed,Text-To-Speech texttospeech tts,,Need Feedback,,Asterisk 1.8,,1.8.3,
