Changeset 5904

Show
Ignore:
Timestamp:
07/04/08 14:30:53 (5 months ago)
Author:
p_lindheimer
Message:

#2760 added Turkey indications, more tweaks on the directdid merge, added link back to extension

Files:

Legend:

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

    r5902 r5904  
    757757                                        $exten = $item['extension']; 
    758758                                        $cidnum = $item['cidnum']; 
     759 
     760                                        // If the user put in just a cid number for routing, we add _. pattern to catch 
     761                                        // all DIDs with that CID number. Asterisk will complain about _. being dangerous 
     762                                        // but we don't want to limit this to just numberic as someone may be trying to 
     763                                        // route a non-numeric did 
     764                                        // 
     765                                        if (trim($cidnum) != '' && trim($exten) == '') { 
     766                                                $exten = '_.'; 
     767                                        } 
    759768 
    760769                                        $exten = (empty($exten)?"s":$exten); 
     
    23612370        $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdidcid)); 
    23622371 
    2363         // Asterisk does not want just CID set so if it is add _X. to the DID 
    2364         // 
    2365         if ($newdid == '' && $newdidcid != '') { 
    2366                 $newdid = '_X.'; 
    2367         } 
    23682372        // Well more ugliness since the javascripts are already in here 
    2369         if ($newdid != '') { 
     2373        if ($newdid != '' || $newdidcid != '') { 
    23702374                $existing = core_did_get($newdid, $newdidcid); 
    23712375                if (! empty($existing)) { 
     
    25012505        // Now if $newdid is set we need to add the DID to the routes 
    25022506        // 
    2503         if ($newdid != '') { 
     2507        if ($newdid != '' || $newdidcid != '') { 
    25042508                $did_dest                = 'from-did-direct,'.$extension.',1'; 
    25052509                $did_vars['extension']   = $newdid; 
     
    26312635        $newdidcid = preg_replace("/[^0-9._XxNnZz\[\]\-\+]/" ,"", trim($newdidcid)); 
    26322636 
    2633         // Asterisk does not want just CID set so if it is add _X. to the DID 
    2634         // 
    2635         if ($newdid == '' && $newdidcid != '') { 
    2636                 $newdid = '_X.'; 
    2637         } 
    26382637        // Well more ugliness since the javascripts are already in here 
    2639         if ($newdid != '') { 
     2638        if ($newdid != '' || $newdidcid != '') { 
    26402639                $existing = core_did_get($newdid, $newdidcid); 
    26412640                if (! empty($existing)) { 
     
    37833782 array ( "name" => "South Africa",  "iso" => "za", "conf" => "ringcadence = 400,200,400,2000\ndial = 400*33\nbusy = 400/500,0/500\nring = 400*33/400,0/200,400*33/400,0/2000\ncongestion = 400/250,0/250\ncallwaiting = 400*33/250,0/250,400*33/250,0/250,400*33/250,0/250,400*33/250,0/250\ndialrecall = 350+440\nrecord = 1400/500,0/10000\ninfo = 950/330,1400/330,1800/330,0/330\nstutter =!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,400*33 \n"), 
    37843783 array ( "name" => "Sweden",  "iso" => "se", "conf" => "ringcadence = 1000,5000\ndial = 425\nbusy = 425/250,0/250\nring = 425/1000,0/5000\ncongestion = 425/250,0/750\ncallwaiting = 425/200,0/500,425/200,0/9100\ndialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425\nrecord = 1400/500,0/15000\ninfo = !950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/332,0\nstutter = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425\n"), 
     3784 array ("name" => "Turkey", "iso" => "tr", "conf" => "ringcadance = 2000,4000\ndial = 450\nbusy = 450/500,0/500\nring = 450/2000,450/4000\ncongestion = 450/200,0/200,450/200,0/200,450/200,0/200,450/600,0/200\ncallwaiting = 450/200,0/600,450/200,0/8000\ndialrecall = 450/1000,0/250\nrecord = 1400/500,0/15000\ninfo = !950/300,!1400/300,!1800/300,!0/1000,!950/300,!1400/300,!1800/300,!0/1000,!950/300,!1400/300,!1800/300,!0/1000,0\n"), 
    37853785 array ( "name" => "United Kingdom",  "iso" => "uk", "conf" => "ringcadence = 400,200,400,2000\ndial = 350+440\nspecialdial = 350+440/750,440/750\nbusy = 400/375,0/375\ncongestion = 400/400,0/350,400/225,0/525\nspecialcongestion = 400/200,1004/300\nunobtainable = 400\nring = 400+450/400,0/200,400+450/400,0/2000\ncallwaiting = 400/100,0/4000\nspecialcallwaiting = 400/250,0/250,400/250,0/250,400/250,0/5000\ncreditexpired = 400/125,0/125\nconfirm = 1400\nswitching = 400/200,0/400,400/2000,0/400\ninfo = 950/330,0/15,1400/330,0/15,1800/330,0/1000\nrecord = 1400/500,0/60000\nstutter = 350+440/750,440/750\n"), 
    37863786 array ( "name" => "United States / North America",  "iso" => "us", "conf" => "ringcadence = 2000,4000\ndial = 350+440\nbusy = 480+620/500,0/500\nring = 440+480/2000,0/4000\ncongestion = 480+620/250,0/250\ncallwaiting = 440/300,0/10000\ndialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440\nrecord = 1400/500,0/15000\ninfo = !950/330,!1400/330,!1800/330,0\nstutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440\n"), 
     
    40024002 
    40034003                $section = _("Assigned DID/CID"); 
     4004                $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")), 4); 
     4005                $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")), 4); 
     4006 
    40044007                $dids = core_did_list('extension'); 
    40054008                $did_count = 0; 
     
    40124015                                $addURL = $_SERVER['PHP_SELF'].'?type=setup&display=did&&extdisplay='.$did['extension'].'/'.$did['cidnum']; 
    40134016                                $did_icon = 'images/email_edit.png'; 
    4014                                 $did_label = ' '.$did['extension']; 
     4017                                $did_label = trim($did['extension']) == '' ? ' Any DID' : ' '.$did['extension']; 
    40154018                                if (trim($did['cidnum']) != '') { 
    40164019                                        $did_label .= ' / '.$did['cidnum']; 
     
    40274030                        } 
    40284031                } 
    4029                 $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")), 4); 
    4030                 $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")), 4); 
    4031  
    40324032 
    40334033                $section = 'Recording Options'; 
  • modules/branches/2.5/core/page.did.php

    r5898 r5904  
    6060 
    6161<?php 
    62 $display_link = isset($extdisplay) && $extdispaly != '' ? "&amp;extdisplay=".$extdisplay : ''; 
     62$display_link = isset($extdisplay) && $extdisplay != '' ? "&amp;extdisplay=".$extdisplay : ''; 
    6363?> 
    6464<div class="rnav"> 
    6565<ul> 
    6666        <li><a <?php echo ($extdisplay=='' ? 'class="current"':'') ?> href="config.php?display=<?php echo urlencode($dispnum)?>"><?php echo _("Add Incoming Route")?></a></li> 
    67         <li><a <?php echo ($didfilter=='' ? 'class="current"':'') ?> href="config.php?display=<?php echo urlencode($dispnum).$display_link?>"><?php echo _("View All")?></a></li> 
    68         <li><a <?php echo ($didfilter=='directdid' ? 'class="current"':'') ?> href="config.php?display=<?php echo urlencode($dispnum).'&amp;didfilter=directdid'.$display_link?>"><?php echo _("View Extensions")?></a></li> 
    69         <li><a <?php echo ($didfilter=='incoming' ? 'class="current"':'') ?> href="config.php?display=<?php echo urlencode($dispnum).'&amp;didfilter=incoming'.$display_link?>"><?php echo _("View General")?></a></li> 
    70         <li><a <?php echo ($didfilter=='unassigned' ? 'class="current"':'') ?> href="config.php?display=<?php echo urlencode($dispnum).'&amp;didfilter=unassigned'.$display_link?>"><?php echo _("View Un-Assigned")?></a></li
     67        <li><a <?php echo ($didfilter=='' ? 'class="current"':'') ?> href="config.php?display=<?php echo urlencode($dispnum).$display_link?>"><?php echo _("View All DIDs")?></a></li> 
     68        <li><a <?php echo ($didfilter=='directdid' ? 'class="current"':'') ?> href="config.php?display=<?php echo urlencode($dispnum).'&amp;didfilter=directdid'.$display_link?>"><?php echo _("View User DIDs")?></a></li> 
     69        <li><a <?php echo ($didfilter=='incoming' ? 'class="current"':'') ?> href="config.php?display=<?php echo urlencode($dispnum).'&amp;didfilter=incoming'.$display_link?>"><?php echo _("View General DIDs")?></a></li> 
     70        <li><a <?php echo ($didfilter=='unassigned' ? 'class="current"':'') ?> href="config.php?display=<?php echo urlencode($dispnum).'&amp;didfilter=unassigned'.$display_link?>"><?php echo _("View Unused DIDs")?></a></li><hr
    7171<?php  
    7272//get unique incoming routes 
     
    125125                <h2><?php echo _("Route")?>: <?php echo !empty($description)?$description:$extdisplay; ?></h2> 
    126126                <a href="<?php echo $delURL ?>"><?php echo _("Delete Route")?> <?php echo !empty($description)?$description:$extdisplay ?></a> 
     127<?php 
     128        // If this is a direct did, e.g. from-did-direct,nnn,1 then make a link to the extension 
     129        // 
     130        $did_dest = split(',',$destination); 
     131        if (isset($did_dest[0]) && $did_dest[0] == 'from-did-direct') { 
     132 
     133                if (isset($amp_conf["AMPEXTENSIONS"]) && ($amp_conf["AMPEXTENSIONS"] == "deviceanduser")) { 
     134                        $editURL = $_SERVER['PHP_SELF'].'?display=users&extdisplay='.$did_dest[1]; 
     135                        $EXTorUSER = "User"; 
     136                } 
     137                else { 
     138                        $editURL = $_SERVER['PHP_SELF'].'?display=extensions&extdisplay='.$did_dest[1]; 
     139                        $EXTorUSER = "Extension"; 
     140                } 
     141                echo "<p><a href=".$editURL."> Edit ".$EXTorUSER." ".$did_dest[1]."</a></p>"; 
     142        } 
     143?> 
    127144<?php } else { ?> 
    128145                <h2><?php echo _("Add Incoming Route")?></h2> 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads