Changeset 11036
- Timestamp:
- 01/20/11 14:17:22 (2 years ago)
- Files:
-
- freepbx/trunk/libfreepbx.install.php (modified) (1 diff)
- modules/branches/2.9/core/functions.inc.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/trunk/libfreepbx.install.php
r11033 r11036 718 718 $freepbx_conf->define_conf_setting('CFRINGTIMERDEFAULT',$set); 719 719 unset($opts); 720 721 // CONCURRENCYLIMITDEFAULT 722 $opts = array(); 723 for ($i=0;$i<=120;$i++) { 724 $opts[]=$i; 725 } 726 $set['value'] = '0'; 727 $set['options'] = $opts; 728 $set['name'] = 'Extension Concurrency Limit'; 729 $set['description'] = 'Default maximum number of outbound simultaneous calls that an extension can make. This is also very useful as a Security Protection against a system that has been compromised. It will limit the number of simultaneous calls that can be made on the compromised extension. This default is used when an extension is created. A default of 0 means no limit.'; 730 $set['emptyok'] = 0; 731 $set['type'] = CONF_TYPE_SELECT; 732 $freepbx_conf->define_conf_setting('CONCURRENCYLIMITDEFAULT',$set); 733 unset($opts); 720 734 721 735 // modules/branches/2.9/core/functions.inc.php
r11023 r11036 1790 1790 // CID part of the dialplan will not get executed 1791 1791 if (!isset($add_extra_pri1[$fpattern['base_pattern']])) { 1792 $ext->add($context, $fpattern['base_pattern'], '', new ext_macro('user-callerid, SKIPTTL'));1792 $ext->add($context, $fpattern['base_pattern'], '', new ext_macro('user-callerid,LIMIT')); 1793 1793 $add_extra_pri1[$fpattern['base_pattern']] = true; 1794 1794 } 1795 1795 if ($fpattern['base_pattern'] != $exten) { 1796 $ext->add($context, $exten, '', new ext_macro('user-callerid, SKIPTTL'));1796 $ext->add($context, $exten, '', new ext_macro('user-callerid,LIMIT')); 1797 1797 } 1798 1798 $ext->add($context, $exten, '', new ext_noop_trace(sprintf(_('Calling Out Route: %s'),$route['name']),1)); … … 2337 2337 $ext->add($context, $exten, '', new ext_set('AMPUSERCID', '${IF($["${DB_EXISTS(AMPUSER/${AMPUSER}/cidnum)}" = "1"]?${DB_RESULT}:${AMPUSER})}')); 2338 2338 $ext->add($context, $exten, '', new ext_set('CALLERID(all)', '"${AMPUSERCIDNAME}" <${AMPUSERCID}>')); 2339 2340 $ext->add($context, $exten, '', new ext_noop_trace('Current Concurrency Count for ${AMPUSER}: ${GROUP_COUNT(${AMPUSER}@concurrency_limit)}, User Limit: ${DB(AMPUSER/${AMPUSER}/concurrency_limit)}')); 2341 $ext->add($context, $exten, '', new ext_gotoif('$["${ARG1}"="LIMIT" & ${LEN(${AMPUSER})} & "${DB(AMPUSER/${AMPUSER}/concurrency_limit)}">"0" & ${GROUP_COUNT(${AMPUSER}@concurrency_limit)}>=${DB(AMPUSER/${AMPUSER}/concurrency_limit)}]', 'limit')); 2342 $ext->add($context, $exten, '', new ext_execif('$["${ARG1}"="LIMIT" & ${LEN(${AMPUSER})}]', 'Set', 'GROUP(concurrency_limit)=${AMPUSER}')); 2339 2343 /* 2340 2344 * This is where to splice in things like setting the language based on a user's astdb setting, 2341 2345 * or where you might set the CID account code based on a user instead of the device settings. 2342 2346 */ 2343 $ext->add($context, $exten, 'report', new ext_gotoif('$[ "${ARG1}" = "SKIPTTL" ]', 'continue')); 2347 2348 $ext->add($context, $exten, 'report', new ext_gotoif('$[ "${ARG1}" = "SKIPTTL" | "${ARG1}" = "LIMIT" ]', 'continue')); 2344 2349 $ext->add($context, $exten, 'report2', new ext_set('__TTL', '${IF($["foo${TTL}" = "foo"]?64:$[ ${TTL} - 1 ])}')); 2345 2350 $ext->add($context, $exten, '', new ext_gotoif('$[ ${TTL} > 0 ]', 'continue')); 2346 2351 $ext->add($context, $exten, '', new ext_wait('${RINGTIMER}')); // wait for a while, to give it a chance to be picked up by voicemail 2347 2352 $ext->add($context, $exten, '', new ext_answer()); 2348 $ext->add($context, $exten, '', new ext_wait(' 2'));2353 $ext->add($context, $exten, '', new ext_wait('1')); 2349 2354 $ext->add($context, $exten, '', new ext_playback('im-sorry&an-error-has-occured&with&call-forwarding')); 2355 $ext->add($context, $exten, '', new ext_macro('hangupcall')); 2356 $ext->add($context, $exten, 'limit', new ext_answer()); 2357 $ext->add($context, $exten, '', new ext_wait('1')); 2358 $ext->add($context, $exten, '', new ext_playback('beep&im-sorry&your&simul-call-limit-reached&goodbye')); 2350 2359 $ext->add($context, $exten, '', new ext_macro('hangupcall')); 2351 2360 $ext->add($context, $exten, '', new ext_congestion(20)); … … 4534 4543 $astman->database_put("AMPUSER",$extension."/ringtimer",isset($ringtimer)?$ringtimer:''); 4535 4544 $astman->database_put("AMPUSER",$extension."/cfringtimer",isset($cfringtimer)?$cfringtimer:0); 4545 $astman->database_put("AMPUSER",$extension."/concurrency_limit",isset($concurrency_limit)?$concurrency_limit:0); 4536 4546 $astman->database_put("AMPUSER",$extension."/noanswer",isset($noanswer)?$noanswer:''); 4537 4547 $astman->database_put("AMPUSER",$extension."/recording",isset($recording)?$recording:''); … … 4651 4661 4652 4662 $results['cfringtimer'] = (int) $astman->database_get("AMPUSER",$extension."/cfringtimer"); 4663 $results['concurrency_limit'] = (int) $astman->database_get("AMPUSER",$extension."/concurrency_limit"); 4653 4664 } else { 4654 4665 die_freepbx("Cannot connect to Asterisk Manager with ".$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"]); … … 5871 5882 $currentcomponent->addoptlistitem('cfringtime', '0', _("Default")); 5872 5883 $currentcomponent->addoptlistitem('cfringtime', '-1', _("Always")); 5884 $currentcomponent->addoptlistitem('concurrency_limit', '0', _("No Limit")); 5873 5885 for ($i=1; $i <= 120; $i++) { 5874 5886 $currentcomponent->addoptlistitem('ringtime', "$i", "$i"); 5875 5887 $currentcomponent->addoptlistitem('cfringtime', "$i", "$i"); 5888 $currentcomponent->addoptlistitem('concurrency_limit', "$i", "$i"); 5876 5889 } 5877 5890 $currentcomponent->setoptlistopts('ringtime', 'sort', false); 5878 5891 $currentcomponent->setoptlistopts('cfringtime', 'sort', false); 5892 $currentcomponent->setoptlistopts('concurrency_limit', 'sort', false); 5879 5893 5880 5894 // Special CID handling to deal with Private, etc. … … 6052 6066 } 6053 6067 } 6068 6069 $concurrency_limit = isset($concurrency_limit) ? $concurrency_limit : $amp_conf['CONCURRENCYLIMITDEFAULT']; 6070 $currentcomponent->addguielem($section, new gui_selectbox('concurrency_limit', $currentcomponent->getoptlist('concurrency_limit'), $concurrency_limit, _("Outbound Councurrency Limit"), _("Maximum number of outbound simultaneous calls that an extension can make. This is also very useful as a Security Protection against a system that has been compromised. It will limit the number of simultaneous calls that can be made on the compromised extension."), false)); 6071 6054 6072 $currentcomponent->addguielem($section, new gui_selectbox('callwaiting', $currentcomponent->getoptlist('callwaiting'), $callwaiting, _("Call Waiting"), _("Set the initial/current Call Waiting state for this user's extension"), false)); 6055 6073 if (function_exists('paging_get_config')) {
