Changeset 6049
- Timestamp:
- 07/18/08 12:53:52 (5 years ago)
- Files:
-
- modules/branches/2.5/core/agi-bin/dialparties.agi (modified) (1 diff)
- modules/branches/2.5/core/functions.inc.php (modified) (7 diffs)
- modules/branches/2.5/core/page.did.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.5/core/agi-bin/dialparties.agi
r5895 r6049 216 216 } 217 217 $already_screened = get_var( $AGI, "SCREEN" ); // If this is the second pass through dialparties.agi, we don't want to double-screen the caller 218 $from_outside = get_var( $AGI, "FROM_DID" ); 219 $astvarlibdir = get_var( $AGI, "ASTVARLIBDIR" ); 218 220 // If this isn't a ring group, check to see if the user has call screening on 219 221 $count = 0; 220 222 foreach ($ext as $k) { 221 223 // Only screen calls if the primary extension is called, or it's follow-me is called, not ring groups 222 if(!$already_screened && $count == 0 && ($rgmethod == "none" || $fmgrp == $k)) { 223 $from_outside = get_var( $AGI, "FROM_DID" ); 224 225 if($from_outside) { // Don't screen internal calls 226 $screen_call = $AGI->database_get('AMPUSER', $k."/screen"); 227 $screen_call = $screen_call['data']; 228 if (strlen($screen_call)) { 229 if($screen_call == "nomemory") { // This can't go in the dialplan because macro-dial can get called multiple times 230 exec("rm -f /var/lib/asterisk/sounds/priv-callerintros/$cidnum.*"); 231 224 if(($count == 0) && ($from_outside != '') && ($rgmethod == "none" || $fmgrp == $k) && !$already_screened) { 225 $screen_call = $AGI->database_get('AMPUSER', $k."/screen"); 226 $screen_call = $screen_call['data']; 227 if (strlen($screen_call)) { 228 if($screen_call == "nomemory" && trim($cidum) != '') { // This can't go in the dialplan because macro-dial can get called multiple times 229 // Do a security check, we only numeric callerid numbers, otherwise code could be incjected in a cidnum field 230 // that could result in an arbitrary command being executed in this remove operation. 231 // TODO: why are we no using php unlink for this?, less overhead 232 // 233 if (ctype_digit($cidnum)) { 234 exec("rm -f $astvarlibdir/sounds/priv-callerintros/$cidnum.*"); 232 235 } 233 $screen = true; 234 $AGI->set_variable('__SCREEN',$screen_call); 235 $AGI->set_variable('__SCREEN_EXTEN',$k); 236 debug("Extension $k has call screening on", 1); 237 } 238 else { 239 debug("Extension $k has call screening off", 3); 240 } 236 } 237 $screen = true; 238 $AGI->set_variable('__SCREEN',$screen_call); 239 $AGI->set_variable('__SCREEN_EXTEN',$k); 240 debug("Extension $k has call screening on", 4); 241 } else { 242 debug("Extension $k has call screening off", 4); 241 243 } 242 244 } modules/branches/2.5/core/functions.inc.php
r6047 r6049 2085 2085 $astman->database_put("AMPUSER",$extension."/cidname","\"".addslashes($name)."\""); 2086 2086 $astman->database_put("AMPUSER",$extension."/voicemail","\"".$voicemail."\""); 2087 if($privacyman == "0") {2088 $astman->database_del("AMPUSER",$extension."/screen");2089 }2090 if($privacyman == "2") {2091 $astman->database_put("AMPUSER",$extension."/screen","\"nomemory\"");2092 }2093 if($privacyman == "3") {2094 $astman->database_put("AMPUSER",$extension."/screen","\"memory\"");2095 }2096 2097 2087 } 2098 2088 return true; … … 2582 2572 $astman->database_put("AMPUSER",$extension."/cidnum",$cid_masquerade); 2583 2573 $astman->database_put("AMPUSER",$extension."/voicemail","\"".isset($voicemail)?$voicemail:''."\""); 2584 if($privacyman == "2") { 2585 $astman->database_put("AMPUSER",$extension."/screen","\"nomemory\""); 2586 } 2587 if($privacyman == "3") { 2588 $astman->database_put("AMPUSER",$extension."/screen","\"memory\""); 2574 switch ($call_screen) { 2575 case '0': 2576 $astman->database_del("AMPUSER",$extension."/screen"); 2577 break; 2578 case 'nomemory': 2579 $astman->database_put("AMPUSER",$extension."/screen","\"nomemory\""); 2580 break; 2581 case 'memory': 2582 $astman->database_put("AMPUSER",$extension."/screen","\"memory\""); 2583 break; 2584 default: 2589 2585 } 2590 2586 … … 2703 2699 $cid_masquerade=$astman->database_get("AMPUSER",$extension."/cidnum"); 2704 2700 $results['cid_masquerade'] = (trim($cid_masquerade) != "")?$cid_masquerade:$extension; 2701 2702 $call_screen=$astman->database_get("AMPUSER",$extension."/screen"); 2703 $results['call_screen'] = (trim($call_screen) != "")?$call_screen:'0'; 2705 2704 } else { 2706 2705 fatal("Cannot connect to Asterisk Manager with ".$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"]); … … 2727 2726 } 2728 2727 if ($astman && !$editmode) { 2728 // TODO just change this to delete everything 2729 2729 $astman->database_del("AMPUSER",$extension."/password"); 2730 2730 $astman->database_del("AMPUSER",$extension."/ringtimer"); … … 2736 2736 $astman->database_del("AMPUSER",$extension."/voicemail"); 2737 2737 $astman->database_del("AMPUSER",$extension."/device"); 2738 $astman->database_del("AMPUSER",$extension."/screen"); 2738 2739 } 2739 2740 } … … 3989 3990 $currentcomponent->setoptlistopts('callwaiting', 'sort', false); 3990 3991 3992 $currentcomponent->addoptlistitem('call_screen', '0', _("Disable")); 3993 $currentcomponent->addoptlistitem('call_screen', 'nomemory', _("Screen Caller: No Memory")); 3994 $currentcomponent->addoptlistitem('call_screen', 'memory', _("Screen Caller: Memory")); 3995 $currentcomponent->setoptlistopts('call_screen', 'sort', false); 3996 3991 3997 $currentcomponent->addoptlistitem('ringtime', '0', 'Default'); 3992 3998 for ($i=1; $i <= 120; $i++) { … … 4152 4158 } 4153 4159 } 4154 $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));4155 4160 $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)); 4161 $currentcomponent->addguielem($section, new gui_selectbox('call_screen', $currentcomponent->getoptlist('call_screen'), $call_screen, _("Call Screening"),_("Call Screening requires external callers to say their name, which will be played back to the user and allow the user to accept or reject the call. Screening with memory only verifies a caller for their caller-id once. Screening without memory always requires a caller to say their name. Either mode will always announce the caller based on the last introduction saved with that callerid. If any user on the system uses the memory option, when that user is called, the caller will be required to re-introduce themselves and all users on the system will have that new introduction associated with the caller's CallerId."), false)); 4156 4162 4157 4163 $section = _("Assigned DID/CID"); 4158 4164 $currentcomponent->addguielem($section, new gui_textbox('newdid_name', $newdid_name, 'DID Description', _("A description for this DID, such as \"Fax\"")), 4); 4159 $currentcomponent->addguielem($section, new gui_textbox('newdid', $newdid, 'Add Inbound DID', _("A direct DID that is associated with this extension. The DID should be in the same format as provided by the provider (e.g. full number, 4 digits for 10x4, etc).<br><br>Format should be: <b>XXXXXXXXXX</b><br><br>.An optional CID can also be associated with this DID by setting the next box"),'!isDialpattern()',$msgInvalidDIDNum,true), 4);4160 $currentcomponent->addguielem($section, new gui_textbox('newdidcid', $newdidcid, 'Add Inbound CID', _("Add a CID for more specific DID + CID routing. A CID must be specified in the above Add DID box"),'!isDialpattern()',$msgInvalidCIDNum,true), 4);4165 $currentcomponent->addguielem($section, new gui_textbox('newdid', $newdid, _("Add Inbound DID"), _("A direct DID that is associated with this extension. The DID should be in the same format as provided by the provider (e.g. full number, 4 digits for 10x4, etc).<br><br>Format should be: <b>XXXXXXXXXX</b><br><br>.An optional CID can also be associated with this DID by setting the next box"),'!isDialpattern()',$msgInvalidDIDNum,true), 4); 4166 $currentcomponent->addguielem($section, new gui_textbox('newdidcid', $newdidcid, _("Add Inbound CID"), _("Add a CID for more specific DID + CID routing. A CID must be specified in the above Add DID box"),'!isDialpattern()',$msgInvalidCIDNum,true), 4); 4161 4167 4162 4168 $dids = core_did_list('extension'); modules/branches/2.5/core/page.did.php
r5953 r6049 239 239 <tr><td colspan="2"><h5><?php echo _("Privacy")?><hr></h5></td></tr> 240 240 <tr> 241 <td><a href="#" class="info"><?php echo _("Privacy Manager")?><span><?php echo _('If no Caller ID is sent, Privacy Manager will asks the caller to enter their 10 digit phone number. The caller is given 3 attempts. ')?></span></a>:</td>241 <td><a href="#" class="info"><?php echo _("Privacy Manager")?><span><?php echo _('If no Caller ID is sent, Privacy Manager will asks the caller to enter their 10 digit phone number. The caller is given 3 attempts. The number of digits and attempts can be defined in privacy.conf. If a user has Call Screening enabled, the incoming caller will be asked to enter their CallerId here if enabled, and then to say their name once determined that the called user requires it.')?></span></a>:</td> 242 242 <td> 243 243 <select name="privacyman" tabindex="<?php echo ++$tabindex;?>">
