Changeset 3573
- Timestamp:
- 01/17/07 22:55:28 (6 years ago)
- Files:
-
- freepbx/branches/quickform (modified) (1 prop)
- freepbx/branches/quickform/INSTALL (modified) (1 diff)
- freepbx/branches/quickform/amp_conf/agi-bin/dialparties.agi (modified) (1 diff)
- freepbx/branches/quickform/amp_conf/astetc/extensions.conf (modified) (7 diffs)
- freepbx/branches/quickform/amp_conf/astetc/sip.conf (modified) (1 diff)
- freepbx/branches/quickform/amp_conf/bin/fax-process.pl (modified) (1 diff)
- freepbx/branches/quickform/amp_conf/bin/module_admin (modified) (3 diffs)
- freepbx/branches/quickform/amp_conf/bin/retrieve_conf (modified) (1 diff)
- freepbx/branches/quickform/amp_conf/bin/retrieve_op_conf_from_mysql.pl (modified) (2 diffs)
- freepbx/branches/quickform/amp_conf/htdocs/admin/cdr/call-log.php (modified) (1 diff)
- freepbx/branches/quickform/amp_conf/htdocs/admin/common/mainstyle.css (modified) (1 diff)
- freepbx/branches/quickform/amp_conf/htdocs/admin/common/php-asmanager.php (modified) (1 diff)
- freepbx/branches/quickform/amp_conf/htdocs/admin/config.php (modified) (1 diff)
- freepbx/branches/quickform/amp_conf/htdocs/admin/extensions.class.php (modified) (2 diffs)
- freepbx/branches/quickform/amp_conf/htdocs/admin/featurecodes.class.php (modified) (3 diffs)
- freepbx/branches/quickform/amp_conf/htdocs/admin/footer.php (modified) (1 diff)
- freepbx/branches/quickform/amp_conf/htdocs/admin/functions.inc.php (modified) (3 diffs)
- freepbx/branches/quickform/amp_conf/htdocs/admin/modules/core/page.routing.php (modified) (4 diffs)
- freepbx/branches/quickform/amp_conf/htdocs/admin/modules/core/page.trunks.php (modified) (2 diffs)
- freepbx/branches/quickform/amp_conf/htdocs/admin/page.modules.php (modified) (1 diff)
- freepbx/branches/quickform/amp_conf/mohmp3/QuajiroPromo.mp3 (deleted)
- freepbx/branches/quickform/amp_conf/mohmp3/TristeAlegriaPromo.mp3 (deleted)
- freepbx/branches/quickform/amp_conf/sbin/amportal (modified) (3 diffs)
- freepbx/branches/quickform/install_amp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/quickform
- Property svnmerge-integrated changed from /freepbx/trunk:1-3412 to /freepbx/trunk:1-3572
freepbx/branches/quickform/INSTALL
r2085 r3573 81 81 Patching Asterisk with softfax/spandsp. 82 82 83 - Download the latest spandsp files from http://www.soft-switch.org83 - Download the latest 0.2 spandsp files from http://www.soft-switch.org 84 84 - cd /usr/src/spandsp-xxx 85 85 - ./configure freepbx/branches/quickform/amp_conf/agi-bin/dialparties.agi
r3406 r3573 91 91 $rgmethod = "memoryhunt"; 92 92 $mastermode = 1; 93 } else 94 } elseif ($rgmethod == "ringallv2-prim") 95 { 93 } elseif ($rgmethod == "ringallv2-prim") { 96 94 $rgmethod = "ringallv2"; 97 95 $mastermode = 1; 96 } else { 98 97 $mastermode = 0; 98 } 99 99 100 100 // call confirmation only works with ringall and ringall-prim. The javascripts in ringgroups freepbx/branches/quickform/amp_conf/astetc/extensions.conf
r3409 r3573 221 221 ; to from-internal since it may be an outside line. 222 222 ; 223 exten => docfu,1,GotoIf( $[ "foo${DB(AMPUSER/${CFUEXT}/device)}" = "foo" ] ,chlocal)223 exten => docfu,1,GotoIf( $[ "foo${DB(AMPUSER/${CFUEXT}/device)}" = "foo" ]?chlocal) 224 224 exten => docfu,n,Dial(Local/${CFUEXT}@ext-local,${RT},${DIAL_OPTIONS}) 225 225 exten => docfu,n,Return … … 434 434 ; arg1 = trunk number, arg2 = number 435 435 [macro-dialout-enum] 436 ; This has been violently beaten upon by Rob Thomas, xrobau@gmail.com 437 ; to 1: Be compliant with all the depreciated bits in asterisk 1.2 and 438 ; above, and 2: to give a good shot at attempting to be compliant with 439 ; RFC3761 by honouring the order in which records are returned. 440 exten => s,1,GotoIf($["${ARG3}" = ""]PASSWD?NOPASSWD); arg3 is pattern password 436 ; Re-written to use enumlookup.agi 437 exten => s,1,GotoIf($["${ARG3}" != ""]?PASSWD:NOPASSWD); arg3 is pattern password 441 438 exten => s,n(PASSWD),Authenticate(${ARG3}) 442 439 exten => s,n(NOPASSWD),Macro(user-callerid,SKIPTTL) … … 448 445 exten => s,n,Set(DIAL_TRUNK=${ARG1}) 449 446 exten => s,n,DeadAGI(fixlocalprefix) ; this sets DIAL_NUMBER to the proper dial string for this trunk 450 exten => s,n,Set(E164NETWORKS=e164.arpa-e164.info-e164.org) ; enum networks to check 451 exten => s,n,GotoIf($["${DIAL_NUMBER:0:1}" = "+"]?begin) ; Skip next line if it already is prefixed by a plus 452 exten => s,n,Set(DIAL_NUMBER=+${DIAL_NUMBER}) ; Add a plus to the start, becasue ENUMLOOKUP needs it. 453 454 ; start of main network loop 455 exten => s,n(begin),NoOp(E164NETWORKS is ${E164NETWORKS}) 456 exten => s,n,GotoIf($["${E164NETWORKS:1:2}"=""]?failedtotally) 457 exten => s,n,Set(ENUMNET=${CUT(E164NETWORKS,-,1)}) 458 exten => s,n,Set(E164NETWORKS=${CUT(E164NETWORKS,-,2-)}) 459 460 exten => s,n,NoOp(E164NETWORKS is now ${E164NETWORKS}) 461 exten => s,n,NoOp(ENUMNET is ${ENUMNET}) 462 463 exten => s,n,Set(ENUMCOUNT=${ENUMLOOKUP(${DIAL_NUMBER},all,c,${ENUMNET})}) 464 exten => s,n,Set(ENUMPTR=0) 465 exten => s,n,Set(LOOKUPBUG=0) 466 467 ; start of main lookup loop 468 exten => s,n(startloop),GotoIf($["${ENUMPTR}"<"${ENUMCOUNT}"]?continue:failed) 469 470 ; Now, let's start through them. 471 exten => s,n(continue),Set(ENUMPTR=$[${ENUMPTR}+1]) 472 exten => s,n,NoOp(Doing ENUMLOOKUP(${DIAL_NUMBER},all,${ENUMPTR},${ENUMNET})) 473 exten => s,n,Set(ENUM=${ENUMLOOKUP(${DIAL_NUMBER},all,${ENUMPTR},${ENUMNET})}) 474 475 ; Deal with reponse 476 exten => s,n,GotoIf($["${ENUM:0:3}" = "sip" ]?sipuri) 477 exten => s,n,GotoIf($["${ENUM:0:3}" = "iax" ]?iaxuri) 478 ; It doesn't matter if you don't have h323 enabled, as when it tries to dial, it cares 479 ; about dialstatus and retries if there are any enum results left. 480 exten => s,n,GotoIf($["${ENUM:0:3}" = "h32" ]?h323uri) 481 482 ; e164.org can return 'ADDRESS' lines. Because of *'s poor handling of Enum 483 ; lookups, we want to DECREMENT the enum pointer. Yes. That means we try more 484 ; times than there actually exists entries. 485 exten => s,n,GotoIf($["${ENUM:0:3}" = "ADD" ]?enumbug) 486 487 ; OK. If we're here, we've still got some enum entries to go through. Back to 488 ; the start with you! 489 exten => s,n,Goto(startloop) 490 491 ; We're here because of the poor implementation of ENUMLOOKUP in Asterisk. It 492 ; is quite possible to do three ENUMLOOKUPS and get the same entry each time. 493 ; The only workaround I can think of is when we hit an invalid entry, do a 494 ; DECREMENT of the pointer, and keep trying. 495 exten => s,n(enumbug),Set(ENUMPTR=$[${ENUMPTR}-1]) 496 exten => s,n,NoOp(If this is looping with the same ENUM value, The ENUMLOOKUP function is fixed!) 497 exten => s,n,Set(LOOKUPBUG=$[${LOOKUPBUG}+1]) 498 ; If we've done this more than, ooh, 5 times, then give up on this network. Sorry. 499 exten => s,n,GotoIf($["${LOOKUPBUG}" > 5 ]?failed) 500 exten => s,n,Goto(continue) 501 502 ; If the prefix is 'sip:'... 503 exten => s,n(sipuri),Set(DIALSTR=SIP/${ENUM:4}) 504 exten => s,n,Goto(dodial) 505 506 ; If it's IAX2... 507 exten => s,n(iaxuri),Set(DIALSTR=IAX2/${ENUM:5}) 508 exten => s,n,Goto(dodial) 509 510 ; Or even if it's H323. 511 exten => s,n(h323uri),Set(DIALSTR=H323/${ENUM:5}) 512 447 ; Replacement for asterisk's ENUMLOOKUP function 448 exten => s,n,DeadAGI(enumlookup.agi) 449 ; Now we have the variable DIALARR set to a list of URI's that can be called, in order of priority 450 ; Loop through them trying them in order. 451 exten => s,n(dialloop),GotoIf($["foo${DIALARR}"="foo"]?end) 452 exten => s,n,Set(TRYDIAL=${CUT(DIALARR,%,1)}) 453 exten => s,n,Set(DIALARR=${CUT(DIALARR,%,2-)}) 454 exten => s,n,Dial(${TRYDIAL}) 513 455 exten => s,n(dodial),Dial(${DIALSTR}) 514 456 exten => s,n,NoOp(Dial exited in macro-enum-dialout with ${DIALSTATUS}) 515 457 516 458 ; Now, if we're still here, that means the Dial failed for some reason. 517 ; If it's CONGESTION or CHANUNAVAIL we probably want to try again on a 518 ; different channel. However, if it's the last one, we don't have any 519 ; left, and I didn't keep any previous dialstatuses, so hopefully 520 ; someone looking throught the logs would have seen the NoOp's 521 exten => s,n,GotoIf($["${ENUMPTR}"<"${ENUMCOUNT}"]?maybemore:dialfailed) 522 exten => s,n(maybemore),GotoIf($[ $[ "${DIALSTATUS}" = "CHANUNAVAIL" ] | $[ "${DIALSTATUS}" = "CONGESTION" ] ]?continue) 459 ; If it's CONGESTION or CHANUNAVAIL we want to try again on a different 460 ; different channel. If there's no more left, the dialloop tag will exit. 461 exten => s,n,GotoIf($[ $[ "${DIALSTATUS}" = "CHANUNAVAIL" ] | $[ "${DIALSTATUS}" = "CONGESTION" ] ]?dialloop) 523 462 524 463 ; If we're here, then it's BUSY or NOANSWER or something and well, deal with it. … … 526 465 527 466 ; Here are the exit points for the macro. 528 exten => s,n(failed),NoOp(EnumLookup failed on network ${ENUMNET})529 exten => s,n,Goto(begin)530 531 exten => s,n(failedtotally),NoOp(EnumLookup failed -- no more networks to try)532 exten => s,n,Goto(end)533 467 534 468 exten => s,n(nochans),NoOp(max channels used up) … … 542 476 543 477 [macro-record-enable] 544 exten => s,1,GotoIf($ {LEN(${BLINDTRANSFER})} > 0?2:4)478 exten => s,1,GotoIf($[${LEN(${BLINDTRANSFER})} > 0]?2:4) 545 479 exten => s,2,ResetCDR(w) 546 480 exten => s,3,StopMonitor() … … 787 721 788 722 723 724 ; Text-To-Speech related macros 725 ; These all follow common actions. First try to playback a file "tts/custom-md5" 726 ; where "md5" is the md5() of whatever is going to be played. If that doesn't exist, 727 ; try to playback using macro-tts-sayXXXXX (where XXXXX is text/digits/etc, same as 728 ; the macro below). If that macro exits with MACRO_OFFSET=100, then it's done, 729 ; therwise, fallback to the default asterisk method. 730 ; 731 ; say text is purely for text-to-speech, there is no fallback 732 [macro-saytext] 733 exten => s,1,Noop(Trying custom SayText playback for "${ARG1}") 734 exten => s,n,Playback(tts/custom-${MD5(${ARG1})}) 735 exten => s,n,GotoIf($["${PLAYBACKSTATUS}"="SUCCESS"]?done) 736 ; call tts-saytext. This should set MACRO_OFFSET=101 if it was successful 737 exten => s,n(tts),Macro(tts-saytext|${ARG1}|${ARG2}|${ARG3}) 738 exten => s,n,Noop(No text-to-speech handler for SayText, cannot say "${ARG1}") 739 exten => s,n,Goto(done) 740 exten => s,tts+101,Noop(tts handled saytext) 741 742 ; say name is for saying names typically, but fallsback to using SayAlpha 743 ; (saying the word letter-by-letter) 744 [macro-sayname] 745 exten => s,1,Noop(Trying custom SayName playback for "${ARG1}") 746 exten => s,n,Playback(tts/custom-${MD5(${ARG1})}) 747 exten => s,n,GotoIf($["${PLAYBACKSTATUS}"="SUCCESS"]?done) 748 ; call tts-sayalpha. This should set MACRO_OFFSET=101 if it was successful 749 exten => s,n(tts),Macro(tts-sayalpha|${ARG1}|${ARG2}|${ARG3}) 750 exten => s,n,SayAlpha(${ARG1}) 751 exten => s,n,Goto(done) 752 exten => s,tts+101,Noop(tts handled sayname) 753 754 ; Say number is for saying numbers (eg "one thousand forty six") 755 [macro-saynumber] 756 exten => s,1,Noop(Trying custom SayNumber playback for "${ARG1}") 757 exten => s,n,Playback(tts/custom-${MD5(${ARG1})}) 758 exten => s,n,GotoIf($["${PLAYBACKSTATUS}"="SUCCESS"]?done) 759 ; call tts-saynumber. This should set MACRO_OFFSET=101 if it was successful 760 exten => s,n(tts),Macro(tts-saynumber|${ARG1}|${ARG2}|${ARG3}) 761 exten => s,n,SayNumber(${ARG1}) 762 exten => s,n,Goto(done) 763 exten => s,tts+101,Noop(tts handled saynumber) 764 765 ; Say digits is for saying digits one-by-one (eg, "one zero four six") 766 [macro-saydigits] 767 exten => s,1,Noop(Trying custom SayDigits playback for "${ARG1}") 768 exten => s,n,Playback(tts/custom-${MD5(${ARG1})}) 769 exten => s,n,GotoIf($["${PLAYBACKSTATUS}"="SUCCESS"]?done) 770 ; call tts-saydigits. This should set MACRO_OFFSET=101 if it was successful 771 exten => s,n(tts),Macro(tts-saydigits|${ARG1}|${ARG2}|${ARG3}) 772 exten => s,n,SayDigits(${ARG1}) 773 exten => s,n,Goto(done) 774 775 789 776 ; 790 777 ; ############################################################################ … … 932 919 exten => s,n,Macro(dial,${ARG1},${ARG2},${ARG3}) 933 920 921 ; delete the variable, if we are here, we are done trying to dial and it may have been left around 922 ; 923 exten => s,n,DBDel(RG/${RINGGROUP_INDEX}/${CHANNEL}) 934 924 exten => s,n,Set(USE_CONFIRMATION=) 935 925 exten => s,n,Set(RINGGROUP_INDEX=) 936 937 ; delete the variable, if we are here, we are done trying to dial and it may have been left around938 ;939 exten => s,n,DBDel(RG/${ARG4}/${CHANNEL})940 926 ;------------------------------------------------------------------------ 941 927 freepbx/branches/quickform/amp_conf/astetc/sip.conf
r1717 r3573 5 5 [general] 6 6 7 port = 5060 ; Port to bind to (SIP is 5060)7 bindport = 5060 ; Port to bind to (SIP is 5060) 8 8 bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine) 9 9 disallow=all freepbx/branches/quickform/amp_conf/bin/fax-process.pl
r3191 r3573 53 53 $subject = $tmp; 54 54 } 55 # Convert %20 to spaces, leave anythign else alone. 56 $subject =~ s/\%20/ /g; 55 57 } elsif ($cmd eq "--type") { 56 58 my $tmp = shift @ARGV; freepbx/branches/quickform/amp_conf/bin/module_admin
r2820 r3573 53 53 54 54 function init_amportal_environment($ampconfpath) { 55 global $amp_conf, $asterisk_conf, $db ;55 global $amp_conf, $asterisk_conf, $db, $astman; 56 56 57 57 if (!file_exists($ampconfpath)) { … … 69 69 // include the functions file from WEBROOT 70 70 include(AMP_BASE_INCLUDE_PATH.'/functions.inc.php'); 71 // include astman api 72 include(AMP_BASE_INCLUDE_PATH.'/common/php-asmanager.php'); 71 73 72 74 // now apply the real parse function (this makes some default assumptions and does a bit more error checking) … … 81 83 require_once(AMP_BASE_INCLUDE_PATH.'/common/db_connect.php'); //PEAR must be installed 82 84 85 $astman= new AGI_AsteriskManager(); 86 if (! $res = $astman->connect("127.0.0.1", $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"])) { 87 unset( $astman ); 88 } 83 89 } 84 90 freepbx/branches/quickform/amp_conf/bin/retrieve_conf
r3028 r3573 41 41 $file = file($filename); 42 42 foreach ($file as $line) { 43 if (preg_match("/^\s*([\w]+)\s*=\s*\"?([\w\/\:\.\ %-]*)\"?\s*([;#].*)?/",$line,$matches)) {43 if (preg_match("/^\s*([\w]+)\s*=\s*\"?([\w\/\:\.\*\%-]*)\"?\s*([;#].*)?/",$line,$matches)) { 44 44 $conf[ $matches[1] ] = $matches[2]; 45 45 } freepbx/branches/quickform/amp_conf/bin/retrieve_op_conf_from_mysql.pl
r3191 r3573 70 70 next; 71 71 } 72 73 # check if trunk or extension 74 if($line =~ /^context=from-pstn/) { 75 $istrunk=1; 76 next; 77 } 78 if($line =~ /^context=from-zaptel/) { 79 $istrunk=1; 80 next; 81 } 82 if($line =~ /^context=from-internal/) { 83 $istrunk=0; 84 next; 85 } 86 72 87 if($line =~ /^[b]?channel\s*=\s*[>]?\s*([\d\,-]+)\s*$/) { 73 88 $ampwildcard and next; … … 84 99 $newlabel=~s/\%n/$lastlabelnum/; 85 100 $newlabel=~s/\%N/$lastlabelnum/; 101 102 # only add if A) this is a trunk 103 # and B) we haven't already defined any zaplines at the top of the file 104 # (I use this to customize it so instead of saying "Zap 1" it will 105 # say something more useful -- like the phone # of the line 106 107 if($istrunk) { 108 $inzaplines=0; 109 foreach my $row ( @zaplines ) { 110 $tempvalue=@{$row}[0]; 111 if($tempvalue eq "Zap/$c") { 112 $inzaplines=1; 113 } 114 } 115 116 if ($inzaplines==0) { 117 @zaplines=(@zaplines,[ "Zap/$c","$newlabel" ]); 118 } 119 } 120 86 121 87 @zaplines=(@zaplines,[ "Zap/$c","$newlabel" ]);88 122 } 89 123 freepbx/branches/quickform/amp_conf/htdocs/admin/cdr/call-log.php
r3029 r3573 8 8 9 9 getpost_ifset(array('posted', 'Period', 'frommonth', 'fromstatsmonth', 'tomonth', 'tostatsmonth', 'fromday', 'fromstatsday_sday', 'fromstatsmonth_sday', 'today', 'tostatsday_sday', 'tostatsmonth_sday', 'dsttype', 'sourcetype', 'clidtype', 'channel', 'resulttype', 'stitle', 'atmenu', 'current_page', 'order', 'sens', 'dst', 'src', 'clid', 'userfieldtype', 'userfield', 'accountcodetype', 'accountcode', 'duration1', 'duration1type', 'duration2', 'duration2type')); 10 if (($resulttype == null) || ($resulttype == "")) unset($resulttype); 10 11 11 12 //echo "'posted=$posted', 'Period=$Period', 'frommonth=$frommonth', 'fromstatsmonth=$fromstatsmonth', 'tomonth=$tomonth', 'tostatsmonth=$tostatsmonth', 'fromday=$fromday', 'fromstatsday_sday=$fromstatsday_sday', 'fromstatsmonth_sday=$fromstatsmonth_sday', 'today=$today', 'tostatsday_sday=$tostatsday_sday', 'tostatsmonth_sday=$tostatsmonth_sday', 'dsttype=$dsttype', 'sourcetype=$sourcetype', 'clidtype=$clidtype', 'channel=$channel', 'resulttype=$resulttype', 'stitle=$stitle', 'atmenu=$atmenu', 'current_page=$current_page', 'order=$order', 'sens=$sens', 'dst=$dst', 'src=$src', 'clid=$clid', 'userfieldtype=$userfieldtype', 'userfield=$userfield', 'accountcodetype=$accountcodetype', 'accountcode=$accountcode', 'duration1=$duration1', 'duration1type=$duration1type', 'duration2=$duration2', 'duration2type=$duration2type'"; freepbx/branches/quickform/amp_conf/htdocs/admin/common/mainstyle.css
r3153 r3573 290 290 border:1px solid #ccc; 291 291 } 292 .rnav ul li a { 293 display:block; 294 } 292 295 .rnav ul li a.current { 293 296 color:#ff8a00; freepbx/branches/quickform/amp_conf/htdocs/admin/common/php-asmanager.php
r2710 r3573 290 290 $this->logoff(); 291 291 fclose($this->socket); 292 } 293 294 /** 295 * Check if the socket is connected 296 * 297 */ 298 function connected() 299 { 300 return (bool)$this->socket; 292 301 } 293 302 freepbx/branches/quickform/amp_conf/htdocs/admin/config.php
r3222 r3573 315 315 316 316 if ($amp_conf['AMPMGRPASS'] == 'amp111') { 317 printf( "<div class=\"warning\"><p>%s</p></div>", dgettext("welcome text", "Warning: You are running freePBX and ").$amp_conf['AMPENGINE'].dgettext("welcome page", " with the default manager pass. You should consider changing this to something else.") );317 printf( "<div class=\"warning\"><p>%s</p></div>", dgettext("welcome text", "Warning: You are running freePBX and ").$amp_conf['AMPENGINE'].dgettext("welcome page", " with the default manager pass. You should consider changing this to something else.")." ".sprintf('(<a href="http://aussievoip.com/wiki/index.php?page=freePBX-ManagerPass" target="_new">%s</a>)', _("Help")) ); 318 318 } 319 319 if ($amp_conf['AMPDBPASS'] == 'amp109') { 320 printf( "<div class=\"warning\"><p>%s</p></div>", dgettext("welcome text", "Warning: You are running freePBX and ").$amp_conf['AMPDBENGINE'].dgettext("welcome page", " with the default password ") );320 printf( "<div class=\"warning\"><p>%s</p></div>", dgettext("welcome text", "Warning: You are running freePBX and ").$amp_conf['AMPDBENGINE'].dgettext("welcome page", " with the default password ")." ".sprintf('(<a href="http://aussievoip.com/wiki/index.php?page=freePBX-MysqlPass" target="_new">%s</a>)', _("Help")) ); 321 321 } 322 322 freepbx/branches/quickform/amp_conf/htdocs/admin/extensions.class.php
r3341 r3573 617 617 } 618 618 function output() { 619 return "dbGet(".$this->varname."=".$this->key.")";619 return 'Set('.$this->varname.'=${DB('.$this->key.')})'; 620 620 } 621 621 } … … 627 627 } 628 628 function output() { 629 return "dbPut(".$this->key."=".$this->data.")";629 return 'Set(DB('.$this->key.')='.$this->data.')'; 630 630 } 631 631 } freepbx/branches/quickform/amp_conf/htdocs/admin/featurecodes.class.php
r2914 r3573 184 184 return ($this->_enabled == 1); 185 185 } 186 187 function delete() { 188 $s = "DELETE "; 189 $s .= "FROM featurecodes "; 190 $s .= "WHERE modulename = ".sql_formattext($modulename)." "; 191 $s .= "AND featurename = ".sql_formattext($featurename); 192 193 sql($s, 'query'); 194 195 $this->_enabled = -1; // = not ready 196 197 return true; 198 } 186 199 } 187 200 … … 225 238 } 226 239 240 // removes all features for a specific module 241 function featurecodes_delModuleFeatures($modulename) { 242 $s = "DELETE "; 243 $s .= "FROM featurecodes "; 244 $s .= "WHERE modulename = ".sql_formattext($modulename); 245 246 sql($s, 'query'); 247 248 return true; 249 } 250 227 251 function featurecodes_getFeatureCode($modulename, $featurename) { 228 252 $fc_code = ''; … … 234 258 return $fc_code != '' ? $fc_code : _('** MISSING FEATURE CODE **'); 235 259 } 260 261 function featurecodes_delFeatureCode($modulename, $featurename) { 262 $s = "DELETE "; 263 $s .= "FROM featurecodes "; 264 $s .= "WHERE modulename = ".sql_formattext($modulename)." "; 265 $s .= "AND featurename = ".sql_formattext($featurename); 266 267 sql($s, 'query'); 268 269 return true; 270 } 271 236 272 ?> freepbx/branches/quickform/amp_conf/htdocs/admin/footer.php
r3134 r3573 66 66 $astman->send_request('Command', array('Command'=>'!/var/lib/asterisk/bin/retrieve_conf')); 67 67 */ 68 69 //reload MOH to get around 'reload' not actually doing that. 70 $astman->send_request('Command', array('Command'=>'moh reload')); 71 68 72 //reload asterisk 69 73 $astman->send_request('Command', array('Command'=>'reload')); freepbx/branches/quickform/amp_conf/htdocs/admin/functions.inc.php
r3389 r3573 181 181 switch ($amp_conf['AMPENGINE']) { 182 182 case 'asterisk': 183 if ( $astman) {183 if (isset($astman) && $astman->connected()) { 184 184 //get version 185 185 $response = $astman->send_request('Command', array('Command'=>'show version')); 186 186 $verinfo = $response['data']; 187 187 } else { 188 // could not connect to asterisk manager 189 return false;188 // could not connect to asterisk manager, try console 189 $verinfo = exec('asterisk -V'); 190 190 } 191 191 … … 196 196 return array('engine'=>'asterisk', 'version' => $matches[1], 'additional' => $matches[4]); 197 197 } 198 199 return array('engine'=>'ERROR-UNABLE-TO-CONNECT', 'version'=>'0', 'additional' => '0'); 198 200 break; 199 201 } 200 return false;202 return array('engine'=>'ERROR-UNSUPPORTED-ENGINE-'.$amp_conf['AMPENGINE'], 'version'=>'0', 'additional' => '0'); 201 203 } 202 204 … … 1747 1749 1748 1750 if (!in_array($modules[$modulename]['status'], array(MODULE_STATUS_NOTINSTALLED, MODULE_STATUS_NEEDUPGRADE))) { 1749 return array(_("This module is already installed.")); 1751 //return array(_("This module is already installed.")); 1752 // This isn't really an error, we just exit 1753 return true; 1750 1754 } 1751 1755 freepbx/branches/quickform/amp_conf/htdocs/admin/modules/core/page.routing.php
r3262 r3573 145 145 // we do the loops separately so patterns are grouped together 146 146 147 // always drop 1 prefix 148 $dialpattern[] = '1|NXXNXXXXXX'; 149 147 // match 1+NPA+NXX (dropping 1) 148 foreach ($xmldata['lca-data']['prefix'] as $prefix) { 149 $dialpattern[] = '1|'.$prefix['npa'].$prefix['nxx'].'XXXX'; 150 } 150 151 // match NPA+NXX 151 152 foreach ($xmldata['lca-data']['prefix'] as $prefix) { 152 153 $dialpattern[] = $prefix['npa'].$prefix['nxx'].'XXXX'; 153 154 } 154 // add NPA to7-digits155 // match 7-digits 155 156 foreach ($xmldata['lca-data']['prefix'] as $prefix) { 156 $dialpattern[] = $prefix['n pa'].'+'.$prefix['nxx'].'XXXX';157 $dialpattern[] = $prefix['nxx'].'XXXX'; 157 158 } 158 159 … … 393 394 </tr> 394 395 <tr> 395 <td><?php echo _("Insert:")?></td> 396 <td> 397 <a href=# class="info"><?php echo _("Dial patterns wizards")?><span> 398 <strong><?php echo _("These options provide a quick way to add outbound dialing rules. Follow the prompts for each.")?><br> 399 <strong><?php echo _("Lookup local prefixes")?></strong> <?php echo _("This looks up your local number on www.localcallingguide.com (NA-only), and sets up so you can dial either 7, 10 or 11 digits (5551234, 6135551234, 16135551234) to access this route.")?><br> 400 </span></a>: 396 401 <input id="npanxx" name="npanxx" type="hidden" /> 397 402 <script language="javascript"> … … 403 408 //var npanxx = prompt("What is your areacode + prefix (NPA-NXX)?", document.getElementById('areacode').value); 404 409 do { 405 var npanxx = <?php echo 'prompt("'._("What is your areacode + prefix (NPA-NXX)?\\n\\n(Note: this database contains North American numbers only, and is not guaranteed to be 100% accurate. You will still have the option of modifying results.)\\n\\nThis may take a few seconds.").'")' ?>;410 var npanxx = <?php echo 'prompt("'._("What is your areacode + prefix (NPA-NXX)?\\n\\n(Note: this database contains North American numbers only, and is not guaranteed to be 100% accurate. You will still have the option of modifying results.)\\n\\nThis may take a few seconds.").'")' ?>; 406 411 if (npanxx == null) return; 407 412 } while (!npanxx.match("^[2-9][0-9][0-9][-]?[2-9][0-9][0-9]$") && <?php echo '!alert("'._("Invalid NPA-NXX. Must be of the format \'NXX-NXX\'").'")'?>); … … 470 475 <td> 471 476 <select onChange="insertCode();" id="inscode"> 472 <option value=""><?php echo _(" Pick pre-defined patterns")?></option>477 <option value=""><?php echo _("(pick one)")?></option> 473 478 <option value="local"><?php echo _("Local 7 digit")?></option> 474 479 <option value="local10"><?php echo _("Local 7/10 digit")?></option> freepbx/branches/quickform/amp_conf/htdocs/admin/modules/core/page.trunks.php
r3270 r3573 117 117 // - add 1 to anything else 118 118 $dialrules[] = $matches[1].'NXXXXXX'; 119 // add NPA to 7-digits 120 foreach ($xmldata['lca-data']['prefix'] as $prefix) { 121 $dialrules[] = $prefix['npa'].'+'.$prefix['nxx'].'XXXX'; 122 } 119 123 foreach ($xmldata['lca-data']['prefix'] as $prefix) { 120 124 $dialrules[] = $prefix['npa'].$prefix['nxx'].'XXXX'; … … 368 372 <td> 369 373 <a href=# class="info"><?php echo _("Dial rules wizards")?><span> 370 <strong><?php echo _("Always add prefix to local numbers")?></strong> <?php echo _("is useful for VoIP trunks, where if a number is dialed as \"5551234\", it can be converted to \"16135551234\".")?><br>374 <strong><?php echo _("Always dial with prefix")?></strong> <?php echo _("is useful for VoIP trunks, where if a number is dialed as \"5551234\", it can be converted to \"16135551234\".")?><br> 371 375 <strong><?php echo _("Remove prefix from local numbers")?></strong> <?php echo _("is useful for ZAP trunks, where if a local number is dialed as \"6135551234\", it can be converted to \"555-1234\".")?><br> 372 <strong><?php echo _(" Setup dialingfor local trunk")?></strong> <?php echo _("This looks up your local number on www.localcallingguide.com (NA-only), and sets up so you can dial either 7 or 10 digits (regardless of what your PSTN is) on a local trunk (where you have to dial 1+areacode for long distance, but only 5551234 (7-digit dialing) or 6135551234 (10-digit dialing) for local calls")?><br>376 <strong><?php echo _("Lookup numbers for local trunk")?></strong> <?php echo _("This looks up your local number on www.localcallingguide.com (NA-only), and sets up so you can dial either 7 or 10 digits (regardless of what your PSTN is) on a local trunk (where you have to dial 1+areacode for long distance, but only 5551234 (7-digit dialing) or 6135551234 (10-digit dialing) for local calls")?><br> 373 377 </span></a>: 374 378 </td><td valign="top"> <select id="autopop" name="autopop" onChange="changeAutoPop(); "> 375 379 <option value="" SELECTED><?php echo _("(pick one)")?></option> 376 <option value="always"><?php echo _("Always add prefix to local numbers")?></option>380 <option value="always"><?php echo _("Always dial with prefix")?></option> 377 381 <option value="remove"><?php echo _("Remove prefix from local numbers")?></option> 378 <option value="lookup7"><?php echo _(" Setup dialingfor local trunk (7-digit dialing)")?></option>379 <option value="lookup10"><?php echo _(" Setup dialingfor local trunk (10-digit dialing)")?></option>382 <option value="lookup7"><?php echo _("Lookup numbers for local trunk (7-digit dialing)")?></option> 383 <option value="lookup10"><?php echo _("Lookup numbers for local trunk (10-digit dialing)")?></option> 380 384 </select> 381 385 </td> freepbx/branches/quickform/amp_conf/htdocs/admin/page.modules.php
r3389 r3573 337 337 '<ul><li>'.implode('</li><li>',$errors).'</li></ul>'); 338 338 } else { 339 $actionstext[] = sprintf(_("%s %s will be upgraded to online ver ison %s"), $modules[$module]['name'], $modules[$module]['dbversion'], $modules_online[$module]['version']);339 $actionstext[] = sprintf(_("%s %s will be upgraded to online version %s"), $modules[$module]['name'], $modules[$module]['dbversion'], $modules_online[$module]['version']); 340 340 341 341 } freepbx/branches/quickform/amp_conf/sbin/amportal
r3302 r3573 125 125 if [ "$pid_length" == "0" -a "$pid_length" != "" ] 126 126 then 127 killall -9 safe_opserver127 ps -ef | grep safe_opserver | grep -v grep | awk '{print $2}' | xargs kill -9 128 128 echo 129 129 echo "-----------------------------------------------------" … … 157 157 if [ "$pid_length" != "0" -a "$pid_length" != "" ] 158 158 then 159 killall -9 safe_opserver160 killall -9op_server.pl159 ps -ef | grep safe_opserver | grep -v grep | awk '{print $2}' | xargs kill 160 killall op_server.pl 161 161 echo "FOP Server Stopped" 162 162 fi … … 169 169 killall -9 asterisk 170 170 killall -9 mpg123 171 killall -9 safe_opserver171 ps -ef | grep safe_opserver | grep -v grep | awk '{print $2}' | xargs kill -9 172 172 killall -9 op_server.pl 173 173 } freepbx/branches/quickform/install_amp
r3366 r3573 45 45 '2.2.0rc1', 46 46 '2.2.0rc2', 47 '2.2.0rc3', 48 '2.2.0', 47 49 '2.3.0alpha' 48 50 ); 49 51 50 define("REQ_ASTERISK_VERSION", "1.2");51 52 52 53 /********************************************************************************************************************/ … … 97 98 out(" it's a new installation)"); 98 99 out(" --my-svn-is-correct Ignore Asterisk version, assume it is correct"); 99 out(" --engine <name> Use the specified PBX Engine ('asterisk' or 'openpbx')");100 out(" --engine <name> Use the specified PBX Engine ('asterisk', 'asterisk14' or 'openpbx')"); 100 101 } 101 102 … … 267 268 global $asterisk_conf; 268 269 global $install_moh; 270 271 // total # files, # actually copied 272 $num_files = $num_copied = 0; 269 273 270 274 if ($dirsource && ($dirsource[0] != "/")) $dirsource = "/".$dirsource; … … 336 340 } 337 341 342 $num_files++; 338 343 if ($overwrite) { 339 344 debug("copy ".$source." -> ".$destination); 340 345 if (!$dryrun) { 341 346 copy($source, $destination); 347 $num_copied++; 342 348 } 343 349 } else { … … 346 352 } else { 347 353 //echo "recursive_copy($dirsourceparent, $dirdest, $md5sums, $dirsource/$file)"; 348 recursive_copy($dirsourceparent, $dirdest, $md5sums, $dirsource."/".$file); 354 list($tmp_num_files, $tmp_num_copied) = recursive_copy($dirsourceparent, $dirdest, $md5sums, $dirsource."/".$file); 355 $num_files += $tmp_num_files; 356 $num_copied += $tmp_num_copied; 349 357 } 350 358 } … … 353 361 if (isset($dir_handle)) closedir($dir_handle); 354 362 355 return true;363 return array($num_files, $num_copied); 356 364 } 357 365 … … 627 635 // **** Parse out command-line options 628 636 $shortopts = "h?u:p:"; 629 $longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost=","no-files","dbname=","my-svn-is-correct","engine ","install-moh");637 $longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost=","no-files","dbname=","my-svn-is-correct","engine=","install-moh"); 630 638 631 639 $args = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), $shortopts, $longopts); … … 691 699 break; 692 700 case "--engine": 701 if ($arg[1] != 'asterisk' && $arg[1] != 'asterisk14' && $arg[1] != 'openpbx') { 702 fatal('Currently only "asterisk", "asterisk14" or "openpbx" are supported as a PBX engine'); 703 } 693 704 $pbx_engine = $arg[1]; 694 if ($pbx_engine != 'asterisk') {695 fatal('Currently only "asterisk" is supported as a PBX engine');696 }697 705 break; 698 706 case "--install-moh": … … 755 763 out(AMP_CONF." does not exist, copying default"); 756 764 copy("amportal.conf", AMP_CONF); 765 chmod(AMP_CONF, 0640); 757 766 collect_settings(AMP_CONF, $dbhost, $new_username, $new_password, 'asterisk'); 758 767 … … 880 889 881 890 // **** Check asterisk verison 882 883 outn("Checking for Asterisk ".REQ_ASTERISK_VERSION.".."); 891 // Set the 'engine' to be 'asterisk14' if using asterisk 1.4, otherwise 892 // 'asterisk' 893 outn("Checking for Asterisk version.."); 884 894 if (preg_match('/^Asterisk (\d+(\.\d+)*)(-?(.*))$/', $verinfo, $matches)) { 885 if (version_compare($matches[1], REQ_ASTERISK_VERSION) < 0) { 886 fatal("Asterisk ".REQ_ASTERISK_VERSION." is required for this version of freePBX"); 887 } 895 if (version_compare($matches[1], "1.2") < 0) { 896 fatal("At least Asterisk 1.2 is required for this version of freePBX"); 897 } 898 if (version_compare($matches[1], "1.4", "ge")) 888 899 out("OK"); 889 900 } elseif (preg_match('/^Asterisk SVN.+/', $verinfo)) { … … 893 904 out("that your Asterisk version is compatible with FreePBX. Whilst this probably"); 894 905 out("won't cause any problems, YOU NEED TO BE CERTAIN that it is compatible"); 895 out("with at least the released Asterisk version ".REQ_ASTERISK_VERSION."." );906 out("with at least the released Asterisk version 1.2" ); 896 907 if ($override_astvers==false) { 897 908 out("If you are SURE that this is compatible, you can re-run ".$argv[0]." with"); … … 1000 1011 if ($install_files) 1001 1012 { 1002 outn("Installing new AMPfiles..");1013 outn("Installing new freePBX files.."); 1003 1014 $check_md5s=true; 1004 1015 $md5sums = read_md5_file(UPGRADE_DIR."/".$version.".md5"); 1005 recursive_copy("amp_conf", "", $md5sums);1016 list($num_files, $num_copied) = recursive_copy("amp_conf", "", $md5sums); 1006 1017 if (!is_file("/etc/asterisk/voicemail.conf")) copy("/etc/asterisk/voicemail.conf.template","/etc/asterisk/voicemail.conf"); 1007 1018 if (!is_dir("/var/spool/asterisk/voicemail/device")) amp_mkdir("/var/spool/asterisk/voicemail/device", "0755", true); 1008 out("OK ");1019 out("OK (".$num_copied." files copied, ".($num_files-$num_copied)." skipped)"); 1009 1020 } 1010 1021
