Changeset 6536

Show
Ignore:
Timestamp:
09/02/08 08:34:45 (3 months ago)
Author:
p_lindheimer
Message:

closes #3144 allow Anonymous in CID

Files:

Legend:

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

    r6534 r6536  
    26042604        $newdid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdid)); 
    26052605 
    2606         $newdidcid = isset($newdidcid) ? $newdidcid : ''; 
    2607         $newdidcid = trim($newdidcid); 
    2608         switch ($newdidcid) { 
    2609                 case 'Unknown': 
    2610                 case 'Private': 
    2611                 case 'Blocked': 
    2612                 case 'Restricted': 
    2613                 case 'Unavailable': 
    2614                         break; 
    2615                 default: 
    2616                         $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", $newdidcid); 
    2617                         break; 
     2606        $newdidcid = isset($newdidcid) ? trim($newdidcid) : ''; 
     2607        if (!preg_match('/^priv|^block|^unknown|^restrict|^unavail|^anonym/',strtolower($newdidcid))) { 
     2608                $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", $newdidcid); 
    26182609        } 
    26192610 
     
    28532844        $newdid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdid)); 
    28542845 
    2855         $newdidcid = isset($vars['newdidcid']) ? $vars['newdidcid'] : ''; 
    2856         $newdidcid = trim($newdidcid); 
    2857         switch ($newdidcid) { 
    2858                 case 'Unknown': 
    2859                 case 'Private': 
    2860                 case 'Blocked': 
    2861                 case 'Restricted': 
    2862                 case 'Unavailable': 
    2863                         break; 
    2864                 default: 
    2865                         $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", $newdidcid); 
    2866                         break; 
     2846        $newdidcid = isset($vars['newdidcid']) ? trim($vars['newdidcid']) : ''; 
     2847        if (!preg_match('/^priv|^block|^unknown|^restrict|^unavail|^anonym/',strtolower($newdidcid))) { 
     2848                $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", $newdidcid); 
    28672849        } 
    28682850 
     
    41274109                // Special CID handling to deal with Private, etc. 
    41284110                // 
    4129                 $js = 'if (isDialpattern(mycid) || mycid == "Private" || mycid == "Blocked" || mycid == "Unknown" || mycid == "Restricted" || mycid == "Unavailable") { return true } else { return false };'; 
    4130                 $currentcomponent->addjsfunc('isValidCID(mycid)', $js); 
     4111                $js =  
     4112                'var mycid = thiscid.toLowerCase(); 
     4113                if (isDialpattern(thiscid) || mycid.substring(0,4) == "priv" || mycid.substring(0,5) == "block" || mycid == "unknown" || mycid.substring(0,8) == "restrict" || mycid.substring(0,7) == "unavail" || mycid.substring(0,6) == "anonym") { return true } else { return false }; 
     4114                '; 
     4115                $currentcomponent->addjsfunc('isValidCID(thiscid)', $js); 
    41314116 
    41324117                // Add the 'proces' functions 
     
    42934278                $currentcomponent->addguielem($section, new gui_textbox('newdid_name', $newdid_name, _("DID Description"), _("A description for this DID, such as \"Fax\"")), 4); 
    42944279                $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); 
    4295                 $currentcomponent->addguielem($section, new gui_textbox('newdidcid', $newdidcid, _("Add Inbound CID"), _("Add a CID for more specific DID + CID routing. A DID must be specified in the above Add DID box. In addition to standard dial sequences, you can also put Private, Blocked, Unknown, Restricted and Unavailable in order to catch these special cases if the Telco transmits them."),"!frm_${display}_isValidCID()",$msgInvalidCIDNum,true), 4); 
     4280                $currentcomponent->addguielem($section, new gui_textbox('newdidcid', $newdidcid, _("Add Inbound CID"), _("Add a CID for more specific DID + CID routing. A DID must be specified in the above Add DID box. In addition to standard dial sequences, you can also put Private, Blocked, Unknown, Restricted, Anonymous and Unavailable in order to catch these special cases if the Telco transmits them."),"!frm_${display}_isValidCID()",$msgInvalidCIDNum,true), 4); 
    42964281 
    42974282                $dids = core_did_list('extension'); 
  • modules/branches/2.5/core/page.did.php

    r6450 r6536  
    182182                </tr> 
    183183                <tr> 
    184                         <td><a href="#" class="info"><?php echo _("Caller ID Number")?><span><?php echo _('Define the Caller ID Number to be matched on incoming calls.<br><br>Leave this field blank to match any or no CID info. In addition to standard dial sequences, you can also put Private, Blocked, Unknown, Restricted and Unavailable in order to catch these special cases if the Telco transmits them.')?></span></a>:</td> 
     184                        <td><a href="#" class="info"><?php echo _("Caller ID Number")?><span><?php echo _('Define the Caller ID Number to be matched on incoming calls.<br><br>Leave this field blank to match any or no CID info. In addition to standard dial sequences, you can also put Private, Blocked, Unknown, Restricted, Anonymous and Unavailable in order to catch these special cases if the Telco transmits them.')?></span></a>:</td> 
    185185                        <td><input type="text" name="cidnum" value="<?php echo htmlspecialchars(isset($cidnum)?$cidnum:'') ?>" tabindex="<?php echo ++$tabindex;?>"></td> 
    186186                </tr> 
     
    340340                return false; 
    341341        } 
    342         if (!isDialpattern(theForm.cidnum.value) && theForm.cidnum.value != "Private" && theForm.cidnum.value != "Blocked" && theForm.cidnum.value != "Unknown" && theForm.cidnum.value != "Restricted" && theForm.cidnum.value != "Unavailable") 
     342 
     343        var mycid = theForm.cidnum.value.toLowerCase(); 
     344        if (!isDialpattern(mycid) && mycid.substring(0,4) != "priv" && mycid.substring(0,5) != "block" && mycid != "unknown" && mycid.substring(0,8) != "restrict" && mycid.substring(0,7) != "unavail" && mycid.substring(0,6) != "anonym") 
    343345                return warnInvalid(theForm.cidnum, msgInvalidCIDNum); 
    344346         
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads