Changeset 5895

Show
Ignore:
Timestamp:
07/03/08 14:00:33 (3 months ago)
Author:
ethans
Message:

Changes for CALL SCREENING in Privacy Manager

Allows a user to select two additional options in the Privacy Manager: Screen Caller - Memory and Screen Caller - No Memory

When memory call screening is selected, the first time a unique caller id calls a user through a DID, the caller must record their
name which will then be presented to the user this and subsequent calls (via memory in /var/lib/asterisk/sounds/priv-callerintros)

When no memory is selected, each time a caller calls the user, they must record their name. This is useful if a user gets calls from
a company with multiple people behind a single caller id. Choosing this option deletes the priv-callerintros file for that caller id
prior to adding the "p" option to the Dial command.

Call screening is designed to ignore extension-to-extension calls and ring groups. Follow-me is a special case and is not considered
a ring group for this exclusion since call screening would be desirable to a user on follow-me settings. Locally dialed follow-me
execution will *not* be screened, though this may be desirable is open for discussion.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.5/core/agi-bin/dialparties.agi

    r5364 r5895  
    215215        debug("ringallv2 ring times: REALPRERING: $fmgrp_realprering, PRERING: $fmgrp_prering",4); 
    216216} 
    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// If this isn't a ring group, check to see if the user has call screening on 
     219$count = 0; 
     220foreach ($ext as $k) { 
     221        // 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 
     232                                } 
     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                        } 
     241                } 
     242        } 
     243        $count++; 
     244
    218245// IF THE FIRST EXTENSION IS CALL FORWARD ENABLED (put in logic) then we don't do master mode 
    219246// which means we reset the flag here after detecting that and just say we are not in master 
     
    609636                } 
    610637                $ds .= $ds_seperator . $dialopts; // pound to transfer, provide ringing 
     638                if ($screen) { 
     639                        $ds .= "p"; 
     640                } 
    611641                if (trim($use_confirmation) != "FALSE") { 
    612642                        $AGI->set_variable('__RG_IDX',$ringgroup_index); 
  • modules/branches/2.5/core/etc/extensions.conf

    r5741 r5895  
    7373exten => s,n+2(normdial),Dial(${ds})                               ; dialparties will set the priority to 10 if $ds is not null 
    7474exten => s,n,Set(DIALSTATUS=${IF($["${DIALSTATUS_CW}"!="" ]?${DIALSTATUS_CW}:${DIALSTATUS})}) 
     75exten => s,n,GosubIf($["${SCREEN}" != ""]?${DIALSTATUS},1) 
    7576 
    7677exten => s,20(huntdial),NoOp(Returned from dialparties with hunt groups to dial ) 
     
    107108exten => s,n(a50),DBdel(CALLTRACE/${CT_EXTEN}) 
    108109exten => s,n,Goto(s,a42) 
     110 
     111; For call screening 
     112exten => NOANSWER,1(screen-vm),Macro(vm,${SCREEN_EXTEN},BUSY) 
     113exten => NOANSWER,n,Macro(hangupcall) 
     114exten => TORTURE,1,Goto(app-blackhole,musiconhold,1) 
     115exten => TORTURE,n,Macro(hangupcall) 
     116exten => DONTCALL,1,Answer 
     117exten => DONTCALL,n,Wait(1) 
     118exten => DONTCALL,n,Zapateller() 
     119exten => DONTCALL,n,Playback(ss-noservice) 
     120exten => DONTCALL,n,Macro(hangupcall) 
    109121 
    110122; make sure hungup calls go here so that proper cleanup occurs from call confirmed calls and the like 
  • modules/branches/2.5/core/functions.inc.php

    r5880 r5895  
    20112011                        $astman->database_put("AMPUSER",$extension."/cidname","\"".addslashes($name)."\""); 
    20122012                        $astman->database_put("AMPUSER",$extension."/voicemail","\"".$voicemail."\""); 
     2013                        if($privacyman == "0")  { 
     2014                                $astman->database_del("AMPUSER",$extension."/screen"); 
     2015                        } 
     2016                        if($privacyman == "2")  { 
     2017                                $astman->database_put("AMPUSER",$extension."/screen","\"nomemory\""); 
     2018                        } 
     2019                        if($privacyman == "3")  { 
     2020                                $astman->database_put("AMPUSER",$extension."/screen","\"memory\""); 
     2021                        } 
     2022 
    20132023                }        
    20142024                return true; 
     
    25222532                $astman->database_put("AMPUSER",$extension."/cidnum",$cid_masquerade); 
    25232533                $astman->database_put("AMPUSER",$extension."/voicemail","\"".isset($voicemail)?$voicemail:''."\""); 
     2534                if($privacyman == "2")  { 
     2535                        $astman->database_put("AMPUSER",$extension."/screen","\"nomemory\""); 
     2536                } 
     2537                if($privacyman == "3")  { 
     2538                        $astman->database_put("AMPUSER",$extension."/screen","\"memory\""); 
     2539                } 
     2540 
    25242541                if (!$editmode) { 
    25252542                        $astman->database_put("AMPUSER",$extension."/device","\"".((isset($device))?$device:'')."\""); 
     
    26252642 
    26262643        //delete details to astdb 
     2644        if($astman)  { 
     2645                $astman->database_del("AMPUSER",$extension."/screen"); 
     2646        } 
    26272647        if ($astman && !$editmode) { 
    26282648                $astman->database_del("AMPUSER",$extension."/password"); 
     
    38963916                $currentcomponent->setoptlistopts('faxdetecttype', 'sort', false); 
    38973917 
    3898                 $currentcomponent->addoptlistitem('privyn', '0', _("No")); 
    3899                 $currentcomponent->addoptlistitem('privyn', '1', _("Yes")); 
    3900                 $currentcomponent->setoptlistopts('privyn', 'sort', false); 
     3918               $currentcomponent->addoptlistitem('privoptions', '0', _("Off")); 
     3919               $currentcomponent->addoptlistitem('privoptions', '1', _("Require Caller ID")); 
     3920               $currentcomponent->addoptlistitem('privoptions', '2', _("Screen Caller - No Memory")); 
     3921               $currentcomponent->addoptlistitem('privoptions', '3', _("Screen Caller - Memory")); 
     3922               $currentcomponent->setoptlistopts('privoptions', 'sort', false); 
    39013923 
    39023924                $currentcomponent->addoptlistitem('callwaiting', 'enabled', _("Enable")); 
     
    40704092                $section = 'Privacy'; 
    40714093                $privacyman = (isset($privacyman) ? $privacyman : '0'); 
    4072                $currentcomponent->addguielem($section, new gui_selectbox('privacyman', $currentcomponent->getoptlist('privyn'), $privacyman, 'Privacy Manager', _("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."), false), 4); 
     4094                $currentcomponent->addguielem($section, new gui_selectbox('privacyman', $currentcomponent->getoptlist('privoptions'), $privacyman, 'Privacy Manager',_("Choose 'Require Caller ID' and 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.  If 'Screen Caller' is chosen, the caller must 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 user for their caller-id once.  Screening without memory always requires a caller to say their name."), false), 4); 
    40734095 
    40744096        } 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads