Changeset 11434
- Timestamp:
- 02/17/11 20:23:31 (2 years ago)
- Files:
-
- modules/branches/2.9/parking/functions.inc.php (modified) (5 diffs)
- modules/branches/2.9/parking/install.php (modified) (2 diffs)
- modules/branches/2.9/parking/module.xml (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.9/parking/functions.inc.php
r11428 r11434 33 33 $parkingcontext = isset($results['parkingcontext'])?$results['parkingcontext']:'parkedcalls'; 34 34 $parkalertinfo = isset($results['parkalertinfo'])?$results['parkalertinfo']:''; 35 $parkcid = isset($results['parkcid'])? $results['parkcid']:'';35 $parkcid = isset($results['parkcid'])?trim($results['parkcid']):''; 36 36 $parkingannmsg_id = isset($results['parkingannmsg_id'])?$results['parkingannmsg_id']:''; 37 37 $goto = isset($results['goto'])?$results['goto']:''; … … 43 43 44 44 if ($parkingenabled) { 45 // TODO: lookup ampportal.conf variables for this, don't hard code 46 // first write features_additional.inc include file 47 // 45 48 46 $core_conf->addFeatureGeneral('parkext',$parkext); 49 47 $core_conf->addFeatureGeneral('parkpos',$parkpos1."-".$parkpos2); 50 48 $core_conf->addFeatureGeneral('context',$parkingcontext); 49 50 if (!$ast_ge_18) { 51 $ext->addInclude('from-internal-additional', $parkingcontext); 52 } 51 53 52 54 if ($parkingtime) { … … 98 100 $core_conf->addFeatureGeneral('comebacktoorigin','no'); 99 101 100 $core_conf->addFeatureGeneral('parkinghints',$parkinghints);101 102 $core_conf->addFeatureGeneral('parkedplay',isset($results['parkedplay']) ? $results['parkedplay'] : 'both'); 102 103 $core_conf->addFeatureGeneral('parkedcalltransfers',isset($results['parkedcalltransfers']) ? $results['parkedcalltransfers'] : 'caller'); … … 115 116 } 116 117 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)}')); 118 119 } 119 120 if ($parkingannmsg_id != '') { … … 137 138 } 138 139 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. 142 143 // 143 if ($ ast_lt_162 && $parkinghints == 'yes') {144 if ($parkinghints == 'yes' || $ast_ge_18) { 144 145 $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 = ''; 146 149 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 } 149 160 } 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}')); 150 191 } 151 192 break; modules/branches/2.9/parking/install.php
r11426 r11434 2 2 global $db; 3 3 global $amp_conf; 4 //for translation only 5 if (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(); 14 unset($fcc); 4 15 5 16 $sql = " … … 99 110 $set['type'] = CONF_TYPE_BOOL; 100 111 $freepbx_conf->define_conf_setting('PARKINGPATCH',$set,true); 112 modules/branches/2.9/parking/module.xml
r11181 r11434 3 3 <repo>standard</repo> 4 4 <name>Parking Lot</name> 5 <version>2.9.0. 1</version>5 <version>2.9.0.2</version> 6 6 <publisher>FreePBX</publisher> 7 7 <license>GPLv2+</license> … … 14 14 </menuitems> 15 15 <changelog> 16 *2.9.0.2* #4224 16 17 *2.9.0.1* #4740 17 18 *2.9.0.0* #4655
