Changeset 5866
- Timestamp:
- 07/01/08 21:38:02 (2 months ago)
- Files:
-
- modules/branches/2.5/core/agi-bin/user_login_out.agi (modified) (2 diffs)
- modules/branches/2.5/core/functions.inc.php (modified) (2 diffs)
- modules/branches/2.5/core/module.xml (modified) (1 diff)
- modules/branches/2.5/core/sounds (added)
- modules/branches/2.5/core/sounds/featurecode.sln (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.5/core/agi-bin/user_login_out.agi
r5592 r5866 30 30 $ampmgrpass = get_var( "AMPMGRPASS" ); 31 31 $astspooldir = get_var( "ASTSPOOLDIR" ); 32 $ast_version = get_var("ASTVERSION"); 33 $dnd_devstate = get_var( "DNDDEVSTATE" ) == "TRUE" ? true : false; 34 $intercom_code = get_var( "INTERCOMCODE" ); 35 36 $ast_version14 = version_compare($ast_vversion, "1.4", "ge"); 37 32 38 /* 33 39 $ampmgruser = 'admin'; … … 179 185 global $astman; 180 186 global $agi; 187 global $dnd_devstate; 188 global $intercom_code; 189 global $ast_version14; 190 191 // If Asterisk version >= 1.4, syntax change is 'dialplan add extension ...' vs. 'add extension ...' 192 $dp_pre = ($ast_version14) ? 'dialplan ' : ''; 181 193 182 194 if ($devices) { 183 195 $dial_string = get_dial_string($devices); 196 if ($dnd_devstate) { 197 $dial_string .= "&Custom:DND$user"; 198 } 184 199 debug("Setting user $user hint to $dial_string",5); 185 $response = $astman->send_request('Command',array('Command'=>"add extension {$user},hint,{$dial_string} into ext-local replace")); 200 $response = $astman->send_request('Command',array('Command'=>$dp_pre."add extension {$user},hint,{$dial_string} into ext-local replace")); 201 if ($intercom_code != 'nointercom' && $intercom_code != '') { 202 $response = $astman->send_request('Command',array('Command'=>$dp_pre."add extension {$intercom_code}{$user},hint,{$dial_string} into ext-local replace")); 203 } 186 204 } else { 187 205 debug("Removing hint for user $user",5); 188 $response = $astman->send_request('Command',array('Command'=>"remove extension {$user}@ext-local hint")); 206 $response = $astman->send_request('Command',array('Command'=>$dp_pre."remove extension {$user}@ext-local hint")); 207 if ($intercom_code != 'nointercom' && $intercom_code != '') { 208 $response = $astman->send_request('Command',array('Command'=>$dp_pre."remove extension {$intercom_code}{$user}@ext-local hint")); 209 } 189 210 } 190 211 } modules/branches/2.5/core/functions.inc.php
r5817 r5866 936 936 // which require "execincludes=yes" to be set in the [options] section of asterisk.conf 937 937 // 938 939 $fcc = new featurecode('paging', 'intercom-prefix'); 940 $intercom_code = $fcc->getCodeActive(); 941 unset($fcc); 942 943 $intercom_code = ($intercom_code == '') ? 'nointercom' : $intercom_code; 944 945 // Pass the code so agi scripts like user_login_logout know to generate hints 946 // 947 $ext->addGlobal('INTERCOMCODE',$intercom_code); 948 938 949 if ($amp_conf['DYNAMICHINTS']) { 939 $ext->addExec('ext-local',$amp_conf['AMPBIN'].'/generate_hints.php'); 950 if ($amp_conf['USEDEVSTATE'] && function_exists('donotdisturb_get_config')) { 951 $add_dnd = ' dnd'; 952 } else { 953 $add_dnd = ''; 954 } 955 $ext->addExec('ext-local',$amp_conf['AMPBIN'].'/generate_hints.php '.$intercom_code.$add_dnd); 940 956 } 941 957 $userlist = core_users_list(); … … 966 982 if (!$amp_conf['DYNAMICHINTS']) { 967 983 $hint = core_hint_get($exten['extension']); 984 $dnd_string = ($amp_conf['USEDEVSTATE'] && function_exists('donotdisturb_get_config')) ? "&Custom:DND".$exten['extension'] : ''; 968 985 if (!empty($hint)) { 969 $ext->addHint('ext-local', $exten['extension'], $hint); 986 $ext->addHint('ext-local', $exten['extension'], $hint.$dnd_string); 987 if ($intercom_code != '') { 988 $ext->addHint('ext-local', $intercom_code.$exten['extension'], $hint.$dnd_string); 989 } 990 } else if ($dnd_string) { 991 $ext->addHint('ext-local', $exten['extension'], "&Custom:DND".$exten['extension']); 992 if ($intercom_code != '') { 993 $ext->addHint('ext-local', $intercom_code.$exten['extension'], "&Custom:DND".$exten['extension']); 994 } 970 995 } 971 996 } modules/branches/2.5/core/module.xml
r5851 r5866 8 8 <canuninstall>no</canuninstall> 9 9 <changelog> 10 *2.5.0.0* Added support for DND and Intercom hints in static and dynamic hints mode 10 11 *2.4.0.4* #2857, #2848, #2791, #2449 11 12 *2.4.0.3* #2851 forwarded/followme/ringgroup calls originating from outside fail
