Changeset 11434

Show
Ignore:
Timestamp:
02/17/11 20:23:31 (2 years ago)
Author:
p_lindheimer
Message:

closes #4224 adds feature code to pickup next available (though Asterisk is broken with this) and other changes to get connected call working and various other tweaks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.9/parking/functions.inc.php

    r11428 r11434  
    3333    $parkingcontext = isset($results['parkingcontext'])?$results['parkingcontext']:'parkedcalls'; 
    3434    $parkalertinfo  = isset($results['parkalertinfo'])?$results['parkalertinfo']:''; 
    35     $parkcid  = isset($results['parkcid'])?$results['parkcid']:''; 
     35    $parkcid  = isset($results['parkcid'])?trim($results['parkcid']):''; 
    3636    $parkingannmsg_id   = isset($results['parkingannmsg_id'])?$results['parkingannmsg_id']:''; 
    3737    $goto   = isset($results['goto'])?$results['goto']:''; 
     
    4343 
    4444    if ($parkingenabled) { 
    45       // TODO: lookup ampportal.conf variables for this, don't hard code 
    46       // first write features_additional.inc include file 
    47       // 
     45 
    4846      $core_conf->addFeatureGeneral('parkext',$parkext); 
    4947      $core_conf->addFeatureGeneral('parkpos',$parkpos1."-".$parkpos2); 
    5048      $core_conf->addFeatureGeneral('context',$parkingcontext); 
     49 
     50      if (!$ast_ge_18) { 
     51        $ext->addInclude('from-internal-additional', $parkingcontext); 
     52      } 
    5153 
    5254      if ($parkingtime) { 
     
    98100        $core_conf->addFeatureGeneral('comebacktoorigin','no'); 
    99101 
    100         $core_conf->addFeatureGeneral('parkinghints',$parkinghints); 
    101102        $core_conf->addFeatureGeneral('parkedplay',isset($results['parkedplay']) ? $results['parkedplay'] : 'both'); 
    102103        $core_conf->addFeatureGeneral('parkedcalltransfers',isset($results['parkedcalltransfers']) ? $results['parkedcalltransfers'] : 'caller'); 
     
    115116         } 
    116117        if ($parkcid) { 
    117           $ext->add($contextname, $exten, '', new ext_set('CALLERID(name)', $parkcid.'${CALLERID(name)}')); 
     118          $ext->add($contextname, $exten, '', new ext_execif('$["${CALLERID(name):0:' .strlen($parkcid). '}" != "' .$parkcid. '"]','Set','CALLERID(name)=' .$parkcid. '${CALLERID(name)}')); 
    118119        } 
    119120        if ($parkingannmsg_id != '') { 
     
    137138      } 
    138139 
    139       // Asterisk 1.4 requires hints to be generated for parking 
    140       // 
    141       // TODO: parkinghints = yes 1.6.2+ 
     140      // Although 1.6.2+ can generate the hints, we are going to do it since we need to make some other changes 
     141      // and thus don't want to include the default context in 1.8. Also, when we get to multi-parking lots we 
     142      // need to generate their hints anyhow. 
    142143      // 
    143       if ($ast_lt_162 && $parkinghints == 'yes') { 
     144      if ($parkinghints == 'yes' || $ast_ge_18) { 
    144145        $parkhints = 'park-hints'; 
    145         $ext->addInclude('from-internal-additional', $parkhints); // Add the include from from-internal 
     146        $ext->addInclude('from-internal-additional', $parkhints); 
     147        $ext->addInclude($parkhints, $parkingcontext); 
     148        $hv_all = ''; 
    146149        for ($slot = $parkpos1; $slot <= $parkpos2; $slot++) { 
    147           $ext->addHint($parkhints, $slot, "park:$slot@$parkingcontext"); 
    148           $ext->add($parkhints, $slot, '', new ext_parkedcall($slot)); 
     150          if ($ast_ge_18) { 
     151            $ext->add($parkhints, $slot, '', new ext_macro('parked-call',$slot)); 
     152          } else { 
     153            $ext->add($parkhints, $slot, '', new ext_parkedcall($slot)); 
     154          } 
     155          if ($parkinghints == 'yes') { 
     156            $hv = "park:$slot@$parkingcontext"; 
     157            $hv_all .= $hv.'&'; 
     158            $ext->addHint($parkhints, $slot, $hv); 
     159          } 
    149160        } 
     161 
     162        $fcc = new featurecode('parking', 'parkedcall'); 
     163        $pc_code = $fcc->getCodeActive(); 
     164        unset($fcc); 
     165 
     166        if ($pc_code != '') { 
     167          if ($ast_ge_18) { 
     168            $ext->add($parkhints, $pc_code, '', new ext_macro('parked-call','')); 
     169          } else { 
     170            $ext->add($parkhints, $pc_code, '', new ext_parkedcall()); 
     171          } 
     172          if ($parkinghints == 'yes') { 
     173            $hv = rtrim($hv_all,'&'); 
     174            $ext->addHint($parkhints, $pc_code, $hv); 
     175          } 
     176        } 
     177        $pc = 'macro-parked-call'; 
     178        $exten = 's'; 
     179        $ext->add($pc, $exten, '', new ext_set('CCSS_SETUP','TRUE')); 
     180        $ext->add($pc, $exten, '', new ext_macro('user-callerid')); 
     181        $ext->add($pc, $exten, '', new ext_gotoif('$["${ARG1}" = "" | ${DIALPLAN_EXISTS(parkedcalls,${ARG1},1)} = 1]','parkedcall')); 
     182        $ext->add($pc, $exten, '', new ext_resetcdr('')); 
     183        $ext->add($pc, $exten, '', new ext_nocdr('')); 
     184        $ext->add($pc, $exten, '', new ext_wait('1')); 
     185        $ext->add($pc, $exten, '', new ext_noop_trace('User: ${CALLERID(all)} tried to pickup non-existent Parked Call Slot ${ARG1}')); 
     186        $ext->add($pc, $exten, '', new ext_playback('pbx-invalidpark')); 
     187        $ext->add($pc, $exten, '', new ext_wait('1')); 
     188        $ext->add($pc, $exten, '', new ext_hangup('')); 
     189        $ext->add($pc, $exten, 'parkedcall', new ext_noop_trace('User: ${CALLERID(all)} picking up Parked Call Slot ${ARG1}')); 
     190        $ext->add($pc, $exten, 'parkedcall', new ext_parkedcall('${ARG1}')); 
    150191      } 
    151192    break; 
  • modules/branches/2.9/parking/install.php

    r11426 r11434  
    22global $db; 
    33global $amp_conf; 
     4//for translation only 
     5if (false) { 
     6_("Pickup ParkedCall Any"); 
     7} 
     8 
     9$fcc = new featurecode('parking', 'parkedcall'); 
     10$fcc->setDescription('Pickup ParkedCall Any'); 
     11$fcc->setDefault('*85'); 
     12$fcc->setProvideDest(); 
     13$fcc->update(); 
     14unset($fcc); 
    415 
    516$sql = " 
     
    99110$set['type'] = CONF_TYPE_BOOL; 
    100111$freepbx_conf->define_conf_setting('PARKINGPATCH',$set,true); 
     112 
  • modules/branches/2.9/parking/module.xml

    r11181 r11434  
    33  <repo>standard</repo> 
    44  <name>Parking Lot</name> 
    5   <version>2.9.0.1</version> 
     5  <version>2.9.0.2</version> 
    66  <publisher>FreePBX</publisher> 
    77  <license>GPLv2+</license> 
     
    1414  </menuitems> 
    1515  <changelog> 
     16    *2.9.0.2* #4224 
    1617    *2.9.0.1* #4740 
    1718    *2.9.0.0* #4655