Changeset 3573

Show
Ignore:
Timestamp:
01/17/07 22:55:28 (6 years ago)
Author:
gregmac
Message:

Merged revisions 3413-3572 via svnmerge from
https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/trunk
Bringing up to date with trunk

................

r3419 | qldrob | 2006-12-23 19:32:05 -0500 (Sat, 23 Dec 2006) | 2 lines


Add naftali5's featurecode fixes.

................

r3420 | p_lindheimer | 2006-12-25 12:01:53 -0500 (Mon, 25 Dec 2006) | 1 line


RG tree not being deleted when returning to dial-confirm

................

r3435 | gregmac | 2006-12-28 02:02:27 -0500 (Thu, 28 Dec 2006) | 1 line


dbget/dbput removed in ast 1.4 - #1607

................

r3436 | qldrob | 2006-12-29 00:24:26 -0500 (Fri, 29 Dec 2006) | 2 lines


Start support for 'asterisk14' engine. I may end up taking this out.

................

r3437 | qldrob | 2006-12-29 20:26:48 -0500 (Fri, 29 Dec 2006) | 2 lines


Fix typo in standard sip.conf

................

r3438 | gregmac | 2006-12-31 03:22:53 -0500 (Sun, 31 Dec 2006) | 2 lines


Added links to help for default password warnings

................

r3480 | qldrob | 2007-01-02 07:23:03 -0500 (Tue, 02 Jan 2007) | 2 lines


Apply #1601 to trunk

................

r3481 | qldrob | 2007-01-02 07:25:59 -0500 (Tue, 02 Jan 2007) | 2 lines


Apply more FOP fixes, supplied by James_Bennett, in #1484. Thanks!

................

r3483 | gregmac | 2007-01-02 12:16:58 -0500 (Tue, 02 Jan 2007) | 2 lines


Add featurecode::delete() function

................

r3491 | qldrob | 2007-01-02 20:04:04 -0500 (Tue, 02 Jan 2007) | 2 lines


Convert %20's back to ' ' in the subject line when sending faxes.

................

r3493 | qldrob | 2007-01-02 20:25:07 -0500 (Tue, 02 Jan 2007) | 2 lines


Add '*' as a supported character in ampmgrpass

................

r3495 | gregmac | 2007-01-03 00:01:59 -0500 (Wed, 03 Jan 2007) | 2 lines


Fix #1473

................

r3497 | qldrob | 2007-01-03 00:54:51 -0500 (Wed, 03 Jan 2007) | 2 lines


Add enumlookup.agi, first stage of replacing asterisk's broken ENUMLOOKUP function.

................

r3498 | qldrob | 2007-01-03 00:56:36 -0500 (Wed, 03 Jan 2007) | 2 lines


Add credit to e164.org for the original script.

................

r3499 | qldrob | 2007-01-03 01:19:36 -0500 (Wed, 03 Jan 2007) | 2 lines


Finish replacement of Asterisk's ENUMLOOKUP function.

................

r3500 | qldrob | 2007-01-03 01:25:21 -0500 (Wed, 03 Jan 2007) | 2 lines


Missed a couple of lines that should have been removed.

................

r3504 | qldrob | 2007-01-03 01:31:59 -0500 (Wed, 03 Jan 2007) | 2 lines


Typo in regexp change earlier today.

................

r3507 | qldrob | 2007-01-03 01:59:58 -0500 (Wed, 03 Jan 2007) | 2 lines


Note that spandsp 0.2-pre can only be used.

................

r3512 | gregmac | 2007-01-03 03:42:40 -0500 (Wed, 03 Jan 2007) | 2 lines


Set default permissions of amportal.conf during install (#1626)

................

r3520 | qldrob | 2007-01-03 23:08:31 -0500 (Wed, 03 Jan 2007) | 2 lines


Fix my fix in this branch too.

................

r3521 | qldrob | 2007-01-03 23:10:10 -0500 (Wed, 03 Jan 2007) | 2 lines


Thanks to naftali5, another fix! This time for the CDR reports, #1429, not displaying the time correctly on the second page.

................

r3524 | qldrob | 2007-01-03 23:20:58 -0500 (Wed, 03 Jan 2007) | 2 lines


Add 'moh reload' command to try to convince asterisk to reload it's moh files.

................

r3531 | gregmac | 2007-01-04 01:43:38 -0500 (Thu, 04 Jan 2007) | 2 lines


Add text-to-speech stub macros

................

r3533 | gregmac | 2007-01-04 01:49:46 -0500 (Thu, 04 Jan 2007) | 2 lines


Port r3532 (2.2) to trunk

................

r3536 | qldrob | 2007-01-04 04:03:04 -0500 (Thu, 04 Jan 2007) | 2 lines


Setup svnmerge on trunk

................

r3537 | qldrob | 2007-01-04 04:05:14 -0500 (Thu, 04 Jan 2007) | 13 lines


Merged revisions 3533-3536 via svnmerge from
https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/branches/2.2


........

r3534 | qldrob | 2007-01-04 18:52:57 +1000 (Thu, 04 Jan 2007) | 2 lines


Add some error reporting that explains why stuff isn't working, either unsupported engine, or unable to connect to astman.

........

r3535 | qldrob | 2007-01-04 19:00:41 +1000 (Thu, 04 Jan 2007) | 2 lines


Removed svnmerge from trunk -> 2.2 .. Re-setting up so that patches now go from 2.2 -> trunk.

........

................

r3539 | gregmac | 2007-01-04 13:31:24 -0500 (Thu, 04 Jan 2007) | 1 line


Fix typo #1636

................

r3547 | gregmac | 2007-01-05 17:16:51 -0500 (Fri, 05 Jan 2007) | 13 lines


Merged revisions 3542,3544-3546 via svnmerge from
https://svn.sourceforge.net/svnroot/amportal/freepbx/branches/2.2


........

r3542 | qldrob | 2007-01-04 17:32:40 -0500 (Thu, 04 Jan 2007) | 2 lines


3 fixes to extensions.conf spotted by vgster, only seconds after releasing 2.2.0. Going to re-release it. Shh. no-one will notice.

........

r3546 | gregmac | 2007-01-05 17:03:03 -0500 (Fri, 05 Jan 2007) | 2 lines


Fix #1642

........

................

r3549 | qldrob | 2007-01-08 20:05:18 -0500 (Mon, 08 Jan 2007) | 21 lines


Merged revisions 3536-3541,3543-3545,3547-3548 via svnmerge from
https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/branches/2.2


........

r3538 | gregmac | 2007-01-05 04:31:02 +1000 (Fri, 05 Jan 2007) | 2 lines


Fix typo #1636

........

r3540 | qldrob | 2007-01-05 07:29:08 +1000 (Fri, 05 Jan 2007) | 2 lines


Prepare for 2.2.0 release. Yay.

........

r3543 | qldrob | 2007-01-05 08:33:40 +1000 (Fri, 05 Jan 2007) | 2 lines


Fix md5 for 2.2.0

........

r3548 | qldrob | 2007-01-09 10:56:02 +1000 (Tue, 09 Jan 2007) | 2 lines


Convert mp3 MOH files to sln

........

................

r3562 | qldrob | 2007-01-09 16:23:56 -0500 (Tue, 09 Jan 2007) | 2 lines


Fix typo spotted by mtgll in dialparties.agi, thanks!

................

r3567 | gregmac | 2007-01-17 02:44:37 -0500 (Wed, 17 Jan 2007) | 2 lines


Fix #1694 - module_install() now returns true for already installed modules

................

r3568 | gregmac | 2007-01-17 02:55:37 -0500 (Wed, 17 Jan 2007) | 2 lines


recursive_copy() now tracks # files copied, shows files copied/skipped

................

r3570 | gregmac | 2007-01-17 03:15:50 -0500 (Wed, 17 Jan 2007) | 2 lines


Implement #1680

................

r3571 | gregmac | 2007-01-17 03:36:47 -0500 (Wed, 17 Jan 2007) | 2 lines


Added astman::connected() function to check if astman is connected or not

................

r3572 | gregmac | 2007-01-17 03:38:08 -0500 (Wed, 17 Jan 2007) | 2 lines


Fix engine_getinfo() to do better checking for astman connection (see r3571), added fallback to using exec('asterisk -V')

................

Files:

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  
    8181Patching Asterisk with softfax/spandsp. 
    8282 
    83   - Download the latest spandsp files from http://www.soft-switch.org 
     83  - Download the latest 0.2 spandsp files from http://www.soft-switch.org 
    8484  - cd /usr/src/spandsp-xxx 
    8585  - ./configure 
  • freepbx/branches/quickform/amp_conf/agi-bin/dialparties.agi

    r3406 r3573  
    9191  $rgmethod = "memoryhunt"; 
    9292  $mastermode = 1; 
    93 } else  
    94 } elseif ($rgmethod == "ringallv2-prim")  
    95 
     93} elseif ($rgmethod == "ringallv2-prim") { 
    9694  $rgmethod = "ringallv2"; 
    9795  $mastermode = 1; 
     96} else { 
    9897  $mastermode = 0; 
     98} 
    9999 
    100100// call confirmation only works with ringall and ringall-prim. The javascripts in ringgroups 
  • freepbx/branches/quickform/amp_conf/astetc/extensions.conf

    r3409 r3573  
    221221; to from-internal since it may be an outside line. 
    222222; 
    223 exten => docfu,1,GotoIf( $[ "foo${DB(AMPUSER/${CFUEXT}/device)}" = "foo" ], chlocal) 
     223exten => docfu,1,GotoIf( $[ "foo${DB(AMPUSER/${CFUEXT}/device)}" = "foo" ]?chlocal) 
    224224exten => docfu,n,Dial(Local/${CFUEXT}@ext-local,${RT},${DIAL_OPTIONS}) 
    225225exten => docfu,n,Return 
     
    434434; arg1 = trunk number, arg2 = number 
    435435[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 
     437exten => s,1,GotoIf($["${ARG3}" != ""]?PASSWD:NOPASSWD); arg3 is pattern password  
    441438exten => s,n(PASSWD),Authenticate(${ARG3})  
    442439exten => s,n(NOPASSWD),Macro(user-callerid,SKIPTTL)  
     
    448445exten => s,n,Set(DIAL_TRUNK=${ARG1}) 
    449446exten => 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 
     448exten => 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. 
     451exten => s,n(dialloop),GotoIf($["foo${DIALARR}"="foo"]?end) 
     452exten => s,n,Set(TRYDIAL=${CUT(DIALARR,%,1)}) 
     453exten => s,n,Set(DIALARR=${CUT(DIALARR,%,2-)}) 
     454exten => s,n,Dial(${TRYDIAL}) 
    513455exten => s,n(dodial),Dial(${DIALSTR}) 
    514456exten => s,n,NoOp(Dial exited in macro-enum-dialout with ${DIALSTATUS}) 
    515457 
    516458; 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. 
     461exten => s,n,GotoIf($[ $[ "${DIALSTATUS}" = "CHANUNAVAIL" ] | $[ "${DIALSTATUS}" = "CONGESTION" ] ]?dialloop) 
    523462 
    524463; If we're here, then it's BUSY or NOANSWER or something and well, deal with it. 
     
    526465 
    527466; 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) 
    533467 
    534468exten => s,n(nochans),NoOp(max channels used up) 
     
    542476 
    543477[macro-record-enable] 
    544 exten => s,1,GotoIf(${LEN(${BLINDTRANSFER})} > 0?2:4) 
     478exten => s,1,GotoIf($[${LEN(${BLINDTRANSFER})} > 0]?2:4) 
    545479exten => s,2,ResetCDR(w) 
    546480exten => s,3,StopMonitor() 
     
    787721 
    788722 
     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] 
     733exten => s,1,Noop(Trying custom SayText playback for "${ARG1}") 
     734exten => s,n,Playback(tts/custom-${MD5(${ARG1})}) 
     735exten => s,n,GotoIf($["${PLAYBACKSTATUS}"="SUCCESS"]?done) 
     736; call tts-saytext. This should set MACRO_OFFSET=101 if it was successful 
     737exten => s,n(tts),Macro(tts-saytext|${ARG1}|${ARG2}|${ARG3}) 
     738exten => s,n,Noop(No text-to-speech handler for SayText, cannot say "${ARG1}") 
     739exten => s,n,Goto(done) 
     740exten => 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] 
     745exten => s,1,Noop(Trying custom SayName playback for "${ARG1}") 
     746exten => s,n,Playback(tts/custom-${MD5(${ARG1})}) 
     747exten => s,n,GotoIf($["${PLAYBACKSTATUS}"="SUCCESS"]?done) 
     748; call tts-sayalpha. This should set MACRO_OFFSET=101 if it was successful 
     749exten => s,n(tts),Macro(tts-sayalpha|${ARG1}|${ARG2}|${ARG3}) 
     750exten => s,n,SayAlpha(${ARG1}) 
     751exten => s,n,Goto(done) 
     752exten => s,tts+101,Noop(tts handled sayname) 
     753 
     754; Say number is for saying numbers (eg "one thousand forty six")  
     755[macro-saynumber] 
     756exten => s,1,Noop(Trying custom SayNumber playback for "${ARG1}") 
     757exten => s,n,Playback(tts/custom-${MD5(${ARG1})}) 
     758exten => s,n,GotoIf($["${PLAYBACKSTATUS}"="SUCCESS"]?done) 
     759; call tts-saynumber. This should set MACRO_OFFSET=101 if it was successful 
     760exten => s,n(tts),Macro(tts-saynumber|${ARG1}|${ARG2}|${ARG3}) 
     761exten => s,n,SayNumber(${ARG1}) 
     762exten => s,n,Goto(done) 
     763exten => 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] 
     767exten => s,1,Noop(Trying custom SayDigits playback for "${ARG1}") 
     768exten => s,n,Playback(tts/custom-${MD5(${ARG1})}) 
     769exten => s,n,GotoIf($["${PLAYBACKSTATUS}"="SUCCESS"]?done) 
     770; call tts-saydigits. This should set MACRO_OFFSET=101 if it was successful 
     771exten => s,n(tts),Macro(tts-saydigits|${ARG1}|${ARG2}|${ARG3}) 
     772exten => s,n,SayDigits(${ARG1}) 
     773exten => s,n,Goto(done) 
     774 
     775 
    789776; 
    790777; ############################################################################ 
     
    932919exten => s,n,Macro(dial,${ARG1},${ARG2},${ARG3}) 
    933920 
     921; delete the variable, if we are here, we are done trying to dial and it may have been left around 
     922; 
     923exten => s,n,DBDel(RG/${RINGGROUP_INDEX}/${CHANNEL}) 
    934924exten => s,n,Set(USE_CONFIRMATION=) 
    935925exten => 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 around 
    938 ; 
    939 exten => s,n,DBDel(RG/${ARG4}/${CHANNEL}) 
    940926;------------------------------------------------------------------------ 
    941927 
  • freepbx/branches/quickform/amp_conf/astetc/sip.conf

    r1717 r3573  
    55[general] 
    66 
    7 port = 5060           ; Port to bind to (SIP is 5060) 
     7bindport = 5060           ; Port to bind to (SIP is 5060) 
    88bindaddr = 0.0.0.0    ; Address to bind to (all addresses on machine) 
    99disallow=all 
  • freepbx/branches/quickform/amp_conf/bin/fax-process.pl

    r3191 r3573  
    5353    $subject = $tmp; 
    5454  } 
     55  # Convert %20 to spaces, leave anythign else alone. 
     56  $subject =~ s/\%20/ /g; 
    5557  } elsif ($cmd eq "--type") { 
    5658  my $tmp = shift @ARGV; 
  • freepbx/branches/quickform/amp_conf/bin/module_admin

    r2820 r3573  
    5353 
    5454function init_amportal_environment($ampconfpath) { 
    55   global $amp_conf, $asterisk_conf, $db
     55  global $amp_conf, $asterisk_conf, $db, $astman
    5656   
    5757  if (!file_exists($ampconfpath)) { 
     
    6969  // include the functions file from WEBROOT 
    7070  include(AMP_BASE_INCLUDE_PATH.'/functions.inc.php'); 
     71  // include astman api 
     72  include(AMP_BASE_INCLUDE_PATH.'/common/php-asmanager.php'); 
    7173   
    7274  // now apply the real parse function (this makes some default assumptions and does a bit more error checking) 
     
    8183  require_once(AMP_BASE_INCLUDE_PATH.'/common/db_connect.php'); //PEAR must be installed 
    8284 
     85  $astman= new AGI_AsteriskManager(); 
     86  if (! $res = $astman->connect("127.0.0.1", $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"])) { 
     87    unset( $astman ); 
     88  } 
    8389} 
    8490 
  • freepbx/branches/quickform/amp_conf/bin/retrieve_conf

    r3028 r3573  
    4141  $file = file($filename); 
    4242  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)) { 
    4444      $conf[ $matches[1] ] = $matches[2]; 
    4545    } 
  • freepbx/branches/quickform/amp_conf/bin/retrieve_op_conf_from_mysql.pl

    r3191 r3573  
    7070      next; 
    7171    } 
     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 
    7287    if($line =~ /^[b]?channel\s*=\s*[>]?\s*([\d\,-]+)\s*$/) { 
    7388      $ampwildcard and next; 
     
    8499          $newlabel=~s/\%n/$lastlabelnum/; 
    85100          $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 
    86121           
    87           @zaplines=(@zaplines,[ "Zap/$c","$newlabel" ]); 
    88122        } 
    89123         
  • freepbx/branches/quickform/amp_conf/htdocs/admin/cdr/call-log.php

    r3029 r3573  
    88 
    99getpost_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')); 
     10if (($resulttype == null) || ($resulttype == "")) unset($resulttype); 
    1011 
    1112//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  
    290290  border:1px solid #ccc; 
    291291} 
     292.rnav ul li a { 
     293       display:block; 
     294} 
    292295.rnav ul li a.current { 
    293296  color:#ff8a00; 
  • freepbx/branches/quickform/amp_conf/htdocs/admin/common/php-asmanager.php

    r2710 r3573  
    290290    $this->logoff(); 
    291291    fclose($this->socket); 
     292  } 
     293 
     294  /**  
     295  * Check if the socket is connected 
     296  * 
     297  */ 
     298  function connected()  
     299  { 
     300    return (bool)$this->socket; 
    292301  } 
    293302   
  • freepbx/branches/quickform/amp_conf/htdocs/admin/config.php

    r3222 r3573  
    315315       
    316316      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")) ); 
    318318      } 
    319319      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")) ); 
    321321      } 
    322322 
  • freepbx/branches/quickform/amp_conf/htdocs/admin/extensions.class.php

    r3341 r3573  
    617617  } 
    618618  function output() { 
    619     return "dbGet(".$this->varname."=".$this->key.")"
     619    return 'Set('.$this->varname.'=${DB('.$this->key.')})'
    620620  } 
    621621} 
     
    627627  } 
    628628  function output() { 
    629     return "dbPut(".$this->key."=".$this->data.")"
     629    return 'Set(DB('.$this->key.')='.$this->data.')'
    630630  } 
    631631} 
  • freepbx/branches/quickform/amp_conf/htdocs/admin/featurecodes.class.php

    r2914 r3573  
    184184    return ($this->_enabled == 1); 
    185185  } 
     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  } 
    186199} 
    187200 
     
    225238} 
    226239 
     240// removes all features for a specific module 
     241function 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 
    227251function featurecodes_getFeatureCode($modulename, $featurename) { 
    228252  $fc_code = ''; 
     
    234258  return $fc_code != '' ? $fc_code : _('** MISSING FEATURE CODE **'); 
    235259} 
     260 
     261function 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 
    236272?> 
  • freepbx/branches/quickform/amp_conf/htdocs/admin/footer.php

    r3134 r3573  
    6666    $astman->send_request('Command', array('Command'=>'!/var/lib/asterisk/bin/retrieve_conf')); 
    6767    */   
     68 
     69    //reload MOH to get around 'reload' not actually doing that. 
     70    $astman->send_request('Command', array('Command'=>'moh reload')); 
     71 
    6872    //reload asterisk 
    6973    $astman->send_request('Command', array('Command'=>'reload'));  
  • freepbx/branches/quickform/amp_conf/htdocs/admin/functions.inc.php

    r3389 r3573  
    181181  switch ($amp_conf['AMPENGINE']) { 
    182182    case 'asterisk': 
    183       if ($astman) { 
     183      if (isset($astman) && $astman->connected()) { 
    184184        //get version 
    185185        $response = $astman->send_request('Command', array('Command'=>'show version')); 
    186186        $verinfo = $response['data']; 
    187187      } 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')
    190190      } 
    191191       
     
    196196        return array('engine'=>'asterisk', 'version' => $matches[1], 'additional' => $matches[4]); 
    197197      } 
     198 
     199      return array('engine'=>'ERROR-UNABLE-TO-CONNECT', 'version'=>'0', 'additional' => '0'); 
    198200    break; 
    199201  } 
    200   return false
     202  return array('engine'=>'ERROR-UNSUPPORTED-ENGINE-'.$amp_conf['AMPENGINE'], 'version'=>'0', 'additional' => '0')
    201203} 
    202204 
     
    17471749   
    17481750    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; 
    17501754    } 
    17511755     
  • freepbx/branches/quickform/amp_conf/htdocs/admin/modules/core/page.routing.php

    r3262 r3573  
    145145        // we do the loops separately so patterns are grouped together 
    146146         
    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        } 
    150151        // match NPA+NXX 
    151152        foreach ($xmldata['lca-data']['prefix'] as $prefix) { 
    152153          $dialpattern[] = $prefix['npa'].$prefix['nxx'].'XXXX'; 
    153154        } 
    154         // add NPA to 7-digits 
     155        // match 7-digits 
    155156        foreach ($xmldata['lca-data']['prefix'] as $prefix) { 
    156           $dialpattern[] = $prefix['npa'].'+'.$prefix['nxx'].'XXXX'; 
     157          $dialpattern[] = $prefix['nxx'].'XXXX'; 
    157158        } 
    158159 
     
    393394    </tr> 
    394395    <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>: 
    396401      <input id="npanxx" name="npanxx" type="hidden" /> 
    397402      <script language="javascript"> 
     
    403408        //var npanxx = prompt("What is your areacode + prefix (NPA-NXX)?", document.getElementById('areacode').value); 
    404409        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.").'")' ?>; 
    406411          if (npanxx == null) return; 
    407412        } 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\'").'")'?>); 
     
    470475      <td> 
    471476        <select onChange="insertCode();" id="inscode"> 
    472       <option value=""><?php echo _("Pick pre-defined patterns")?></option> 
     477      <option value=""><?php echo _("(pick one)")?></option> 
    473478      <option value="local"><?php echo _("Local 7 digit")?></option> 
    474479      <option value="local10"><?php echo _("Local 7/10 digit")?></option> 
  • freepbx/branches/quickform/amp_conf/htdocs/admin/modules/core/page.trunks.php

    r3270 r3573  
    117117          // - add 1 to anything else 
    118118          $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          } 
    119123          foreach ($xmldata['lca-data']['prefix'] as $prefix) { 
    120124            $dialrules[] = $prefix['npa'].$prefix['nxx'].'XXXX'; 
     
    368372        <td> 
    369373          <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> 
    371375          <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 dialing 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> 
     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> 
    373377          </span></a>: 
    374378        </td><td valign="top">&nbsp;&nbsp;<select id="autopop" name="autopop" onChange="changeAutoPop(); "> 
    375379            <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> 
    377381            <option value="remove"><?php echo _("Remove prefix from local numbers")?></option> 
    378             <option value="lookup7"><?php echo _("Setup dialing for local trunk (7-digit dialing)")?></option> 
    379             <option value="lookup10"><?php echo _("Setup dialing for 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> 
    380384          </select> 
    381385        </td> 
  • freepbx/branches/quickform/amp_conf/htdocs/admin/page.modules.php

    r3389 r3573  
    337337                                      '<ul><li>'.implode('</li><li>',$errors).'</li></ul>'); 
    338338            } else { 
    339               $actionstext[] = sprintf(_("%s %s will be upgraded to online verison %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']); 
    340340               
    341341            } 
  • freepbx/branches/quickform/amp_conf/sbin/amportal

    r3302 r3573  
    125125  if [ "$pid_length" == "0" -a "$pid_length" != "" ] 
    126126    then 
    127         killall -9 safe_opserver 
     127        ps -ef | grep safe_opserver | grep -v grep | awk '{print $2}' | xargs kill -9 
    128128        echo 
    129129        echo "-----------------------------------------------------" 
     
    157157    if [ "$pid_length" != "0" -a "$pid_length" != "" ] 
    158158      then 
    159         killall -9 safe_opserver 
    160         killall -9 op_server.pl 
     159        ps -ef | grep safe_opserver | grep -v grep | awk '{print $2}' | xargs kill 
     160        killall op_server.pl 
    161161        echo "FOP Server Stopped" 
    162162      fi 
     
    169169  killall -9 asterisk 
    170170  killall -9 mpg123 
    171   killall -9 safe_opserver 
     171  ps -ef | grep safe_opserver | grep -v grep | awk '{print $2}' | xargs kill -9 
    172172  killall -9 op_server.pl 
    173173} 
  • freepbx/branches/quickform/install_amp

    r3366 r3573  
    4545    '2.2.0rc1', 
    4646    '2.2.0rc2', 
     47    '2.2.0rc3', 
     48    '2.2.0', 
    4749    '2.3.0alpha' 
    4850  ); 
    4951 
    50 define("REQ_ASTERISK_VERSION", "1.2"); 
    5152 
    5253/********************************************************************************************************************/ 
     
    9798  out("                           it's a new installation)"); 
    9899  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')"); 
    100101} 
    101102 
     
    267268  global $asterisk_conf; 
    268269  global $install_moh; 
     270 
     271  // total # files, # actually copied 
     272  $num_files = $num_copied = 0; 
    269273   
    270274  if ($dirsource && ($dirsource[0] != "/")) $dirsource = "/".$dirsource; 
     
    336340        } 
    337341         
     342        $num_files++; 
    338343        if ($overwrite) { 
    339344          debug("copy ".$source." -> ".$destination); 
    340345          if (!$dryrun) { 
    341346            copy($source, $destination); 
     347            $num_copied++; 
    342348          } 
    343349        } else { 
     
    346352      } else { 
    347353        //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; 
    349357      } 
    350358    } 
     
    353361  if (isset($dir_handle)) closedir($dir_handle); 
    354362   
    355   return true
     363  return array($num_files, $num_copied)
    356364} 
    357365 
     
    627635// **** Parse out command-line options 
    628636$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"); 
    630638 
    631639$args = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), $shortopts, $longopts); 
     
    691699    break; 
    692700    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      } 
    693704      $pbx_engine = $arg[1]; 
    694       if ($pbx_engine != 'asterisk') { 
    695         fatal('Currently only "asterisk" is supported as a PBX engine'); 
    696       } 
    697705    break; 
    698706    case "--install-moh": 
     
    755763  out(AMP_CONF." does not exist, copying default"); 
    756764  copy("amportal.conf", AMP_CONF); 
     765  chmod(AMP_CONF, 0640);  
    757766  collect_settings(AMP_CONF, $dbhost, $new_username, $new_password, 'asterisk'); 
    758767 
     
    880889 
    881890// **** 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' 
     893outn("Checking for Asterisk version.."); 
    884894if (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"))  
    888899  out("OK"); 
    889900} elseif (preg_match('/^Asterisk SVN.+/', $verinfo)) { 
     
    893904  out("that your Asterisk version is compatible with FreePBX. Whilst this probably"); 
    894905  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" ); 
    896907  if ($override_astvers==false) { 
    897908    out("If you are SURE that this is compatible, you can re-run ".$argv[0]." with"); 
     
    10001011if ($install_files) 
    10011012{ 
    1002   outn("Installing new AMP files.."); 
     1013  outn("Installing new freePBX files.."); 
    10031014  $check_md5s=true; 
    10041015  $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); 
    10061017  if (!is_file("/etc/asterisk/voicemail.conf")) copy("/etc/asterisk/voicemail.conf.template","/etc/asterisk/voicemail.conf"); 
    10071018  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)"); 
    10091020} 
    10101021