subSysNo=$subSysNo"; $portNo = $pNum%8; if($DEBUG)echo "
portNo=$portNo"; $wAnd = " AND level_1 = 2 AND level_2 = 1 AND (level_3 = 1 OR level_3 = 2 OR level_3 = 3) "; /************get default value**************/ $defSql = " SELECT initValue,level_3 FROM paramConf WHERE keyId > 0 ".$wAnd." ORDER BY level_3 "; $defRes = @mysqli_query($pubConn,$defSql); $defRow = @mysqli_fetch_array($defRes); do { $leve_3 = $defRow[level_3]; $defaultValue[$leve_3] = $defRow[initValue]; //echo "
defaultValue[$leve_3]=$defaultValue[$leve_3]"; }while($defRow = @mysqli_fetch_array($defRes)); $prefixFlagArr=array( array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') ); $inTonArr=array( array('num' => '0', 'remark' => 'Spare', 'color' => '#FF0000'), array('num' => '1', 'remark' => 'SUB', 'color' => '#0000FF'), array('num' => '2', 'remark' => 'UNK', 'color' => '#0000FF'), array('num' => '3', 'remark' => 'NDD', 'color' => '#0000FF'), array('num' => '4', 'remark' => 'IDD', 'color' => '#0000FF'), array('num' => '5', 'remark' => 'Spare', 'color' => '#0000FF') ); $outTonArr=array( array('num' => '0', 'remark' => 'Spare', 'color' => '#FF0000'), array('num' => '1', 'remark' => 'SUB', 'color' => '#0000FF'), array('num' => '2', 'remark' => 'UNK', 'color' => '#0000FF'), array('num' => '3', 'remark' => 'NDD', 'color' => '#0000FF'), array('num' => '4', 'remark' => 'IDD', 'color' => '#0000FF'), array('num' => '5', 'remark' => 'Spare', 'color' => '#0000FF') ); $trkDelCArr=array( array('num' => '0', 'remark' => 'Delete none', 'color' => '#FF0000'), array('num' => '1', 'remark' => 'Delete first one','color' => '#FF0000'), array('num' => '2', 'remark' => 'Delete first two','color' => '#FF0000'), array('num' => '3', 'remark' => 'Delete first three','color' => '#FF0000'), array('num' => '4', 'remark' => 'Delete first four','color' => '#FF0000'), array('num' => '5', 'remark' => 'Delete first five','color' => '#FF0000'), array('num' => '6', 'remark' => 'Delete first six','color' => '#FF0000'), array('num' => '7', 'remark' => 'Delete first seven','color' => '#FF0000'), array('num' => '8', 'remark' => 'Delete first eight','color' => '#FF0000'), array('num' => '9', 'remark' => 'Delete first nine','color' => '#FF0000'), array('num' => '10', 'remark' => 'Delete first ten','color' => '#FF0000'), array('num' => '11', 'remark' => 'Delete first eleven','color' => '#FF0000'), array('num' => '12', 'remark' => 'Delete first twelve','color' => '#FF0000'), array('num' => '13', 'remark' => 'Delete first thirteen','color' => '#FF0000'), array('num' => '14', 'remark' => 'Delete first fourteen','color' => '#FF0000'), array('num' => '15', 'remark' => 'Delete first fifteen','color' => '#FF0000') ); $trkInsCArr=array( array('num' => '0', 'remark' => 'Insert none', 'color' => '#FF0000'), array('num' => '1', 'remark' => 'Insert first one','color' => '#FF0000'), array('num' => '2', 'remark' => 'Insert first two','color' => '#FF0000'), array('num' => '3', 'remark' => 'Insert first three','color' => '#FF0000'), array('num' => '4', 'remark' => 'Insert first four','color' => '#FF0000'), array('num' => '5', 'remark' => 'Insert first five','color' => '#FF0000'), array('num' => '6', 'remark' => 'Insert first six','color' => '#FF0000'), array('num' => '7', 'remark' => 'Insert first seven','color' => '#FF0000'), array('num' => '8', 'remark' => 'Insert first eight','color' => '#FF0000'), array('num' => '9', 'remark' => 'Insert first nine','color' => '#FF0000'), array('num' => '10', 'remark' => 'Insert first ten','color' => '#FF0000'), array('num' => '11', 'remark' => 'Insert first eleven','color' => '#FF0000'), array('num' => '12', 'remark' => 'Insert first twelve','color' => '#FF0000'), array('num' => '13', 'remark' => 'Insert first thirteen','color' => '#FF0000'), array('num' => '14', 'remark' => 'Insert first fourteen','color' => '#FF0000'), array('num' => '15', 'remark' => 'Insert first fifteen','color' => '#FF0000') ); $cdrFlagArr=array( array('num' => '0', 'remark' => 'Off', 'color' => '#FF0000'), array('num' => '1', 'remark' => 'On', 'color' => '#0000FF') ); $proTypeArr=array( array('num' => '0', 'remark' => 'Trunk', 'color' => '#FF0000'), array('num' => '1', 'remark' => 'MSISDN', 'color' => '#0000FF'), array('num' => '2', 'remark' => 'MSRN', 'color' => '#0000FF'), array('num' => '3', 'remark' => 'MSC', 'color' => '#0000FF') ); $callTypeArr=array( array('num' => '0', 'remark' => 'Normal', 'color' => '#0000FF'), array('num' => '1', 'remark' => 'Emergency', 'color' => '#0000FF'), array('num' => '2', 'remark' => 'MCT', 'color' => '#0000FF'), array('num' => '3', 'remark' => 'VMS', 'color' => '#0000FF'), array('num' => '4', 'remark' => 'IN', 'color' => '#0000FF') ); $camelFlagArr=array( array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') ); $eDelCArr=array( array('num' => '0', 'remark' => 'Delete none', 'color' => '#FF0000'), array('num' => '1', 'remark' => 'Delete first one','color' => '#FF0000'), array('num' => '2', 'remark' => 'Delete first two','color' => '#FF0000'), array('num' => '3', 'remark' => 'Delete first three','color' => '#FF0000'), array('num' => '4', 'remark' => 'Delete first four','color' => '#FF0000'), array('num' => '5', 'remark' => 'Delete first five','color' => '#FF0000'), array('num' => '6', 'remark' => 'Delete first six','color' => '#FF0000'), array('num' => '7', 'remark' => 'Delete first seven','color' => '#FF0000'), array('num' => '8', 'remark' => 'Delete first eight','color' => '#FF0000') ); $eInsCArr=array( array('num' => '0', 'remark' => 'Insert none', 'color' => '#FF0000'), array('num' => '1', 'remark' => 'Insert first one','color' => '#FF0000'), array('num' => '2', 'remark' => 'Insert first two','color' => '#FF0000'), array('num' => '3', 'remark' => 'Insert first three','color' => '#FF0000'), array('num' => '4', 'remark' => 'Insert first four','color' => '#FF0000'), array('num' => '5', 'remark' => 'Insert first five','color' => '#FF0000'), array('num' => '6', 'remark' => 'Insert first six','color' => '#FF0000'), array('num' => '7', 'remark' => 'Insert first seven','color' => '#FF0000'), array('num' => '8', 'remark' => 'Insert first eight','color' => '#FF0000') ); $cliTypeArr = array( array('num' => '0', 'remark' => 'Sub', 'color' => '#0000FF'), array('num' => '1', 'remark' => 'NDD', 'color' => '#0000FF'), array('num' => '2', 'remark' => 'IDD', 'color' => '#0000FF'), array('num' => '3', 'remark' => 'UNK(local)', 'color' => '#0000FF'), array('num' => '4', 'remark' => 'UNK(NDD)', 'color' => '#0000FF'), array('num' => '5', 'remark' => 'UNK(IDD)', 'color' => '#0000FF') ); $VoicePromptFlagArr = array( array('num' => '0', 'remark' => 'disable', 'color' => '#0000FF'), array('num' => '1', 'remark' => 'enable', 'color' => '#0000FF') ); $needMNPArr = array( array('num' => '0', 'remark' => 'No'), array('num' => '1', 'remark' => 'Yes') ); if($set || $add) { $field_0= omc_keep_length($prefixNum,E,16,0); if($DEBUG)echo "
field_0=$field_0"; if($add){ $prefixFlag = 1; } if($DEBUG)echo "
prefixFlag=$prefixFlag"; $field_1 = DecHex($outTon).DecHex($inTon); $field_1 = omc_keep_length($field_1,0,2); if($DEBUG)echo "
field_1=$field_1"; $field_2 = DecHex($trkInsC).DecHex($trkDelC); $field_2 = omc_keep_length($field_2,0,2); if($DEBUG)echo "
field_2=$field_2"; $field_3 = omc_keep_length($trkInsD,E,16,0); if($DEBUG)echo "
field_3=$field_3"; $field_4 = $prefixFlag.omc_keep_length(DecBin($callType),0,3).omc_keep_length(DecBin($proType),0,2)."0".$cdrFlag; $field_4 = omc_keep_length(DecHex(BinDec($field_4)),0,2); if($DEBUG)echo "
field_4=$field_4"; $field_5 = omc_keep_length(DecHex($dLen),0,2); if($DEBUG)echo "
field_5=$field_5"; $field_6 = DecHex($eInsC).DecHex($eDelC); $field_6 = omc_keep_length($field_6,0,2); if($DEBUG)echo "
field_6=$field_6"; $field_7 = omc_keep_length($eInsD,E,8,0); if($DEBUG)echo "
field_7=$field_7"; $field_8 = omc_keep_length(DecHex($tgNum),0,2); if($DEBUG)echo "
field_8=$field_8"; $field_9 = omc_keep_length(DecHex($cliType),0,2); if($DEBUG)echo "
field_9=$field_9"; $field_10 = omc_keep_length(DecHex($VoicePromptFlag),0,2); if($DEBUG)echo "
field_10=$field_10"; $field_11 = omc_keep_length(DecHex($needMNP),0,2); if($DEBUG)echo "
field_11=$field_11"; $initValue_1 = strtoupper($field_0); $initValue_2 = strtoupper($field_1.$field_2.$field_3.$field_4.$field_5.$field_6.$field_7.$field_9.$field_10.$field_11); $initValue_3 = strtoupper($field_8); if($DEBUG)echo "
initValue_1=$initValue_1"; if($DEBUG)echo "
initValue_2=$initValue_2"; if($DEBUG)echo "
initValue_3=$initValue_3"; $uSql_1 = " UPDATE $tb_2 set initValue = '$initValue_1' WHERE subSysNo = '99' AND instanceNo = '$tNum' AND level_1 = 2 AND level_2 = 1 AND level_3 = 1 "; if($DEBUG)echo "
uSql_1=$uSql_1"; $uRes_1 = @mysqli_query($pubConn,$uSql_1); echo mysqli_error($pubConn); $uSql_2 = " UPDATE $tb_2 set initValue = '$initValue_2' WHERE subSysNo = '99' AND instanceNo = '$tNum' AND level_1 = 2 AND level_2 = 1 AND level_3 = 2 "; if($DEBUG)echo "
uSql_2=$uSql_2"; $uRes_2 = @mysqli_query($pubConn,$uSql_2); echo mysqli_error($pubConn); $uSql_3 = " UPDATE $tb_2 set initValue = '$initValue_3' WHERE subSysNo = '99' AND instanceNo = '$tNum' AND level_1 = 2 AND level_2 = 1 AND level_3 = 3 "; if($DEBUG)echo "
uSql_3=$uSql_3"; $uRes_3 = @mysqli_query($pubConn,$uSql_3); echo mysqli_error($pubConn); echo ""; } /************select value to see************/ //Attributes of TG if($oType) $andSql = " SELECT level_3,instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99'".$wAnd." ORDER BY instanceNo "; else $andSql = " SELECT level_3,instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' AND instanceNo = '$tNum' ".$wAnd; if($DEBUG) echo "
andSql=$andSql
db=$db_1"; $andRes = @mysqli_query($pubConn,$andSql); $andRow = @mysqli_fetch_array($andRes); echo mysqli_error($pubConn); do { $level_3 = $andRow[level_3]; $instanceNo = $andRow[instanceNo]; $initValue = $andRow[initValue]; //echo "
initValue=$initValue"; if($initValue == $defaultValue[$level_3]){ $andShow[$level_3][$instanceNo] = 0; }else{ $andShow[$level_3][$instanceNo] = 1; } //echo "
andShow[$level_3][$instanceNo]={$andShow[$level_3][$instanceNo]}"; if($level_3 == 1){ $prefixNum = $initValue; $pNum = explode("E",$prefixNum); $prefixNum = $prefixArr[$instanceNo][1] = $pNum[0]; //echo "
prefixArr[$instanceNo][1]={$prefixArr[$instanceNo][1]}"; }elseif($level_3 == 2){ $DEBUG = 0; $hex_0 = substr($initValue,0,2); if($DEBUG)echo "
hex_0=$hex_0"; $bin_0 = omc_keep_length(DecBin(HexDec($hex_0)),0,8); if($DEBUG)echo "
bin_0=$bin_0"; $inTon = $prefixArr[$instanceNo][2] = BinDec(substr($bin_0,4,4)); //echo "
inTon=$inTon"; $outTon = $prefixArr[$instanceNo][3] = BinDec(substr($bin_0,0,4)); //echo "
outTon=$outTon"; $hex_1 = substr($initValue,2,2); if($DEBUG)echo "
hex_1=$hex_1"; $bin_1 = omc_keep_length(DecBin(HexDec($hex_1)),0,8); if($DEBUG)echo "
bin_1=$bin_1"; $trkDelC = $prefixArr[$instanceNo][4] = BinDec(substr($bin_1,4,4)); if($DEBUG)echo "
trkDelC=$trkDelC"; $trkInsC = $prefixArr[$instanceNo][5] = BinDec(substr($bin_1,0,4)); if($DEBUG)echo "
trkInsC=$trkInsC"; $trkInsD = substr($initValue,4,16); $pTrk = explode("E",$trkInsD); $trkInsD = $prefixArr[$instanceNo][6] = $pTrk[0]; if($DEBUG)echo "
trkInsD=$trkInsD"; $hex_6 = substr($initValue,20,2); if($DEBUG)echo "
hex_6=$hex_6"; $bin_6 = omc_keep_length(DecBin(HexDec($hex_6)),0,8); if($DEBUG)echo "
bin_6=$bin_6"; $cdrFlag = $prefixArr[$instanceNo][7] = BinDec(substr($bin_6,7,1)); if($DEBUG)echo "
cdrFlag=$cdrFlag"; $proType = $prefixArr[$instanceNo][8] = BinDec(substr($bin_6,4,2)); if($DEBUG)echo "
proType=$proType"; $callType = $prefixArr[$instanceNo][9] = BinDec(substr($bin_6,1,3)); if($DEBUG)echo "
callType=$callType"; $prefixFlag = $prefixArr[$instanceNo][0] = BinDec(substr($bin_6,0,1)); if($DEBUG)echo "
prefixFlag=$prefixFlag"; $dLen = $prefixArr[$instanceNo][10] = HexDec(substr($initValue,22,2)); if($DEBUG)echo "
dLen=$dLen"; $hex_8 = substr($initValue,24,2); if($DEBUG)echo "
hex_8=$hex_8"; $bin_8 = omc_keep_length(DecBin(HexDec($hex_8)),0,8); if($DEBUG)echo "
bin_8=$bin_8"; $eDelC = $prefixArr[$instanceNo][11] = BinDec(substr($bin_8,4,4)); if($DEBUG)echo "
eDelC=$eDelC"; $eInsC = $prefixArr[$instanceNo][12] = BinDec(substr($bin_8,0,4)); if($DEBUG)echo "
eInsC=$eInsC"; $eInsD = substr($initValue,26,8); $pTrk = explode("E",$eInsD); $eInsD = $prefixArr[$instanceNo][13] = $pTrk[0]; if($DEBUG)echo "
eInsD=$eInsD"; $cliType = substr($initValue,34,2); if($DEBUG) echo "cliType = $cliType
"; $VoicePromptFlag = hexdec(substr($initValue,36,2)); if($DEBUG) echo "VoicePromptFlag = $VoicePromptFlag
"; $needMNP = hexdec(substr($initValue,38,2)); if($DEBUG) echo "needMNP = $needMNP
"; }else{ $tgNum = $prefixArr[$instanceNo][14] = HexDec($initValue); //echo "
prefixArr[$instanceNo][14]={$prefixArr[$instanceNo][14]}"; } }while($andRow = @mysqli_fetch_array($andRes)); echo "
"; echo ""; if($oType){ /* $preFlagSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' AND level_1 = 2 AND level_2 = 1 AND level_3 = 2 "." ORDER BY instanceNo "; if($DEBUG)echo "
preFlagSql=$preFlagSql"; $preFlagRes = @mysqli_query($pubConn,$preFlagSql); $preFlagRow = @mysqli_fetch_array($preFlagRes); echo mysqli_error($pubConn); do { $instanceNo = $preFlagRow[instanceNo]; $initValue = $preFlagRow[initValue]; if($DEBUG)echo "
initValue=$initValue"; $hex_6 = substr($initValue,12,2); if($DEBUG)echo "
hex_6=$hex_6"; $bin_6 = omc_keep_length(DecBin(HexDec($hex_6)),0,8); if($DEBUG)echo "
bin_6=$bin_6"; $prefixFlag = $prefixFlagArr[$instanceNo][0] = BinDec(substr($bin_6,1,1)); //echo "
prefixFlag=$prefixFlag"; }while($preFlagRow = @mysqli_fetch_array($preFlagRes)); */ echo ""; echo ""; echo ""; /* echo ""; echo ""; echo ""; echo ""; */ echo ""; echo ""; echo ""; echo ""; }else{ echo ""; echo ""; echo ""; } echo ""; echo ""; if($prefixFlag){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if($cdrFlag){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if($VoicePromptFlag){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; if($needMNP){ echo ""; }else{ echo ""; } echo ""; echo "
Add Dailing prefix
Prefix no."; echo ""; echo "
Prefix no."; echo ""; echo "
Dailing prefix $tNum
FlagYes"; echo "No Yes"; echo "No 
Prefix
TON incoming call"; echo ""; echo "
TON outgoing call"; echo ""; echo "
Out trunk deletion count"; echo ""; echo "
Out trunk insertion count"; echo ""; echo "
Out trunk inserted digits
CDROn "; echo "OffOn "; echo "Off
Properties"; echo ""; echo "
Call type"; echo ""; echo "
Length of dialed number
E.164 international deletion count"; echo ""; echo "
E.164 international insertion count"; echo ""; echo "
E.164 international inserted digits
Trunk group
Cli-type "; echo ""; echo "
Voice Prompt FlagYes"; echo "No Yes"; echo "No 
Need MNPYes"; echo "No Yes"; echo "No 
"; //echo "
Remark:"; echo "
"; if($oType){ echo ""; }else{ echo ""; echo ""; } echo ""; echo ""; echo ""; echo "
"; ?> Remarks:

Prefix number: It appears when add a new prefix, ranging from 0 to 255

Flag: Y=prefix enable, N=prefix disable

TON incoming call (In-TON): Type of number for incoming call, include unknown, MSISDN, NDD and IDD. It is specified by originating node for terminating node to route this call with proper dialed number manipulation. For system subscriber dialed prefix, always use unknown for In-TON except the prefix of international prefix beginning with a "+". For this kind of prefix (such as +86755832) we should set the In-TON as IDD to support "+" dialing

TON outgoing call (Out-TON): Type of number for outgoing call, include unknown, MSISDN, NDD and IDD. It specifies the type of an outgoing call for terminating node to route this call with proper dialed number manipulation. Generally the MSC uses IDD for outgoing call

Out trunk deletion count (T-D-C): Quantity of deleted digit of a dialed number beginning with this prefix. It ranges from 0 to 8. 0=no deletion, 1-8=delete first 1-8 digits

Out trunk insertion count (T-I-C): Quantity of inserted digit for a dialed number beginning with this prefix. It ranges from 0 to 8. 0=no insertion, 1-8=insert 1-8 digits from the beginning of this number

Out trunk inserted digits (T-I-D): 8 digits ranging from EEEEEEEE to 99999999, E=any decimal number

CDR: Turn on/off the CDR of dialed numbers beginning with this prefix

Properties: Specify the properties of a prefix. Trunk=to PSTN, MSISDN=to A interface, MSRN=MS roaming number, MSC=to peer MSC

Call type: Normal=no verification for MT, Emergency call=no verification for MO (free call), Intelligent peripheral=MT verification via PPS, VMS call=send signaling carried DTMF to VMS

Length of dialed number (Digit-L): Length of dialed number (1-32)

E.164 international deletion count (E-D-C): Quantity of deleted digit of E164 international number

E.164 international insertion count (E-I-C): Quantity of inserted digit of E164 international number

E.164 international inserted digits (E-I-D): Inserted digit to the E164 international number, 8 digits ranging from EEEEEEEE to 99999999, E=any decimal number, MSISDN is used to Locate serving HLR, it also specify the country code of called which is necessary to identify IDD call

Trunk group (TG): Assign a trunk group for this prefix. Support assigning a single trunk group to multiple prefixes

CLI: Calling line identity Specify the CLI type for opposite node to perform CLIP or CLIR function. This CLI type should be same as the prefix type. e.g. If a prefix is for NDD call, its CLI type should be NDD