Changeset 3874
- Timestamp:
- 03/25/07 15:22:08 (6 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/trunk/amp_conf/astetc/extensions.conf
r3838 r3874 926 926 exten => s,n,Set(AMPUSERCIDNAME=${DB(AMPUSER/${AMPUSER}/cidname)}) 927 927 exten => s,n,GotoIf($["x${AMPUSERCIDNAME:1:2}" = "x"]?report) 928 exten => s,n,Set(CALLERID(all)=${AMPUSERCIDNAME} <${AMPUSER}>) 928 929 ; user may masquerade as a different user internally, so set the internal cid as indicated 930 ; but keep the REALCALLERID which is used to determine their true identify and lookup info 931 ; during outbound calls. 932 ; 933 exten => s,n,Set(AMPUSERCID=${IF($["${DB_EXISTS(AMPUSER/${AMPUSER}/cidnum)}" = "1"]?${DB_RESULT}:${AMPUSER})}) 934 exten => s,n,Set(CALLERID(all)=${AMPUSERCIDNAME} <${AMPUSERCID}>) 929 935 exten => s,n,Set(REALCALLERIDNUM=${DB(DEVICE/${REALCALLERIDNUM}/user)}) 930 936 exten => s,n(report),Noop(TTL: ${TTL} ARG1: ${ARG1}) freepbx/trunk/amp_conf/htdocs/admin/modules/core/functions.inc.php
r3865 r3874 1194 1194 //write to astdb 1195 1195 if ($astman) { 1196 $cid_masquerade = (isset($cid_masquerade) && trim($cid_masquerade) != "")?trim($cid_masquerade):$extension; 1196 1197 $astman->database_put("AMPUSER",$extension."/password",isset($password)?$password:''); 1197 1198 $astman->database_put("AMPUSER",$extension."/ringtimer",isset($ringtimer)?$ringtimer:''); … … 1200 1201 $astman->database_put("AMPUSER",$extension."/outboundcid",isset($outboundcid)?"\"".$outboundcid."\"":''); 1201 1202 $astman->database_put("AMPUSER",$extension."/cidname",isset($name)?"\"".$name."\"":''); 1203 $astman->database_put("AMPUSER",$extension."/cidnum",$cid_masquerade); 1202 1204 $astman->database_put("AMPUSER",$extension."/voicemail","\"".isset($voicemail)?$voicemail:''."\""); 1203 1205 $astman->database_put("AMPUSER",$extension."/device","\"".isset($device)?$device:''."\""); … … 1206 1208 } 1207 1209 1208 if ($vmx_state ) {1210 if ($vmx_state && $voicemail != "novm") { 1209 1211 1210 1212 $unavail_mode="enabled"; … … 1276 1278 if ($astman) { 1277 1279 $results['vmx_state']=$astman->database_get("AMPUSER",$extension."/vmx/unavail/state"); 1280 $cid_masquerade=$astman->database_get("AMPUSER",$extension."/cidnum"); 1281 $results['cid_masquerade'] = (trim($cid_masquerade) != "")?$cid_masquerade:$extension; 1278 1282 } else { 1279 1283 fatal("Cannot connect to Asterisk Manager with ".$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"]); … … 1303 1307 $astman->database_del("AMPUSER",$extension."/outboundcid"); 1304 1308 $astman->database_del("AMPUSER",$extension."/cidname"); 1309 $astman->database_del("AMPUSER",$extension."/cidnum"); 1305 1310 $astman->database_del("AMPUSER",$extension."/voicemail"); 1306 1311 $astman->database_del("AMPUSER",$extension."/device"); … … 2443 2448 // Ensure variables possibly extracted later exist 2444 2449 $name = $directdid = $didalert = $outboundcid = $answer = null; 2445 $record_in = $record_out = $faxexten = $faxemail = $mohclass = $sipname = null;2450 $record_in = $record_out = $faxexten = $faxemail = $mohclass = $sipname = $cid_masquerade = null; 2446 2451 2447 2452 // Init vars from $_REQUEST[] … … 2486 2491 2487 2492 $msgInvalidExtNum = 'Please enter a valid extension number.'; 2493 $msgInvalidCidNum = 'Please enter a valid CID Num Alias (must be a valid number).'; 2488 2494 $msgInvalidExtPwd = 'Please enter valid User Password using numbers only'; 2489 2495 $msgInvalidDispName = 'Please enter a valid Display Name'; … … 2511 2517 } 2512 2518 $currentcomponent->addguielem($section, new gui_textbox('name', $name, 'Display Name', 'The caller id name for calls from this user will be set to this name. Only enter the name, NOT the number.', '!isCallerID()', $msgInvalidDispName, false)); 2519 $cid_masquerade = (trim($cid_masquerade) == $extdisplay)?"":$cid_masquerade; 2520 $currentcomponent->addguielem($section, new gui_textbox('cid_masquerade', $cid_masquerade, 'CID Num Alias', 'The CID Number to user for internal calls, if different then the extension number. This is used to masquerade as a different user. A common example is a team support persons who would like their internal callerid to display the general support number (a ringgroup or queue). There will be no efffect on external calls.', '!isWhitespace() && !isInteger()', $msgInvalidCidNum, false)); 2513 2521 $currentcomponent->addguielem($section, new gui_textbox('sipname', $sipname, 'SIP Alias', "If you want to support direct sip dialing of users internally or through anonymous sip calls, you can supply a friendly name that can be used in addition to the users extension to call them.")); 2514 2522
