├── LICENSE.txt ├── README.md ├── SugarModules ├── EntryPoint │ └── clickToCall.php ├── Extension │ └── modules │ │ ├── Administration │ │ └── Ext │ │ │ ├── Administration │ │ │ └── administration.ClickToCall.php │ │ │ └── Language │ │ │ └── en_us.ClickToCall.php │ │ └── Users │ │ └── Ext │ │ └── Language │ │ └── en_us.ClickToCall.php └── modules │ └── ClickToCall │ ├── LoadCallerButton.php │ ├── index.php │ ├── language │ └── en_us.lang.php │ ├── scripts │ └── replaceAndCall.js │ ├── sendToAsterik.php │ ├── settings_form.php │ └── template_form_config.tpl ├── manifest.php └── scripts ├── post_install.php └── pre_uninstall.php /LICENSE.txt: -------------------------------------------------------------------------------- 1 | European Union Public Licence 2 | V. 1.1 3 | 4 | EUPL (c) the European Community 2007 5 | 6 | 7 | This European Union Public Licence (the "EUPL") applies to the Work or Software 8 | (as defined below) which is provided under the terms of this Licence. Any use 9 | of the Work, other than as authorised under this Licence is prohibited (to the 10 | extent such use is covered by a right of the copyright holder of the Work). 11 | 12 | The Original Work is provided under the terms of this Licence when the Licensor 13 | (as defined below) has placed the following notice immediately following the 14 | copyright notice for the Original Work: 15 | 16 | Licensed under the EUPL V.1.1 17 | 18 | or has expressed by any other mean his willingness to license under the EUPL. 19 | 20 | 21 | 1. Definitions 22 | 23 | In this Licence, the following terms have the following meaning: 24 | 25 | * The Licence: this Licence. 26 | 27 | * The Original Work or the Software: the software distributed and/or 28 | communicated by the Licensor under this Licence, available as Source Code 29 | and also as Executable Code as the case may be. 30 | 31 | * Derivative Works: the works or software that could be created by the 32 | Licensee, based upon the Original Work or modifications thereof. This 33 | Licence does not define the extent of modification or dependence on the 34 | Original Work required in order to classify a work as a Derivative Work; 35 | this extent is determined by copyright law applicable in the country 36 | mentioned in Article 15. 37 | 38 | * The Work: the Original Work and/or its Derivative Works. 39 | 40 | * The Source Code: the human-readable form of the Work which is the most 41 | convenient for people to study and modify. 42 | 43 | * The Executable Code: any code which has generally been compiled and which is 44 | meant to be interpreted by a computer as a program. 45 | 46 | * The Licensor: the natural or legal person that distributes and/or 47 | communicates the Work under the Licence. 48 | 49 | * Contributor(s): any natural or legal person who modifies the Work under the 50 | Licence, or otherwise contributes to the creation of a Derivative Work. 51 | 52 | * The Licensee or "You": any natural or legal person who makes any usage of 53 | the Software under the terms of the Licence. 54 | 55 | * Distribution and/or Communication: any act of selling, giving, lending, 56 | renting, distributing, communicating, transmitting, or otherwise making 57 | available, on-line or off-line, copies of the Work or providing access to 58 | its essential functionalities at the disposal of any other natural or legal 59 | person. 60 | 61 | 62 | 2. Scope of the rights granted by the Licence 63 | 64 | The Licensor hereby grants You a world-wide, royalty-free, non-exclusive, 65 | sublicensable licence to do the following, for the duration of copyright vested 66 | in the Original Work: 67 | 68 | * use the Work in any circumstance and for all usage, 69 | * reproduce the Work, 70 | * modify the Original Work, and make Derivative Works based upon the Work, 71 | * communicate to the public, including the right to make available or display 72 | the Work or copies thereof to the public and perform publicly, as the case 73 | may be, the Work, 74 | * distribute the Work or copies thereof, 75 | * lend and rent the Work or copies thereof, 76 | * sub-license rights in the Work or copies thereof. 77 | 78 | Those rights can be exercised on any media, supports and formats, whether now 79 | known or later invented, as far as the applicable law permits so. 80 | 81 | In the countries where moral rights apply, the Licensor waives his right to 82 | exercise his moral right to the extent allowed by law in order to make 83 | effective the licence of the economic rights here above listed. 84 | 85 | The Licensor grants to the Licensee royalty-free, non exclusive usage rights to 86 | any patents held by the Licensor, to the extent necessary to make use of the 87 | rights granted on the Work under this Licence. 88 | 89 | 90 | 3. Communication of the Source Code 91 | 92 | The Licensor may provide the Work either in its Source Code form, or as 93 | Executable Code. If the Work is provided as Executable Code, the Licensor 94 | provides in addition a machine-readable copy of the Source Code of the Work 95 | along with each copy of the Work that the Licensor distributes or indicates, in 96 | a notice following the copyright notice attached to the Work, a repository 97 | where the Source Code is easily and freely accessible for as long as the 98 | Licensor continues to distribute and/or communicate the Work. 99 | 100 | 101 | 4. Limitations on copyright 102 | 103 | Nothing in this Licence is intended to deprive the Licensee of the benefits 104 | from any exception or limitation to the exclusive rights of the rights owners 105 | in the Original Work or Software, of the exhaustion of those rights or of other 106 | applicable limitations thereto. 107 | 108 | 109 | 5. Obligations of the Licensee 110 | 111 | The grant of the rights mentioned above is subject to some restrictions and 112 | obligations imposed on the Licensee. Those obligations are the following: 113 | 114 | - Attribution right: the Licensee shall keep intact all copyright, patent or 115 | trademarks notices and all notices that refer to the Licence and to the 116 | disclaimer of warranties. The Licensee must include a copy of such notices 117 | and a copy of the Licence with every copy of the Work he/she distributes 118 | and/or communicates. The Licensee must cause any Derivative Work to carry 119 | prominent notices stating that the Work has been modified and the date of 120 | modification. 121 | 122 | - Copyleft clause: If the Licensee distributes and/or communicates copies of 123 | the Original Works or Derivative Works based upon the Original Work, this 124 | Distribution and/or Communication will be done under the terms of this 125 | Licence or of a later version of this Licence unless the Original Work is 126 | expressly distributed only under this version of the Licence. The Licensee 127 | (becoming Licensor) cannot offer or impose any additional terms or 128 | conditions on the Work or Derivative Work that alter or restrict the terms 129 | of the Licence. 130 | 131 | - Compatibility clause: If the Licensee Distributes and/or Communicates 132 | Derivative Works or copies thereof based upon both the Original Work and 133 | another work licensed under a Compatible Licence, this Distribution and/or 134 | Communication can be done under the terms of this Compatible Licence. For 135 | the sake of this clause, "Compatible Licence" refers to the licences listed 136 | in the appendix attached to this Licence. Should the Licensee's obligations 137 | under the Compatible Licence conflict with his/her obligations under this 138 | Licence, the obligations of the Compatible Licence shall prevail. 139 | 140 | - Provision of Source Code: When distributing and/or communicating copies of 141 | the Work, the Licensee will provide a machine-readable copy of the Source 142 | Code or indicate a repository where this Source will be easily and freely 143 | available for as long as the Licensee continues to distribute and/or 144 | communicate the Work. Legal Protection: This Licence does not grant 145 | permission to use the trade names, trademarks, service marks, or names of 146 | the Licensor, except as required for reasonable and customary use in 147 | describing the origin of the Work and reproducing the content of the 148 | copyright notice. 149 | 150 | 151 | 6. Chain of Authorship 152 | 153 | The original Licensor warrants that the copyright in the Original Work granted 154 | hereunder is owned by him/her or licensed to him/her and that he/she has the 155 | power and authority to grant the Licence. 156 | 157 | Each Contributor warrants that the copyright in the modifications he/she brings 158 | to the Work are owned by him/her or licensed to him/her and that he/she has the 159 | power and authority to grant the Licence. 160 | 161 | Each time You accept the Licence, the original Licensor and subsequent 162 | Contributors grant You a licence to their contributions to the Work, under the 163 | terms of this Licence. 164 | 165 | 166 | 7. Disclaimer of Warranty 167 | 168 | The Work is a work in progress, which is continuously improved by numerous 169 | contributors. It is not a finished work and may therefore contain defects or 170 | "bugs" inherent to this type of software development. 171 | 172 | For the above reason, the Work is provided under the Licence on an "as is" 173 | basis and without warranties of any kind concerning the Work, including without 174 | limitation merchantability, fitness for a particular purpose, absence of 175 | defects or errors, accuracy, non-infringement of intellectual property rights 176 | other than copyright as stated in Article 6 of this Licence. 177 | 178 | This disclaimer of warranty is an essential part of the Licence and a condition 179 | for the grant of any rights to the Work. 180 | 181 | 182 | 8. Disclaimer of Liability 183 | 184 | Except in the cases of wilful misconduct or damages directly caused to natural 185 | persons, the Licensor will in no event be liable for any direct or indirect, 186 | material or moral, damages of any kind, arising out of the Licence or of the 187 | use of the Work, including without limitation, damages for loss of goodwill, 188 | work stoppage, computer failure or malfunction, loss of data or any commercial 189 | damage, even if the Licensor has been advised of the possibility of such 190 | damage. However, the Licensor will be liable under statutory product liability 191 | laws as far such laws apply to the Work. 192 | 193 | 194 | 9. Additional agreements 195 | 196 | While distributing the Original Work or Derivative Works, You may choose to 197 | conclude an additional agreement to offer, and charge a fee for, acceptance of 198 | support, warranty, indemnity, or other liability obligations and/or services 199 | consistent with this Licence. However, in accepting such obligations, You may 200 | act only on your own behalf and on your sole responsibility, not on behalf of 201 | the original Licensor or any other Contributor, and only if You agree to 202 | indemnify, defend, and hold each Contributor harmless for any liability 203 | incurred by, or claims asserted against such Contributor by the fact You have 204 | accepted any such warranty or additional liability. 205 | 206 | 207 | 10. Acceptance of the Licence 208 | 209 | The provisions of this Licence can be accepted by clicking on an icon "I agree" 210 | placed under the bottom of a window displaying the text of this Licence or by 211 | affirming consent in any other similar way, in accordance with the rules of 212 | applicable law. Clicking on that icon indicates your clear and irrevocable 213 | acceptance of this Licence and all of its terms and conditions. 214 | 215 | Similarly, you irrevocably accept this Licence and all of its terms and 216 | conditions by exercising any rights granted to You by Article 2 of this 217 | Licence, such as the use of the Work, the creation by You of a Derivative Work 218 | or the Distribution and/or Communication by You of the Work or copies thereof. 219 | 220 | 221 | 11. Information to the public 222 | 223 | In case of any Distribution and/or Communication of the Work by means of 224 | electronic communication by You (for example, by offering to download the Work 225 | from a remote location) the distribution channel or media (for example, a 226 | website) must at least provide to the public the information requested by the 227 | applicable law regarding the Licensor, the Licence and the way it may be 228 | accessible, concluded, stored and reproduced by the Licensee. 229 | 230 | 231 | 12. Termination of the Licence 232 | 233 | The Licence and the rights granted hereunder will terminate automatically upon 234 | any breach by the Licensee of the terms of the Licence. 235 | 236 | Such a termination will not terminate the licences of any person who has 237 | received the Work from the Licensee under the Licence, provided such persons 238 | remain in full compliance with the Licence. 239 | 240 | 241 | 13. Miscellaneous 242 | 243 | Without prejudice of Article 9 above, the Licence represents the complete 244 | agreement between the Parties as to the Work licensed hereunder. 245 | 246 | If any provision of the Licence is invalid or unenforceable under applicable 247 | law, this will not affect the validity or enforceability of the Licence as a 248 | whole. Such provision will be construed and/or reformed so as necessary to make 249 | it valid and enforceable. 250 | 251 | The European Commission may publish other linguistic versions and/or new 252 | versions of this Licence, so far this is required and reasonable, without 253 | reducing the scope of the rights granted by the Licence. New versions of the 254 | Licence will be published with a unique version number. 255 | 256 | All linguistic versions of this Licence, approved by the European Commission, 257 | have identical value. Parties can take advantage of the linguistic version of 258 | their choice. 259 | 260 | 261 | 14. Jurisdiction 262 | 263 | Any litigation resulting from the interpretation of this License, arising 264 | between the European Commission, as a Licensor, and any Licensee, will be 265 | subject to the jurisdiction of the Court of Justice of the European 266 | Communities, as laid down in article 238 of the Treaty establishing the 267 | European Community. 268 | 269 | Any litigation arising between Parties, other than the European Commission, and 270 | resulting from the interpretation of this License, will be subject to the 271 | exclusive jurisdiction of the competent court where the Licensor resides or 272 | conducts its primary business. 273 | 274 | 275 | 15. Applicable Law 276 | 277 | This Licence shall be governed by the law of the European Union country where 278 | the Licensor resides or has his registered office. 279 | 280 | This licence shall be governed by the Belgian law if: 281 | 282 | * a litigation arises between the European Commission, as a Licensor, and any 283 | Licensee; 284 | * the Licensor, other than the European Commission, has no residence or 285 | registered office inside a European Union country. 286 | 287 | 288 | Appendix 289 | 290 | "Compatible Licences" according to article 5 EUPL are: 291 | 292 | * GNU General Public License (GNU GPL) v. 2 293 | * Open Software License (OSL) v. 2.1, v. 3.0 294 | * Common Public License v. 1.0 295 | * Eclipse Public License v. 1.0 296 | * Cecill v. 2.0 297 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SuiteCRM Click to Call (Asterisk) 2 | 3 | 4 | 5 | ## Instalación 6 | 7 | Para instalar el módulo hay que entrar en la administración de SuiteCRM y entrar en "Module Loader" seleccionar y subir el **.zip**. Una vez subido correctamente, solo queda dar click en instalar. 8 | 9 | > Para generar el "**.zip**" de instalación, es necesario hacer un clon del proyecto y comprimir el código en el primer nivel o se puede descargar desde los archivos adjuntos en la release "**suite-crm-click-to-call.zip**" 10 | 11 | ## Configuración 12 | 13 | Tras la instalación, en la administración esta la nueva sección de "**SuiteCRM Click to Call (Asterisk)**" donde se configurara la conexión con Asterisk. 14 | 15 | | Campo | Descripción | Ejemplo | 16 | |-|-|-| 17 | | **IP** | Dirección IP o URL de Asterisk | 127.0.0.1 | 18 | | **Port**| Puerto del manager de Asterisk (por defecto **5038**) | 5038 | 19 | | **User**| Usuario del manager de Asterisk | admin | 20 | | **Password**| Contraseña del manager de Asterisk| asteriksecret | 21 | | **Channel In**| local/SIP| local | 22 | | **Channel In Context**| Contexto dependiente de Channel In (local) | from-users | 23 | | **Channel Out**| local | local | 24 | | **Channel Our Context**:| Contexto para las llamadas salientes | from-users | 25 | | **Caller ID**:| | 0 | 26 | | **Variables**: | Variables para utilizar en los contextos | var_extension=$extension;var_num_llamar=$numberCall | 27 | 28 | En la configuración de usuarios, se ha crea el campo "**Asterisk Extension**" donde cada usuario pondrá su extensión correspondiente para realizar la llamada. 29 | 30 | ## Uso 31 | 32 | Los campos que sean de tipo "**phone**" ya sea en la ficha o en los listados de los diferentes módulos, tendrán a su derecha un ícono de un teléfono que al dar click este, enviara la señal de llamada al teléfono de la extensión del usuarios y posteriormente realizara la llamada. 33 | -------------------------------------------------------------------------------- /SugarModules/EntryPoint/clickToCall.php: -------------------------------------------------------------------------------- 1 | 'modules/ClickToCall/sendToAsterik.php', 5 | 'auth' => false 6 | ); 7 | 8 | -------------------------------------------------------------------------------- /SugarModules/Extension/modules/Administration/Ext/Administration/administration.ClickToCall.php: -------------------------------------------------------------------------------- 1 | isValidLoadButtom()) 14 | { 15 | 16 | $extension = $GLOBALS['current_user']->phone_extension_c; 17 | $siteUrl = $GLOBALS['sugar_config']['site_url']; 18 | 19 | echo ''; 20 | echo ''; 21 | echo ''; 22 | 23 | } 24 | } 25 | 26 | public function isValidLoadButtom() 27 | { 28 | 29 | $noActions = array( 30 | 'modulelistmenu', 31 | 'favorites', 32 | 'Popup', 33 | 'Login' 34 | ); 35 | 36 | if (in_array($_REQUEST['action'], $noActions)) { 37 | return false; 38 | } 39 | 40 | if (!empty($_REQUEST['to_pdf']) || !empty($_REQUEST['to_csv'])) { 41 | return false; 42 | } 43 | 44 | $noModule = array( 45 | 'ModuleBuilder', 46 | 'Timesheets', 47 | 'Emails' 48 | ); 49 | 50 | if (in_array($_REQUEST['module'], $noModule)) { 51 | return false; 52 | } 53 | 54 | return true; 55 | 56 | } 57 | 58 | } 59 | 60 | -------------------------------------------------------------------------------- /SugarModules/modules/ClickToCall/index.php: -------------------------------------------------------------------------------- 1 | $value) { 26 | if (!isset($sugar_config[$key])) { 27 | $sugar_config[$key] = ''; 28 | } 29 | } 30 | 31 | $configurator = new Configurator(); 32 | $focus = new Administration(); 33 | 34 | if (!empty($_POST['save'])) { 35 | $configurator->saveConfig(); 36 | $focus->saveConfig(); 37 | header('Location: index.php?module=Administration&action=index'); 38 | } 39 | 40 | $focus->retrieveSettings(); 41 | 42 | $sugar_smarty = new Sugar_Smarty(); 43 | 44 | $sugar_smarty->assign('MOD', $mod_strings); 45 | $sugar_smarty->assign('APP', $app_strings); 46 | $sugar_smarty->assign('APP_LIST', $app_list_strings); 47 | 48 | $sugar_smarty->assign('config', $configurator->config); 49 | $sugar_smarty->assign('clicktocall_config', $settingsForm); 50 | 51 | $sugar_smarty->assign('error', $configurator->errors); 52 | 53 | $sugar_smarty->display('modules/ClickToCall/template_form_config.tpl'); 54 | 55 | -------------------------------------------------------------------------------- /SugarModules/modules/ClickToCall/language/en_us.lang.php: -------------------------------------------------------------------------------- 1 | '); 15 | $(phone).attr('caller-button', true); 16 | 17 | } 18 | 19 | } 20 | 21 | $('img.click-to-call:not(.binded)').addClass('binded').on('click', function() { 22 | 23 | var number = $(this).attr('data-number'); 24 | 25 | $.ajax({ 26 | type: "POST", 27 | url: baseUrl + '/index.php?entryPoint=clickToCall', 28 | data: { 29 | ext: window.extension, 30 | num: number 31 | }, 32 | success: function (e) { 33 | console.warn(e); 34 | } 35 | }); 36 | 37 | }); 38 | 39 | -------------------------------------------------------------------------------- /SugarModules/modules/ClickToCall/sendToAsterik.php: -------------------------------------------------------------------------------- 1 | 'setAsteriskUser', 9 | 'clicktocall_asterisk_pass' => 'setAsteriskPass', 10 | 'clicktocall_asterisk_ip' => 'setAsteriskIp', 11 | 'clicktocall_asterisk_port' => 'setAsteriskPort', 12 | 'clicktocall_channelIn' => 'setChannelIn', 13 | 'clicktocall_channelInContext' => 'setChannelInContext', 14 | 'clicktocall_channelOut' => 'setChannelOut', 15 | 'clicktocall_channelOutContext' => 'setChannelOutContext', 16 | 'clicktocall_callerId' => 'setCallerId', 17 | 'clicktocall_variables' => 'setVariables' 18 | ); 19 | 20 | foreach ($options as $option => $setter) { 21 | if (isset($sugar_config[$option])) { 22 | $value = $sugar_config[$option]; 23 | $call->$setter($value); 24 | } 25 | } 26 | 27 | $call->setExtension($_POST['ext'])->setNumber($_POST['num']); 28 | $call->call(); 29 | 30 | class ClickToCall 31 | { 32 | 33 | protected $_asteriskUser; 34 | protected $_asteriskPass; 35 | protected $_asteriskIp; 36 | protected $_asteriskPort = 5038; 37 | 38 | protected $_channelIn; 39 | protected $_channelInContext; 40 | protected $_channelOut; 41 | protected $_channelOutContext; 42 | protected $_callerId; 43 | protected $_variables; 44 | 45 | protected $_timeOut = 5000; 46 | 47 | protected $_number = null; 48 | protected $_extension = null; 49 | 50 | public function __construct() 51 | { 52 | openlog('click-to-call', LOG_NDELAY | LOG_PID, LOG_LOCAL0); 53 | } 54 | 55 | public function __destruct() 56 | { 57 | closelog(); 58 | } 59 | 60 | public function call() 61 | { 62 | 63 | $extension = $this->getExtension(); 64 | $numberCall = $this->cleanNumber($this->getNumber()); 65 | 66 | syslog(LOG_DEBUG, 'Start call'); 67 | syslog(LOG_DEBUG, 'Asterisk: ' . $this->getAsteriskIp()); 68 | syslog(LOG_DEBUG, 'Calling extension: ' . $extension); 69 | syslog(LOG_DEBUG, 'Number to call: ' . $numberCall); 70 | syslog(LOG_DEBUG, 'Channel In: ' . $this->getChannelIn()); 71 | syslog(LOG_DEBUG, 'Channel Out: ' . $this->getChannelOut()); 72 | 73 | $socket = fsockopen( 74 | $this->getAsteriskIp(), 75 | $this->getAsteriskPort(), 76 | $errno, 77 | $errstr, 78 | $this->getTimeOut() 79 | ); 80 | 81 | $asteriskUser = $this->getAsteriskUser(); 82 | $asteriskPassword = $this->getAsteriskPass(); 83 | 84 | fputs($socket, "Action: Login\r\n"); 85 | fputs($socket, "UserName: $asteriskUser\r\n"); 86 | fputs($socket, "Secret: $asteriskPassword\r\n\r\n"); 87 | 88 | $variables = str_replace( 89 | array('$extension', '$numberCall'), 90 | array($extension, $numberCall), 91 | $this->getVariables() 92 | ); 93 | $variables = explode(';', $variables); 94 | 95 | $wrets = fgets($socket, 128); 96 | 97 | echo $wrets; 98 | 99 | $channel = ''; 100 | if ($this->getChannelIn() === 'local') { 101 | $channel = $this->getChannelIn() . '/' . $extension . '@' . $this->getChannelInContext(); 102 | } elseif ($this->getChannelIn() === 'SIP') { 103 | $channel = 'SIP/' . $extension; 104 | } 105 | 106 | fputs($socket, "Action: Originate\r\n"); 107 | fputs($socket, "Channel: $channel\r\n"); 108 | 109 | $callerId = $this->getCallerId(); 110 | 111 | $channelOutContext = $this->getChannelOutContext(); 112 | fputs($socket, "Exten: $numberCall\r\n"); 113 | fputs($socket, "Context: $channelOutContext\r\n"); 114 | fputs($socket, "Priority: 1\r\n"); 115 | fputs($socket, "Async: yes\r\n"); 116 | fputs($socket, "WaitTime: 25\r\n"); 117 | fputs($socket, "Callerid: $callerId\r\n"); 118 | 119 | if (!empty($variables)) { 120 | foreach ($variables as $val) { 121 | fputs($socket, "Variable: $val\r\n"); 122 | } 123 | } 124 | 125 | fputs($socket, "Action: Logoff\r\n\r\n"); 126 | 127 | $this->readResponse($socket, $this->getTimeOut()); 128 | 129 | fclose($socket); 130 | 131 | if (!empty($errno)) { 132 | syslog(LOG_ERR, $errno); 133 | syslog(LOG_ERR, $errstr); 134 | } 135 | 136 | } 137 | 138 | public function readResponse($socket, $timeout = 5000) 139 | { 140 | 141 | $retVal = ''; 142 | stream_set_timeout($socket, 0, $timeout); 143 | while (($buffer = fgets($socket, 20)) !== false) { 144 | $retVal .= $buffer; 145 | } 146 | 147 | syslog(LOG_DEBUG, '::-> readResponse :: ' . $retVal); 148 | 149 | return $retVal; 150 | } 151 | 152 | public function cleanNumber($number) 153 | { 154 | 155 | $num = trim($number); 156 | $num = str_replace(array( 157 | '-', 158 | ' ', 159 | '%', 160 | '+', 161 | '(', 162 | ')' 163 | ), '', $num); 164 | 165 | return $num; 166 | 167 | } 168 | 169 | public function setTimeOut($timeOut) 170 | { 171 | $this->_timeOut = $timeOut; 172 | return $this; 173 | } 174 | 175 | public function getTimeOut() 176 | { 177 | return $this->_timeOut; 178 | } 179 | 180 | public function setNumber($number) 181 | { 182 | $this->_number = $number; 183 | return $this; 184 | } 185 | 186 | public function getNumber() 187 | { 188 | return $this->_number; 189 | } 190 | 191 | public function setExtension($extension) 192 | { 193 | $this->_extension = $extension; 194 | return $this; 195 | } 196 | 197 | public function getExtension() 198 | { 199 | return $this->_extension; 200 | } 201 | 202 | public function setAsteriskUser($asteriskUser) 203 | { 204 | $this->_asteriskUser = $asteriskUser; 205 | return $this; 206 | } 207 | 208 | public function getAsteriskUser() 209 | { 210 | return $this->_asteriskUser; 211 | } 212 | 213 | public function setAsteriskPass($asteriskPass) 214 | { 215 | $this->_asteriskPass = $asteriskPass; 216 | return $this; 217 | } 218 | 219 | public function getAsteriskPass() 220 | { 221 | return $this->_asteriskPass; 222 | } 223 | 224 | public function setAsteriskIp($asteriskIp) 225 | { 226 | $this->_asteriskIp = $asteriskIp; 227 | return $this; 228 | } 229 | 230 | public function getAsteriskIp() 231 | { 232 | return $this->_asteriskIp; 233 | } 234 | 235 | public function setAsteriskPort($asteriskPort) 236 | { 237 | $this->_asteriskPort = $asteriskPort; 238 | return $this; 239 | } 240 | 241 | public function getAsteriskPort() 242 | { 243 | return $this->_asteriskPort; 244 | } 245 | 246 | public function setChannelIn($channelIn) 247 | { 248 | $this->_channelIn = $channelIn; 249 | return $this; 250 | } 251 | 252 | public function getChannelIn() 253 | { 254 | return $this->_channelIn; 255 | } 256 | 257 | public function setChannelInContext($channelInContext) 258 | { 259 | $this->_channelInContext = $channelInContext; 260 | return $this; 261 | } 262 | 263 | public function getChannelInContext() 264 | { 265 | return $this->_channelInContext; 266 | } 267 | 268 | public function setChannelOut($channelOut) 269 | { 270 | $this->_channelOut = $channelOut; 271 | return $this; 272 | } 273 | 274 | public function getChannelOut() 275 | { 276 | return $this->_channelOut; 277 | } 278 | 279 | public function setChannelOutContext($channelOutContext) 280 | { 281 | $this->_channelOutContext = $channelOutContext; 282 | return $this; 283 | } 284 | 285 | public function getChannelOutContext() 286 | { 287 | return $this->_channelOutContext; 288 | } 289 | 290 | public function setCallerId($callerId) 291 | { 292 | $this->_callerId = $callerId; 293 | return $this; 294 | } 295 | 296 | public function getCallerId() 297 | { 298 | return $this->_callerId; 299 | } 300 | 301 | public function setVariables($variables) 302 | { 303 | $this->_variables = $variables; 304 | return $this; 305 | } 306 | 307 | public function getVariables() 308 | { 309 | return $this->_variables; 310 | } 311 | 312 | } 313 | 314 | -------------------------------------------------------------------------------- /SugarModules/modules/ClickToCall/settings_form.php: -------------------------------------------------------------------------------- 1 | '127.0.0.1', 'placeholder' => '127.0.0.1'); 4 | $settingsForm['clicktocall_asterisk_port'] = array('default' => '5038', 'placeholder' => '5038'); 5 | $settingsForm['clicktocall_asterisk_user'] = array('default' => '', 'placeholder' => ''); 6 | $settingsForm['clicktocall_asterisk_pass'] = array('default' => '', 'placeholder' => ''); 7 | 8 | $settingsForm['clicktocall_channelIn'] = array('default' => 'local', 'placeholder' => 'local'); 9 | $settingsForm['clicktocall_channelInContext'] = array('default' => '', 'placeholder' => 'from-users'); 10 | 11 | $settingsForm['clicktocall_channelOut'] = array('default' => 'local', 'placeholder' => 'local'); 12 | $settingsForm['clicktocall_channelOutContext'] = array('default' => '', 'placeholder' => 'from-users'); 13 | 14 | $settingsForm['clicktocall_callerId'] = array('default' => '', 'placeholder' => '0'); 15 | $settingsForm['clicktocall_variables'] = array('default' => '', 'placeholder' => 'var_extension=$extension;var_num_llamar=$numberCall'); 16 | 17 | 18 | -------------------------------------------------------------------------------- /SugarModules/modules/ClickToCall/template_form_config.tpl: -------------------------------------------------------------------------------- 1 |
187 | 188 | -------------------------------------------------------------------------------- /manifest.php: -------------------------------------------------------------------------------- 1 | array( 5 | 'exact_matches' => array( 6 | 1 => '6.5.15' 7 | ), 8 | 'regex_matches' => array( 9 | 1 => '6\.4\.\d', 10 | 2 => '6\.[0-9]\.\d', 11 | 3 => '7\.[0-9]\.\d' 12 | ) 13 | ), 14 | 'acceptable_sugar_flavors' => array( 15 | 'CE', 16 | 'PRO', 17 | 'ENT', 18 | 'CORP' 19 | ), 20 | 'readme' => '', 21 | 'key' => '', 22 | 'author' => ' ', 23 | 'description' => 'SuiteCRM Click to Call (Asterisk)', 24 | 'icon' => '', 25 | 'is_uninstallable' => true, 26 | 'name' => 'SuiteCRM Click to Call (Asterisk)', 27 | 'published_date' => 'January 8, 2018', 28 | 'type' => 'module', 29 | 'version' => 'v0.0.1', 30 | 'remove_tables' => false 31 | ); 32 | 33 | $installdefs = array( 34 | 'id' => 'ClickToCall', 35 | 'copy' => array( 36 | 0 => array( 37 | 'from' => 'SuiteCRM Click to Call (Asterisk) Installed Successfully .........
'; 47 | echo '