Changeset 7917
- Timestamp:
- 08/02/09 22:51:36 (4 years ago)
- Files:
-
- modules/branches/2.5 (modified) (1 prop)
- modules/branches/2.5/core/agi-bin/dialparties.agi (modified) (11 diffs)
- modules/branches/2.5/core/agi-bin/enumlookup.agi (modified) (5 diffs)
- modules/branches/2.5/core/etc/extensions.conf (modified) (14 diffs)
- modules/branches/2.5/core/functions.inc.php (modified) (16 diffs)
- modules/branches/2.5/core/module.xml (modified) (1 diff)
- modules/branches/2.5/core/page.did.php (modified) (1 diff)
- modules/branches/2.5/core/page.general.php (modified) (1 diff)
- modules/branches/2.5/core/page.routing.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.5
- Property svnmerge-integrated changed from /modules/branches/2.4:1-5852,5908 /modules/branches/2.6:1-7080,7132,7158-7174,7177,7179-7186,7191-7202,7204-7226,7228-7250,7252-7273,7279-7286,7289-7292,7294-7295,7297-7312,7317-7331,7333-7340,7411,7413,7415-7417,7419-7420,7423-7434,7438-7439,7441-7442,7444-7446,7458-7469,7553,7609-7622,7786,7874 to /modules/branches/2.4:1-5852,5908 /modules/branches/2.6:1-7080,7132,7158-7174,7177,7179-7186,7191-7202,7204-7226,7228-7250,7252-7273,7279-7286,7289-7292,7294-7295,7297-7312,7317-7331,7333-7340,7411,7413,7415-7417,7419-7420,7423-7434,7438-7439,7441-7442,7444-7446,7458-7469,7553,7609-7622,7697,7699-7701,7703-7707,7709-7710,7713-7722,7725-7731,7735-7736,7739-7740,7744-7751,7753-7759,7761-7774,7776-7787,7789-7791,7793-7795,7798,7806-7809,7811-7813,7816,7818-7821,7838,7858-7867,7871,7874-7882,7886-7893,7895-7896,7901
modules/branches/2.5/core/agi-bin/dialparties.agi
r7787 r7917 31 31 require_once "phpagi-asmanager.php"; 32 32 33 $ext = array(); // Hash that will contain our list of extensions to call34 $ext_hunt = array(); // Hash that will contain our list of extensions to call used by huntgroup33 $ext = array(); // Hash that will contain our list of extensions to call 34 $ext_hunt = array(); // Hash that will contain our list of extensions to call used by huntgroup 35 35 $cidnum = ""; // Caller ID Number for this call 36 36 $cidname = ""; // Caller ID Name for this call 37 37 $timer = ""; // Call timer for Dial command 38 $dialopts = ""; // options for dialing38 $dialopts = ""; // Options for dialing 39 39 $rc = ""; // Catch return code 40 40 $priority = ""; // Next priority 41 41 $rgmethod = ""; // If Ring Group what ringing method was chosen 42 $screen = false; // initialize screen variable42 $screen = false; // Initialize screen variable 43 43 $dsarray = array(); // This will hold all the dial strings, used to check for duplicate extensions 44 44 … … 59 59 $cfignore = strtoupper(trim($cfignore)); 60 60 61 $astman = new AGI_AsteriskManager( ); 62 if (!$astman->connect("127.0.0.1", $ampmgruser , $ampmgrpass)) { 63 exit (1); 61 $ast_ge_16 = version_compare($ast_version, "1.6", "ge"); 62 $has_extension_state = (get_var( $AGI, "HAS_EXTENSION_STATE" ) || $ast_ge_16); 63 // If we are 1.6 then we have the EXTENSION_STATE() function and don't need to use the manager 64 // 65 if (!$has_extension_state) { 66 $astman = $AGI->new_AsteriskManager(); 67 if (!$astman->connect("127.0.0.1", $ampmgruser , $ampmgrpass)) { 68 exit (1); 69 } 64 70 } 65 71 … … 162 168 163 169 // Clear it now so subsequent transfers don't honor it any longer 164 // unless it's a ringallv2 in which case it is going to g ot though170 // unless it's a ringallv2 in which case it is going to get through 165 171 // another level of local channels 166 172 // … … 231 237 } 232 238 } else { 233 debug("extension not in group list, ring ging only during prering time",4);239 debug("extension not in group list, ringing only during prering time",4); 234 240 $fmgrp_realprering = $fmgrp_prering; 235 241 array_unshift($ext,$fmgrp); … … 247 253 if (strlen($screen_call)) { 248 254 if($screen_call == 'nomemory' && $cidnum != '') { // This can't go in the dialplan because macro-dial can get called multiple times 249 // Do a security check, we only numeric callerid numbers, otherwise code could be in cjected in a cidnum field255 // Do a security check, we only numeric callerid numbers, otherwise code could be injected in a cidnum field 250 256 // that could result in an arbitrary command being executed in this remove operation. 251 257 if (ctype_digit($cidnum)) { … … 261 267 } 262 268 } 263 // IF THE FIRST EXTENSION ISCALL FORWARD ENABLED (put in logic) then we don't do master mode269 // IF THE FIRST EXTENSION HAVE CALL FORWARD ENABLED (put in logic) then we don't do master mode 264 270 // which means we reset the flag here after detecting that and just say we are not in master 265 271 // mode and all is well. That means the loop below needs to be modified to detect the first … … 344 350 // 345 351 // if mastermode is set then the first extension will be examined and mastermode will be reset so that the others 346 // are left alone. If the remaining extensions are not to be tried, skipremaining will be set to 1 thus skipping them 352 // are left alone. If the remaining extensions are not to be tried, skipremaining will be set to 1 which will 353 // result in dndprimary being set to 1 thus diabling the remaining list. 347 354 // 348 355 // if cf unconditional was already detected on the primary, then mastermode will have been reset at this point … … 640 647 // Asterisk 1.6 uses , instead of | and 1.4 can't recieve a , in the ds. 641 648 // 642 if ( version_compare($ast_version, "1.6", "ge")) {649 if ($ast_ge_16) { 643 650 $ds_seperator = ','; 644 651 } else { … … 690 697 } 691 698 692 $astman->disconnect(); 699 if (!$has_extension_state) { 700 $astman->disconnect(); 701 } 693 702 694 703 // EOF dialparties.agi … … 711 720 712 721 if (strpos($extnum,'#') != 0) { 713 // "#" used to identify external numbers in forwards and callg ourps722 // "#" used to identify external numbers in forwards and callgroups 714 723 // If using call confirmation, need to put the # back into the new dialstring 715 724 // we then place all external calls (denoted with a # at the end) through … … 762 771 function is_ext_avail( $extnum ) { 763 772 global $astman; 764 765 $status = $astman->ExtensionState( $extnum, 'from-internal' ); 766 767 $status = $status['Status']; 768 debug("ExtensionState: $status", 4); 773 global $AGI; 774 global $has_extension_state; 775 776 if ($has_extension_state) { 777 $extstate_result = get_var( $AGI, "EXTENSION_STATE($extnum)" ); 778 switch ($extstate_result) { 779 case "NOT_INUSE": 780 $status = 0; 781 break; 782 case "INUSE": 783 $status = 1; 784 break; 785 case "BUSY": 786 $status = 2; 787 break; 788 case "UNAVAILABLE": 789 $status = 4; 790 break; 791 case "RINGING": 792 $status = 8; 793 break; 794 case "RINGINUSE": 795 $status = 9; 796 break; 797 case "HOLDINUSE": 798 $status = 17; 799 break; 800 case "ONHOLD": 801 $status = 16; 802 break; 803 case "UNKNOWN": 804 default: 805 $status = 4; 806 } 807 debug("EXTENSION_STATE: $status ($extstate_result)", 1); 808 } else { 809 $status = $astman->ExtensionState( $extnum, 'from-internal' ); 810 $status = $status['Status']; 811 debug("ExtensionState: $status", 1); 812 } 769 813 return $status; 770 814 } modules/branches/2.5/core/agi-bin/enumlookup.agi
r6188 r7917 4 4 // Replacement for Asterisk's ENUMLOOKUP function. 5 5 // Written by Rob Thomas <xrobau@gmail.com> 6 // Released under Version 2 of the GPL 7 // Originally written for use with FreePBX. 8 9 // Based on e164.org's enum.php script, available on http://www.e164.org/enum.phps 6 // 7 // This file is part of FreePBX. http://www.freepbx.org 8 // 9 // FreePBX is free software: you can redistribute it and/or modify 10 // it under the terms of the GNU Affero General Public License as 11 // published by the Free Software Foundation, either version 3 of the 12 // License, or (at your option) any later version. 13 // 14 // FreePBX is distributed in the hope that it will be useful, 15 // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 // GNU Affero General Public License for more details. 18 // 19 // You should have received a copy of the GNU Affero General Public License 20 // along with FreePBX. If not, see <http://www.gnu.org/licenses/>. 21 // 22 // Copyright 2009 Rob Thomas 23 // Additional patch to support enum.conf by matka 24 // 25 // Originally based on e164.org's enum.php script, available from 26 // http://www.e164.org/enum.phps 10 27 11 28 /* --------WARNING--------- 12 29 * 13 * This script is auto-copied from an included module and will get overwritten. 14 * If you modify it, you must change it to write only, in the agi-bin directory, 15 * to keep it from getting changed. 16 */ 30 * This script is automatically copied from $ASTMODULES/core/agi-bin and will be 31 * overwritten any time you do any module changes. To avoid this, either set this 32 * file to READ ONLY (chmod a-w enumlookup.agi) or alter the file in core. 33 * It's probably better to submit any changes or enhancements to the freepbx tracker 34 * and they'll be rolled into core! 35 * 36 * --------WARNING--------- 37 */ 17 38 18 39 require_once "phpagi.php"; … … 21 42 $lookup = get_var( $AGI, "DIAL_NUMBER" ); 22 43 23 $enums = Array( 24 'e164.org', 25 //'e164.arpa', 26 //'e164.info', 27 ); 28 29 // Go through the ENUM providers and look for the number. 44 $enums = get_enum_providers(); 30 45 31 46 $dialstr = ""; 32 47 33 foreach ($enums as $enum) { 48 foreach ($enums as $enum) { // Go through the ENUM providers and look for the number. 34 49 // Are we using php5 and can use get_dns_record? 35 50 if (function_exists("dns_get_record")) { … … 59 74 if (eregi('SIP|IAX', $row['tech'])) { 60 75 $URI = $row['URI']; 61 $dialstr .= $nextURI[$URI]."|"; 76 // string delimiter defined in [macro-dialout-enum] 77 $dialstr .= $nextURI[$URI]."%"; 62 78 } 63 79 } … … 71 87 global $AGI; 72 88 73 $AGI->verbose("Looking up $lookup on $enum via shell command DIG",3); ;89 $AGI->verbose("Looking up $lookup on $enum via shell command DIG",3); 74 90 $arpa = ""; 75 91 for ($i = 0; $i < strlen($lookup); $i++) { … … 144 160 } 145 161 162 function get_enum_providers() { 163 // parse enum.conf config file 164 $localprefix_file = get_var($AGI, "ASTETCDIR")."/enum.conf"; 165 if (file_exists($localprefix_file)) { 166 $section="general"; 167 parse_conf($localprefix_file, $conf, $section); 168 if (count($conf) == 0) { 169 $AGI->verbose("Could not parse config file $localprefix_file - using default e164.org", 0); 170 return Array("e164.org"); 171 } 172 } else { 173 $AGI->verbose("Could not open config file $localprefix_file - using default e164.org", 0); 174 return Array("e164.org"); 175 } 176 177 $enums = Array(); 178 // pickup search org from the conf array 179 if (isset($conf["general"])) { 180 foreach ($conf["general"] as $key=>$options) { 181 if (isset($options["search"])) { 182 foreach($options as $enumorgs) { 183 $enums[]=$enumorgs; 184 } // store each enumorg in array 185 } // else, diff option 186 } // else, this isn't the section we want 187 } // else, no config for this section 188 } 189 190 function parse_conf($filename, &$conf, &$section) { 191 global $AGI; 192 $AGI->verbose("Parsing config file $filename",3); 193 194 if (is_null($conf)) { $conf = array(); } 195 196 if (is_null($section)) { $section = "general"; } 197 198 if (file_exists($filename)) { 199 $fd = fopen($filename, "r"); 200 while ($line = fgets($fd, 1024)) { 201 if (preg_match("/^\s*([a-zA-Z0-9-_]+)\s*=>\s*(.*?)\s*([;#].*)?$/",$line,$matches)) { 202 // name => => value 203 // keep [] to allow for duplicate options like search 204 // could extend options to include for example: 205 // skipgateway => slow-sip-gateway.com 206 // earlyexit => yes (to return only 1 enum from dns lookup) 207 $conf[$section][][$matches[1]] = $matches[2]; 208 } else if (preg_match("/^\s*\[(.+)\]/",$line,$matches)) { 209 // section name 210 $section = strtolower($matches[1]); 211 } else if (preg_match("/^\s*#include\s+(.*)\s*([;#].*)?/",$line,$matches)) { 212 // include another file 213 if ($matches[1][0] == "/") { 214 // absolute path 215 $filename = $matches[1]; 216 } else { 217 // relative path 218 $filename = dirname($filename)."/".$matches[1]; 219 } 220 parse_conf($filename, $conf, $section); 221 } 222 } 223 } 224 } 225 146 226 ?> modules/branches/2.5/core/etc/extensions.conf
r7612 r7917 23 23 ; any custom dialplan SHOULD be put in extensions_custom.conf which will * 24 24 ; not hurt a FreePBX generated dialplan. In some very rare and custom * 25 ; situations users may have a need to override what freepbxautomatically *25 ; situations users may have a need to override what FreePBX automatically * 26 26 ; generates. If so anything in this file will do that. If you come up with a * 27 27 ; situation where you need to modify the existing dialplan or macro, please * … … 43 43 #include extensions_custom.conf 44 44 45 [from-trunk] ; just an alias since VoIP shouldn't be called PSTN45 [from-trunk] ; just an alias since VoIP shouldn't be called PSTN 46 46 include => from-pstn 47 47 48 48 [from-pstn] 49 include => from-pstn-custom ; create this context in extensions_custom.conf to include customizations49 include => from-pstn-custom ; create this context in extensions_custom.conf to include customizations 50 50 include => ext-did 51 51 include => ext-did-post-custom 52 include => from-did-direct ; MODIFICAT OIN (PL) for findmefollow if enabled, should be bofore ext-local52 include => from-did-direct ; MODIFICATION (PL) for findmefollow if enabled, should be before ext-local 53 53 include => ext-did-catchall ; THIS MUST COME AFTER ext-did 54 54 exten => fax,1,Goto(ext-fax,in_fax,1) … … 57 57 ; 58 58 ; Required to assure that direct dids go to personal ring group before local extension. 59 ; This could be auto-generated however I it is prefer ed to be put here and hard coded59 ; This could be auto-generated however I it is preferred to be put here and hard coded 60 60 ; so that it can be modified if ext-local should take precedence in certain situations. 61 61 ; will have to decide what to do later. … … 101 101 exten => s,n,Goto(s,a42) 102 102 103 ;Set Call Trace for each hunt member we are going to call "Memory groups have multiple members to set CALL TRACE For hence the loop103 ;Set Call Trace for each hunt member we are going to call "Memory groups have multiple members to set CALL TRACE For" hence the loop 104 104 ; 105 105 exten => s,n(a35),GotoIf($[$["${CALLTRACE_HUNT}" != "" ] & $["${RingGroupMethod}" = "memoryhunt" ]]?a36:a50) … … 295 295 ; What to do on hangup. 296 296 [macro-hangupcall] 297 exten => s,1,ResetCDR(vw)298 exten => s,n,NoCDR()299 300 297 ; Cleanup any remaining RG flag 301 298 ; 302 exten => s, n,GotoIf($[ "x${USE_CONFIRMATION}" = "x" | "x${RINGGROUP_INDEX}" = "x" | "${CHANNEL}" != "${UNIQCHAN}"]?skiprg)299 exten => s,1,GotoIf($[ "x${USE_CONFIRMATION}" = "x" | "x${RINGGROUP_INDEX}" = "x" | "${CHANNEL}" != "${UNIQCHAN}"]?skiprg) 303 300 exten => s,n,Noop(Cleaning Up Confirmation Flag: RG/${RINGGROUP_INDEX}/${CHANNEL}) 304 301 exten => s,n,DBDel(RG/${RINGGROUP_INDEX}/${CHANNEL}) … … 350 347 351 348 [macro-dialout-trunk-predial-hook] 352 ; this macro intenti ally left blank so it may be safely overwritten for any custom349 ; this macro intentionally left blank so it may be safely overwritten for any custom 353 350 ; requirements that an installation may have. 354 351 ; … … 459 456 ; with congestion since there have been observed cases of the call continuing if not stopped with a 460 457 ; congestion, and this provides a slightly more friendly 'sorry' message in case the user is 461 ; legit amately trying to be cooperative.458 ; legitimately trying to be cooperative. 462 459 ; 463 460 ; Note: the following options are configurable in privacy.conf: … … 476 473 exten => s,n(PRIVMGR),PrivacyManager() 477 474 exten => s,n,GotoIf($["${PRIVACYMGRSTATUS}"="FAILED"]?fail) 478 exten => s,n,SetCallerPres(allowed_passed_screen); stop gap until app_privacy.c clears unavail ble bit475 exten => s,n,SetCallerPres(allowed_passed_screen); stop gap until app_privacy.c clears unavailable bit 479 476 exten => s,PRIVMGR+101(fail),Noop(STATUS: ${PRIVACYMGRSTATUS} CID: ${CALLERID(num)} ${CALLERID(name)} CALLPRES: ${CALLLINGPRES}) 480 477 exten => s,n,Playback(sorry-youre-having-problems) … … 490 487 ; try to playback using macro-tts-sayXXXXX (where XXXXX is text/digits/etc, same as 491 488 ; the macro below). If that macro exits with MACRO_OFFSET=100, then it's done, 492 ; therwise, fallback to the default asterisk method.489 ; otherwise, fallback to the default asterisk method. 493 490 ; 494 491 ; say text is purely for text-to-speech, there is no fallback … … 544 541 [from-sip-external] 545 542 ;give external sip users congestion and hangup 546 ; Yes. This is _really_ meant to be _. - I know asterisk whin ges about it, but543 ; Yes. This is _really_ meant to be _. - I know asterisk whines about it, but 547 544 ; I do know what I'm doing. This is correct. 548 545 exten => _.,1,NoOp(Received incoming SIP connection from unknown peer to ${EXTEN}) … … 614 611 [macro-dial-confirm] 615 612 ; This was written to make it easy to use macro-dial-confirm instead of macro-dial in generated dialplans. 616 ; This takes the same param aters, with an additional paramater of the ring group Number613 ; This takes the same parameters, with an additional parameter of the ring group Number 617 614 ; ARG1 is the timeout 618 615 ; ARG2 is the DIAL_OPTIONS … … 635 632 ; USE_CONFIRMATION, RINGGROUP_INDEX 636 633 ; 637 ; Th se are passed to inform dialparties to place external calls through the [grps] context634 ; These are passed to inform dialparties to place external calls through the [grps] context 638 635 ; 639 636 exten => s,n,Set(USE_CONFIRMATION=TRUE) … … 662 659 ; 663 660 ; ALERT_INFO is deprecated in Asterisk 1.4 but still used throughout the FreePBX dialplan and 664 ; usually set by dialparties.agi. This allows in eritance. Since no dialparties.agi here, set the661 ; usually set by dialparties.agi. This allows inheritance. Since no dialparties.agi here, set the 665 662 ; header if it is set. 666 663 ; … … 712 709 ;------------------------------------------------------------------------ 713 710 ; This context is set as a target with FORWARD_CONTEXT when Call Forwarding is set to be 714 ; ignored in a ringg oup or other features that may take advantage of this. Server side711 ; ignored in a ringgroup or other features that may take advantage of this. Server side 715 712 ; CF is done in dialparties.agi but if a client device forwards a call, it will be caught 716 713 ; and blocked here. modules/branches/2.5/core/functions.inc.php
r7915 r7917 216 216 $results2 = array(); 217 217 foreach ($results2_pre as $element) { 218 $options = explode("&", $element['data']); 219 foreach ($options as $option) { 220 if (($element['keyword'] == 'disallow' && $option == 'all') | ($element['keyword'] == 'deny')) { 221 array_unshift($results2,array('keyword'=>$element['keyword'],'data'=>$option)); 222 } else { 223 $results2[] = array('keyword'=>$element['keyword'],'data'=>$option); 218 if (strtolower(trim($element['keyword'])) != 'secret') { 219 $options = explode("&", $element['data']); 220 foreach ($options as $option) { 221 if (($element['keyword'] == 'disallow' && $option == 'all') | ($element['keyword'] == 'deny')) { 222 array_unshift($results2,array('keyword'=>$element['keyword'],'data'=>$option)); 223 } else { 224 $results2[] = array('keyword'=>$element['keyword'],'data'=>$option); 225 } 224 226 } 227 } else { 228 $results2[] = array('keyword'=>$element['keyword'],'data'=>$element['data']); 225 229 } 226 230 } 227 231 unset($results2_pre); 228 232 233 $context=''; 229 234 foreach ($results2 as $result2) { 230 $option = $result2['data'];235 $option = strtolower($result2['data']); 231 236 if ($ver12) { 232 $output .= $result2['keyword']."=$option\n"; 237 switch (strtolower($result2['keyword'])) { 238 case 'context': 239 $context = $option; 240 //fall-through 241 default: 242 $output .= $result2['keyword']."=".$result2['data']."\n"; 243 } 233 244 } else { 234 245 switch (strtolower($result2['keyword'])) { … … 239 250 $output .= "insecure=port\n"; 240 251 else 241 $output .= $result2['keyword']."= $option\n";252 $output .= $result2['keyword']."=".$result2['data']."\n"; 242 253 break; 243 254 case 'allow': 244 255 case 'disallow': 245 256 if ($option != '') 246 $output .= $result2['keyword']."= $option\n";257 $output .= $result2['keyword']."=".$result2['data']."\n"; 247 258 break; 248 259 case 'record_in': 249 260 case 'record_out': 250 261 break; 262 case 'context': 263 $context = $result2['data']; 264 //fall-through 251 265 default: 252 $output .= $result2['keyword']."= $option\n";266 $output .= $result2['keyword']."=".$result2['data']."\n"; 253 267 } 254 268 } … … 347 361 $results2 = array(); 348 362 foreach ($results2_pre as $element) { 349 $options = explode("&", $element['data']); 350 foreach ($options as $option) { 351 if (($element['keyword'] == 'disallow' && $option == 'all') | ($element['keyword'] == 'deny')) { 352 array_unshift($results2,array('keyword'=>$element['keyword'],'data'=>$option)); 353 } else { 354 $results2[] = array('keyword'=>$element['keyword'],'data'=>$option); 363 if (strtolower(trim($element['keyword'])) != 'secret') { 364 $options = explode("&", $element['data']); 365 foreach ($options as $option) { 366 if (($element['keyword'] == 'disallow' && $option == 'all') | ($element['keyword'] == 'deny')) { 367 array_unshift($results2,array('keyword'=>$element['keyword'],'data'=>$option)); 368 } else { 369 $results2[] = array('keyword'=>$element['keyword'],'data'=>$option); 370 } 355 371 } 372 } else { 373 $results2[] = array('keyword'=>$element['keyword'],'data'=>$element['data']); 356 374 } 357 375 } 358 376 unset($results2_pre); 359 377 378 $context=''; 360 379 foreach ($results2 as $result2) { 361 $option = $result2['data'];380 $option = strtolower($result2['data']); 362 381 if ($ver12) { 363 $output .= $result2['keyword']."=$option\n"; 382 switch (strtolower($result2['keyword'])) { 383 case 'context': 384 $context = $result2['data']; 385 //fall-through 386 default: 387 $output .= $result2['keyword']."=".$result2['data']."\n"; 388 } 364 389 } else { 365 390 switch ($result2['keyword']) { … … 372 397 $output .= "transfer=mediaonly\n"; 373 398 } else { 374 $output .= $result2['keyword']."= $option\n";399 $output .= $result2['keyword']."=".$result2['data']."\n"; 375 400 } 376 401 break; … … 378 403 case 'disallow': 379 404 if ($option != '') 380 $output .= $result2['keyword']."= $option\n";405 $output .= $result2['keyword']."=".$result2['data']."\n"; 381 406 break; 382 407 case 'record_in': 383 408 case 'record_out': 384 409 break; 410 case 'context': 411 $context = $option; 412 //fall-through 385 413 default: 386 $output .= $result2['keyword']."= $option\n";414 $output .= $result2['keyword']."=".$result2['data']."\n"; 387 415 } 388 416 } 417 } 418 switch (substr($id,0,8)) { 419 case 'tr-peer-': 420 if ($context == '') { 421 $output .= "context=from-trunk-iax2-$account\n"; 422 } 423 break; 424 case 'tr-user-': 425 if ($context == '') { 426 $tn = substr($id, 8); 427 // this is a 'user' trunk, we need to get the name of the corresponding 'peer' 428 // trunk so we can set the context appropriately for the group count 429 // 430 $td = core_trunks_getDetails($tn); 431 if (isset($td['channelid'])) { 432 $output .= "context=from-trunk-iax2-".$td['channelid']."\n"; 433 } 434 } 435 break; 436 default: 437 if ($call_limit) { 438 $output .= $call_limit; 439 } 389 440 } 390 441 $output .= $additional."\n"; … … 630 681 global $core_conf; 631 682 global $chan_dahdi; 683 global $astman;; 632 684 633 685 $modulename = "core"; … … 651 703 $core_conf->addSipGeneral('tos_audio','ef'); // Recommended setting from doc/ip-tos.txt 652 704 $core_conf->addSipGeneral('tos_video','af41'); // Recommended setting from doc/ip-tos.txt 705 $core_conf->addSipGeneral('alwaysauthreject','yes'); 653 706 } else { 654 707 $core_conf->addSipGeneral('tos','0x68'); // This really doesn't do anything with astersk not running as root … … 1179 1232 foreach($globals as $global) { 1180 1233 $value = $global['value']; 1181 if ($chan_dahdi && substr($value, 0, 4) === 'ZAP/') {1182 $value = 'DAHDI/' . substr($value, 4);1183 }1184 1234 $ext->addGlobal($global['variable'],$value); 1185 1235 … … 1228 1278 $ext->addGlobal('CALLINGPRES_35', 'prohib'); 1229 1279 $ext->addGlobal('CALLINGPRES_67', 'unavailable'); 1280 } 1281 1282 // This checks if we have func_extstate loaded, if so we set the global which dialparties 1283 // can use (and any other AGI script) to determine that this function exists and not connect 1284 // to the manager to get the information 1285 // 1286 if (version_compare($version, '1.4', 'ge') && version_compare($version, '1.6', 'lt')) { 1287 $response = $astman->send_request('Command', array('Command' => 'module show like func_extstate')); 1288 if (preg_match('/1 modules loaded/', $response['data'])) { 1289 $ext->addGlobal('HAS_EXTENSION_STATE', 'TRUE'); 1290 } 1230 1291 } 1231 1292 … … 2086 2147 // If the required voicemail file does not exist, then abort and go to normal voicemail behavior 2087 2148 // 2088 // TODO: there have been errors using System() with jump to 101 where asterisk works fine at the begining and 2089 // then starts to jump to 101 even on success. This new mode is being tried with the SYSTEM Status which 2090 // returns SUCCESS when the command returned succcessfully with a 0 app return code. 2149 // If 1.4 or above, use the STAT function to check for the file. Prior to 1.4, use the AGI script since the System() command tried 2150 // in the past had errors. 2091 2151 // 2092 2152 //exten => vmx,n,Macro(get-vmcontext,${ARG1}) … … 2094 2154 //;exten => vmx,n,TrySystem(/bin/ls ${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/${MODE}.[wW][aA][vV]) 2095 2155 //$ext->add('macro-vm', 'vmx', '', new ext_trysystem('/bin/ls ${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/${MODE}.[wW][aA][vV]')); 2096 //exten => vmx,n,AGI(checksound.agi,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/temp) 2097 $ext->add('macro-vm', 'vmx', '',new ext_agi('checksound.agi,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/temp')); 2098 //exten => vmx,n,GotoIf($["${SYSTEMSTATUS}" = "SUCCESS"]?tmpgreet) 2099 $ext->add('macro-vm','vmx', '', new ext_gotoif('$["${SYSTEMSTATUS}" = "SUCCESS"]','tmpgreet')); 2100 //exten => vmx,n,AGI(checksound.agi,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/${MODE}) 2101 $ext->add('macro-vm', 'vmx', '',new ext_agi('checksound.agi,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/${MODE}')); 2102 //exten => vmx,n,GotoIf($["${SYSTEMSTATUS}" != "SUCCESS"]?nofile) 2103 $ext->add('macro-vm','vmx', '', new ext_gotoif('$["${SYSTEMSTATUS}" != "SUCCESS"]','nofile')); 2156 if (version_compare($version, "1.4", "ge")) { 2157 $ext->add('macro-vm','vmx', '', new ext_gotoif('$[(${STAT(f,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/temp.wav)} = 1) || (${STAT(f,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/temp.WAV)} = 1)]','tmpgreet')); 2158 $ext->add('macro-vm','vmx', '', new ext_gotoif('$[(${STAT(f,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/${MODE}.wav)} = 0) && (${STAT(f,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/${MODE}.WAV)} = 0)]','nofile')); 2159 } else { 2160 $ext->add('macro-vm', 'vmx', '',new ext_agi('checksound.agi,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/temp')); 2161 $ext->add('macro-vm','vmx', '', new ext_gotoif('$["${SYSTEMSTATUS}" = "SUCCESS"]','tmpgreet')); 2162 $ext->add('macro-vm', 'vmx', '',new ext_agi('checksound.agi,${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/${MODE}')); 2163 $ext->add('macro-vm','vmx', '', new ext_gotoif('$["${SYSTEMSTATUS}" != "SUCCESS"]','nofile')); 2164 } 2104 2165 // Get the repeat, timeout and loop times to use if they are overriden form the global settings 2105 2166 … … 3632 3693 // conditionally, delete from iax or sip 3633 3694 switch (strtolower($tech)) { 3695 case "iax2": 3696 $tech = "iax"; 3697 // fall through 3634 3698 case "iax": 3635 3699 case "iax2": … … 3645 3709 //echo "editTrunk($trunknum, $channelid, $dialoutprefix, $maxchans, $outcid, $peerdetails, $usercontext, $userconfig, $register)"; 3646 3710 $tech = core_trunks_getTrunkTech($trunknum); 3711 if ($tech == "") { 3712 return false; 3713 } 3647 3714 core_trunks_del($trunknum, $tech); 3648 3715 core_trunks_backendAdd($trunknum, $tech, $channelid, $dialoutprefix, $maxchans, $outcid, $peerdetails, $usercontext, $userconfig, $register, $keepcid, $failtrunk, $disabletrunk); … … 3941 4008 $tech = core_trunks_getTrunkTech($trunknum); 3942 4009 3943 if ($tech == "zap" ) return ""; // zap has no details4010 if ($tech == "zap" || $tech == "") return ""; // zap has no details 3944 4011 3945 4012 $results = sql("SELECT keyword,data FROM $tech WHERE id = '9999$trunknum' ORDER BY flags, keyword DESC","getAll"); … … 3977 4044 $tech = core_trunks_getTrunkTech($trunknum); 3978 4045 3979 if ($tech == "zap" ) return ""; // zap has no details4046 if ($tech == "zap" || $tech == "") return ""; // zap has no details 3980 4047 3981 4048 $results = sql("SELECT keyword,data FROM $tech WHERE id = '99999$trunknum' ORDER BY flags, keyword DESC","getAll"); … … 3996 4063 $tech = core_trunks_getTrunkTech($trunknum); 3997 4064 3998 if ($tech == "zap" ) return ""; // zap has no register4065 if ($tech == "zap" || $tech == "") return ""; // zap has no register 3999 4066 4000 4067 $results = sql("SELECT keyword,data FROM $tech WHERE id = '9999999$trunknum'","getAll"); modules/branches/2.5/core/module.xml
r7794 r7917 4 4 <category>Basic</category> 5 5 <name>Core</name> 6 <version>2.5.1. 7</version>6 <version>2.5.1.8</version> 7 7 <candisable>no</candisable> 8 8 <canuninstall>no</canuninstall> 9 9 <changelog> 10 *2.5.1.8* #3696 (requires framework updated first), #3706, #3712 10 *2.5.1.8* #3696 (requires framework updated first), #3706, #3712, #3478, #3423, #3691, #3693, #3705, #3792 11 11 *2.5.1.7* #3517, #3653, #3591 12 12 *2.5.1.6* #3439, #3526, #3534, moved macro-vm to auto-generation (WARNING: custom modification of macro-vm in extensions_custom.conf need to be moved to extensions_override_freepbx.conf modules/branches/2.5/core/page.did.php
r7875 r7917 31 31 $pricid = isset($_REQUEST['pricid'])?$_REQUEST['pricid']:''; 32 32 33 $tabindex = 0; 34 33 35 if (isset($_REQUEST['submitclear']) && isset($_REQUEST['goto0'])) { 34 36 $_REQUEST[$_REQUEST['goto0'].'0'] = ''; modules/branches/2.5/core/page.general.php
r7342 r7917 13 13 14 14 $action = isset($_REQUEST['action'])?$_REQUEST['action']:''; 15 $tabindex = 0; 15 16 16 17 $cm =& cronmanager::create($db); modules/branches/2.5/core/page.routing.php
r6845 r7917 17 17 $extdisplay=isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:''; 18 18 $action = isset($_REQUEST['action'])?$_REQUEST['action']:''; 19 20 $tabindex = 0; 19 21 20 22 $repotrunkdirection = isset($_REQUEST['repotrunkdirection'])?$_REQUEST['repotrunkdirection']:'';
