Changeset 5743

Show
Ignore:
Timestamp:
04/20/08 10:23:31 (9 months ago)
Author:
p_lindheimer
Message:

#2763 - Change the calling presence on inbound calls to allowed_not_screened so cid prepends work to all phone types. Change it back to what it was if the same calls get forwarded/followme-ed back out the pbx so they continue to appear as anonymous/blocked if that is how they entered

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.4/core/functions.inc.php

    r5722 r5743  
    800800                                        if ($item['privacyman'] == "1") { 
    801801                                                $ext->add($context, $exten, '', new ext_macro('privacy-mgr')); 
     802                                        } else { 
     803                                                // if privacymanager is used, this is not necessary as it will not let blocked/anonymous calls through 
     804                                                // otherwise, we need to save the caller presence to set it properly if we forward the call back out the pbx 
     805                                                // note - the indirect table could go away as of 1.4.20 where it is fixed so that SetCallerPres can take 
     806                                                // the raw format. 
     807                                                // 
     808                                                if (version_compare($version, "1.6", "lt")) {  
     809                                                        $ext->add($context, $exten, '', new ext_setvar('__CALLINGPRES_SV','${CALLINGPRES_${CALLINGPRES}}')); 
     810                                                } else { 
     811                                                        $ext->add($context, $exten, '', new ext_setvar('__CALLINGPRES_SV','${CALLERPRES()}')); 
     812                                                } 
     813                                                $ext->add($context, $exten, '', new ext_setcallerpres('allowed_not_screened')); 
    802814                                        } 
    803815                                        if (!empty($item['alertinfo'])) { 
     
    10571069                        $ext->addGlobal('ASTVERSION', $version); 
    10581070 
     1071                        // Create CallingPresTable to deal with difference that ${CALINGPRES} returns vs. what 
     1072                        // SetCallingPres() accepts. This is a workaround that gets resolved in 1.6 where 
     1073                        // function CALLINGPRES() is consistent. 
     1074                        // This should be fixed in 1.4.20 but for now we keep it in until 1.6 
     1075                        // 
     1076                        if (version_compare($version, "1.6", "lt")) {  
     1077                                $ext->addGlobal('CALLINGPRES_0', 'allowed_not_screened'); 
     1078                                $ext->addGlobal('CALLINGPRES_1', 'allowed_passed_screen'); 
     1079                                $ext->addGlobal('CALLINGPRES_2', 'allowed_failed_screen'); 
     1080                                $ext->addGlobal('CALLINGPRES_3', 'allowed'); 
     1081                                $ext->addGlobal('CALLINGPRES_32', 'prohib_not_screened'); 
     1082                                $ext->addGlobal('CALLINGPRES_33', 'prohib_passed_screen'); 
     1083                                $ext->addGlobal('CALLINGPRES_34', 'prohib_failed_screen'); 
     1084                                $ext->addGlobal('CALLINGPRES_35', 'prohib'); 
     1085                                $ext->addGlobal('CALLINGPRES_67', 'unavailable'); 
     1086                        } 
     1087 
    10591088                        /* outbound routes */ 
    10601089                        // modules should use their own table for storage (and module_get_config() to add dialplan) 
     
    13931422                        $exten = 's'; 
    13941423                         
     1424                        // If we modified the caller presence, set it back. This allows anonymous calls to be internally prepended but keep 
     1425                        // their status if forwarded back out. Not doing this can result in the trunk CID being displayed vs. 'blocked call' 
     1426                        // 
     1427                        if (version_compare($version, "1.6", "lt")) {  
     1428                                $ext->add($context, $exten, '', new ext_execif('$["${CALLINGPRES_SV}" != ""]', 'SetCallingPres', '${CALLINGPRES_SV}')); 
     1429                        } else { 
     1430                                $ext->add($context, $exten, '', new ext_execif('$["${CALLINGPRES_SV}" != ""]', 'Set', 'CALLERPRES()=${CALLINGPRES_SV}')); 
     1431                        } 
     1432 
    13951433                        // Keep the original CallerID number, for failover to the next trunk. 
    13961434                        $ext->add($context, $exten, '', new ext_gotoif('$["${REALCALLERIDNUM:1:2}" != ""]', 'start'));