unserialize($str); $xmldata = $xml->getUnserializedData(); if (isset($xmldata['lca-data']['prefix'])) { if ($action == 'populatenpanxx10') { // 10 digit dialing // - add area code to 7 digits // - match local 10 digits // - add 1 to anything else $dialrules[] = $matches[1].'NXXXXXX'; // add NPA to 7-digits foreach ($xmldata['lca-data']['prefix'] as $prefix) { $dialrules[] = $prefix['npa'].'+'.$prefix['nxx'].'XXXX'; } foreach ($xmldata['lca-data']['prefix'] as $prefix) { $dialrules[] = $prefix['npa'].$prefix['nxx'].'XXXX'; } // if a number was not matched as local, dial it with '1' prefix $dialrules[] = '1+NXXNXXXXXX'; } else { // 7 digit dialing // - drop area code from local numbers // - match local 7 digit numbers // - add 1 to everything else foreach ($xmldata['lca-data']['prefix'] as $prefix) { $dialrules[] = $prefix['npa'].'|'.$prefix['nxx'].'XXXX'; } foreach ($xmldata['lca-data']['prefix'] as $prefix) { $dialrules[] = $prefix['nxx'].'XXXX'; } $dialrules[] = '1+NXXNXXXXXX'; $dialrules[] = '1'.$matches[1].'+NXXXXXX'; } // check for duplicates, and re-sequence $dialrules = array_values(array_unique($dialrules)); } else { $errormsg = _("Error fetching prefix list for: "). $_REQUEST["npanxx"]; } } else { // what a horrible error message... :p $errormsg = _("Invalid format for NPA-NXX code (must be format: NXXNXX)"); } if (isset($errormsg)) { echo ""; unset($errormsg); } break; } //get all rows from globals $sql = "SELECT * FROM globals"; $globals = $db->getAll($sql); if(DB::IsError($globals)) { die_freepbx($globals->getMessage()); } //create a set of variables that match the items in global[0] foreach ($globals as $global) { ${trim($global[0])} = htmlentities($global[1]); } ?>













$val) { // extract all ruleXX keys if (preg_match("/^rule\d+$/",$key)) { $dialrules[] = $val; } } } unset($temp); } echo "

".sprintf(_("Edit %s Trunk"),strtoupper($tech))."

"; ?>

0) { echo ""._("In use by")." ".$num_routes." ".($num_routes == 1 ? _("route") : _("routes")).""; foreach($routes as $route=>$priority) { echo _("Route")." ".$route.": "._("Sequence")." ".$priority."
"; } echo "
"; } else { echo ""._("WARNING:")." "._("This trunk is not used by any routes!").""; echo _("This trunk will not be able to be used for outbound calls until a route is setup that uses it. Click on Outbound Routes to setup routing."); echo ""; } } else { // set defaults $outcid = ""; $maxchans = ""; $dialoutprefix = ""; if ($tech == "zap") { $channelid = "g0"; } else { $channelid = ""; } // only for iax2/sip $peerdetails = "host=***provider ip address***\nusername=***userid***\nsecret=***password***\ntype=peer"; $usercontext = ""; $userconfig = "secret=***password***\ntype=user\ncontext=from-trunk"; $register = ""; $localpattern = "NXXXXXX"; $lddialprefix = "1"; $areacode = ""; echo "

".sprintf("Add %s Trunk",strtoupper($tech))."

"; } switch ($tech) { case 'dundi': $helptext = _('FreePBX offers limited support for DUNDi trunks and additional manual configuration is required. The trunk name should correspond to the [mappings] section of the remote dundi.conf systems. For example, you may have a mapping on the remote system, and corresponding configurations in dundi.conf locally, that looks as follows:

[mappings]
priv => dundi-extens,0,IAX2,priv:${SECRET}@218.23.42.26/${NUMBER},noparital

In this example, you would create this trunk and name it priv. You would then create the corresponding IAX2 trunk with proper settings to work with DUNDi. This can be done by making an IAX2 trunk in FreePBX or by using the iax_custom.conf file.
The dundi-extens context in this example must be created in extensions_custom.conf. This can simply include contexts such as ext-local, ext-intercom-users, ext-paging and so forth to provide access to the corresponding extensions and features provided by these various contexts and generated by FreePBX.'); break; default: $helptext = ''; } if ($helptext != '') { if ($extdisplay) { echo "

"; } echo $helptext; } ?>
');"> */?>



Format: \"caller name\" <#######>. You can also use the magic string 'hidden' to hide the CallerID sent out over Digital lines ONLY (E1/T1/J1/BRI/SIP/IAX)")?>

:



:
/>
: :
: OnClick='disable_verify(disabletrunk); return true;'>
: type="text" size="20" name="failtrunk" value=""/> OnClick='disable_field(failtrunk,failtrunk_enable); return true;'>




X   
Z   
N   
[1237-9] 
.   
|    +   

:

" />



:
Dial rulesThe area code this trunk is in.:  
The dialing pattern to make a 'local' call."):
The prefix for dialing long-distance numbers. In north america, this should be \"1\".")?>:
The area code this trunk is in. Any 7-digit numbers that don't match a number in the below list will have dialprefix+areacode added to them. ")?>:
This should be a list of local areacodes + prefixes to use for local dialing.")?>:  

Do a lookup from http://members.dandy.net/~czg/search.html to find all local-reachable area codes and phone numbers.")?>:


Most users should leave this option blank.")?>
:



The default setting is g0 (group zero).")?>

:
$OUTNUM$
examples:

CAPI/XXXXXXXX/")?>$OUTNUM$H323/")?>$OUTNUM$@XX.XX.XX.XX
OH323/$OUTNUM$@XX.XX.XX.XX:XXXX
vpb/1-1/$OUTNUM$
:
:



:


You may need to add to the default lines listed below, depending on your provider.

WARNING: Oreder is important as it will be retained. For example, if you use the \"allow/deny\" directives make sure deny comes first.")?>

:



This USER Context will be used to define the below user details.")?>
:




WARNING: Oreder is important as it will be retained. For example, if you use the \"allow/deny\" directives make sure deny comes first.")?>

:



example:

username:password@switch.voipprovider.com.

Many providers will require you to provide a DID number, ex: username:password@switch.voipprovider.com/didnumber in order for any DID matching to work.")?>

:
">