Changeset 12441 for contributed_modules/modules/googlevoice
- Timestamp:
- 08/27/11 06:10:21 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
contributed_modules/modules/googlevoice/functions.inc.php
r12353 r12441 23 23 if(file_exists($amp_conf['AMPWEBROOT']."/admin/extensions.class.php")) { 24 24 // Yes, then include these files 25 //I need to know if we really need these files. Questionable. 25 26 require_once("functions.inc.php"); 26 27 require_once("extensions.class.php"); … … 81 82 foreach ($accounts as $account) { 82 83 $phonenum = $account[0]; 83 $username = $account[1]; 84 $address = $account[1].'@gmail.com'; 84 $full_address = explode('@', $account[1]); 85 if(array_key_exists(1, $full_address)) { 86 $username = str_replace('.', '', $account[1]); 87 $username = str_replace('@', '', $username); 88 $address = $full_address[0].'@'.$full_address[1]; 89 } else { 90 $username = $account[1]; 91 $address = $account[1].'@gmail.com'; 92 } 85 93 $password = $account[2]; 86 94 $output .= "[".$username."]\ntype=client\nserverhost=talk.google.com\n"; … … 118 126 $incontext = "googlein"; 119 127 $phonenum = $account[0]; 120 $username = $account[1]; 121 $address = $account[1].'@gmail.com'; 128 $full_address = explode('@', $account[1]); 129 if(array_key_exists(1, $full_address)) { 130 $username = str_replace('.', '', $account[1]); 131 $username = str_replace('@', '', $username); 132 $address = $full_address[0].'@'.$full_address[1]; 133 } else { 134 $username = $account[1]; 135 $address = $account[1].'@gmail.com'; 136 } 122 137 $outcontext = 'googlevoice-'.$username; 123 138 … … 188 203 return false; 189 204 } 205 206 $full_address = explode('@', $username); 207 if(array_key_exists(1, $full_address)) { 208 $username = str_replace('.', '', $username); 209 $username = str_replace('@', '', $username); 210 } else { 211 $username = $username; 212 } 190 213 191 214 $trunknum = false; … … 195 218 dbug_write('Trunknum = '.$trunknum.' 196 219 ',''); 220 $patterns[] = array( 221 'prepend_digits' => '1', 222 'match_pattern_prefix' => '', 223 'match_pattern_pass' => 'NXXNXXXXXX', 224 'match_cid' => '', 225 ); 226 core_trunks_update_dialrules($trunknum, $patterns); 197 227 if ($add_routes) { 198 228 /* OUTBOUND ROUTE */ … … 303 333 googlevoice_del_routes($trunknum,$username); 304 334 core_trunks_del($trunknum); 335 core_trunks_delete_dialrules($trunknum); 305 336 } 306 337 return true; … … 349 380 return; 350 381 } 351 ?>contributed_modules/modules/googlevoice/module.xml
r12354 r12441 2 2 <rawname>googlevoice</rawname> 3 3 <name>Google Voice</name> 4 <version>0. 1.1</version>4 <version>0.5.0</version> 5 5 <publisher>Marcus Brown</publisher> 6 6 <license>GPLv2+</license> … … 11 11 </description> 12 12 <changelog> 13 *0.5.0* Added Ability to add Google Apps Voice Accounts. Adding Trunk Prepends instead of just Route Prepends 13 14 *0.1.1* really fix the FreePBX 2.9 issue 14 15 *0.1.0* make the module work for FreePBX 2.9
