subSysNo=$subSysNo"; $portNo = $pNum%8; if($DEBUG)echo "
portNo=$portNo"; $tgTypeArr=array( array('num' => '0', 'remark' => 'PSTN', 'color' => '#FF0000'), array('num' => '1', 'remark' => 'HPLMN', 'color' => '#0000FF'), array('num' => '2', 'remark' => 'VPLMN', 'color' => '#0000FF'), array('num' => '3', 'remark' => 'SUB', 'color' => '#0000FF'), array('num' => '4', 'remark' => 'IP', 'color' => '#0000FF'), array('num' => '5', 'remark' => 'Intercept', 'color' => '#0000FF') ); $netTypeArr=array( array('num' => '0', 'remark' => 'International', 'color' => '#FF0000'), array('num' => '1', 'remark' => 'Inter-S', 'color' => '#0000FF'), array('num' => '2', 'remark' => 'National ', 'color' => '#0000FF'), array('num' => '3', 'remark' => 'Na-S', 'color' => '#0000FF'), array('num' => '4', 'remark' => '--', 'color' => '#0000FF') ); $cirTypeArr=array( array('num' => '0', 'remark' => 'Clockwise', 'color' => '#FF0000'), array('num' => '1', 'remark' => 'Anti-C', 'color' => '#0000FF'), array('num' => '2', 'remark' => 'Odd', 'color' => '#0000FF'), array('num' => '3', 'remark' => 'Even', 'color' => '#0000FF'), array('num' => '4', 'remark' => '--', 'color' => '#0000FF') ); $tgLocationArr=array( array('num' => '0', 'remark' => 'MSC-0', 'color' => '#FF0000'), array('num' => '1', 'remark' => 'MSC-1', 'color' => '#0000FF'), array('num' => '2', 'remark' => 'Both', 'color' => '#FF0000'), array('num' => '3', 'remark' => 'Spare', 'color' => '#0000FF') ); //Attributes of TG $oidTg = "2.1.4"; $pTg = explode(".",$oidTg); $i = 0; $wTg = ''; while(isset($pTg[$i])) { $lNum = $i+1; if($DEBUG) echo "
pTg[$i]=$pTg[$i]"; $wTg = $wTg." AND level_$lNum = $pTg[$i] "; $i++; } if($set || $add) { if($DEBUG)echo "
dpc=$dpc"; $dpc = omc_keep_length($dpc,0,6); $field_1 = "00".$dpc; if($DEBUG)echo "
field_1=$field_1"; $hTgType = omc_keep_length(DecBin($tgType),0,3); if($add){ $tgFlag = 1; } $field_2 = $lpFlag.$atFlag.$hTgType.$voFlag.$cdrFlag.$tgFlag; $field_2 = omc_keep_length(DecHex(BinDec($field_2)),0,2); if($DEBUG)echo "
field_2=$field_2"; $field_3 = omc_keep_length(DecHex($netType),0,2); if($DEBUG)echo "
field_3=$field_3"; if($DEBUG)echo "
cirType=$cirType"; $hCirType = omc_keep_length(DecBin($cirType),0,2); if($DEBUG)echo "
tgLct=$tgLct"; $htgLct = omc_keep_length(DecBin($tgLct),0,2); if($DEBUG)echo "
backFlag=$backFlag"; $field_4 = $htgLct.$mptyFlag."00".$backFlag.$hCirType; $field_4 = omc_keep_length(DecHex(BinDec($field_4)),0,2); if($DEBUG)echo "
field_4=$field_4"; if($DEBUG)echo "
tgNum=$tgNum"; $field_5 = omc_keep_length(DecHex($tgNum),0,2); if($DEBUG)echo "
field_5=$field_5"; if($DEBUG)echo "
tandemFlag=$tandemFlag"; $field_6 = omc_keep_length(DecHex($tandemFlag),0,2); if($DEBUG)echo "
field_6=$field_6"; if($DEBUG)echo "
incomingCallType=$incomingCallType"; $field_7 = omc_keep_length(DecHex($incomingCallType),0,2); if($DEBUG)echo "
field_7=$field_7"; $field_10=omc_keep_length(dechex(bindec($radioChannelControl.'00'.$halfRateSpeechV1.$halfRateSpeechV3.$fullRateSpeechV1.$fullRateSpeechV2.$fullRateSpeechV3)),0,2); $field_11=omc_keep_length(dechex($sendST_digitFlag),0,2); $field_12=omc_keep_length(dechex($ISUP_type),0,2); $initValue = $field_1.$field_2.$field_3.$field_4.$field_5.$field_6.$field_7.$field_10.$field_11.$field_12; $initValue = strtoupper($initValue); if($DEBUG)echo "
initValue=$initValue"; $uTgSql = " UPDATE $tb_2 set initValue = '$initValue' WHERE subSysNo = '99' AND instanceNo = '$tNum' ".$wTg; if($DEBUG)echo "
uTgSql=$uTgSql"; $uTgRes = @mysqli_query($pubConn,$uTgSql); echo mysqli_error($pubConn); echo ""; } $tgSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' AND instanceNo = '$tNum' ".$wTg; if($DEBUG) echo "
tgSql=$tgSql"; $tgRes = @mysqli_query($pubConn,$tgSql); $tgRow = @mysqli_fetch_array($tgRes); echo mysqli_error($pubConn); $instanceNo = $tgRow[instanceNo]; $initValue = $tgRow[initValue]; if($DEBUG)echo "
initValue=$initValue"; $dpc = substr($initValue,2,6); if($DEBUG)echo "
dpc=$dpc"; $hex_4 = substr($initValue,8,2); if($DEBUG)echo "
hex_4=$hex_4"; $bin_4 = omc_keep_length(DecBin(HexDec($hex_4)),0,8); if($DEBUG)echo "
bin_4=$bin_4"; $tgFlag = substr($bin_4,7,1); if($DEBUG)echo "
tgFlag=$tgFlag"; $cdrFlag = substr($bin_4,6,1); if($DEBUG)echo "
cdrFlag=$cdrFlag"; $voFlag = substr($bin_4,5,1); if($DEBUG)echo "
voFlag=$voFlag"; $tgType = BinDec(substr($bin_4,2,3)); if($DEBUG)echo "
tgType=$tgType"; $atFlag = substr($bin_4,1,1); if($DEBUG)echo "
atFlag=$atFlag"; $lpFlag = substr($bin_4,0,1); $netType = HexDec(substr($initValue,10,2)); if($DEBUG)echo "
netType=$netType"; $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"; $cirType = BinDec(substr($bin_6,6,2)); if($DEBUG)echo "
cirType=$cirType"; $backFlag = substr($bin_6,5,1); if($DEBUG)echo "
backFlag=$backFlag"; $tgLct = BinDec(substr($bin_6,0,2)); if($DEBUG)echo "
tgArr[$instanceNo][11]={$tgArr[$instanceNo][11]}"; $mptyFlag = BinDec(substr($bin_6,2,1)); if($DEBUG)echo "
mptyFlag=$mptyFlag"; $hex_8 = substr($initValue,16,2); if($DEBUG)echo "
hex_8=$hex_8"; $tandemFlag = hexdec($hex_8); if($DEBUG)echo "
tandemFlag=$tandemFlag"; $tgNum = HexDec(substr($initValue,14,2)); if($DEBUG)echo "
tgNum=$tgNum"; $incomingCallType=HexDec(substr($initValue,18,2)); if($DEBUG)echo "
incomingCallType=$incomingCallType"; $hex_10=substr($initValue,20,2); if($DEBUG)echo "
hex_10=$hex_10"; $bin_10=omc_keep_length(DecBin(HexDec($hex_10)),0,8); if($DEBUG)echo "
bin_10=$bin_10"; $radioChannelControl=substr($bin_10,0,1); if($DEBUG)echo "
radioChannelControl=$radioChannelControl"; $halfRateSpeechV1=substr($bin_10,3,1); if($DEBUG)echo "
halfRateSpeechV1=$halfRateSpeechV1"; $halfRateSpeechV3=substr($bin_10,4,1); if($DEBUG)echo "
halfRateSpeechV3=$halfRateSpeechV3"; $fullRateSpeechV1=substr($bin_10,5,1); if($DEBUG)echo "
fullRateSpeechV1=$fullRateSpeechV1"; $fullRateSpeechV2=substr($bin_10,6,1); if($DEBUG)echo "
fullRateSpeechV2=$fullRateSpeechV2"; $fullRateSpeechV3=substr($bin_10,7,1); if($DEBUG)echo "
fullRateSpeechV3=$fullRateSpeechV3"; $sendST_digitFlag=HexDec(substr($initValue,22,2)); if($DEBUG)echo "
sendST_digitFlag=$sendST_digitFlag"; $ISUP_type=HexDec(substr($initValue,24,2)); if($DEBUG)echo "
ISUP_type=$ISUP_type"; //$hiddenValue=substr($initValue,20,6); //if($DEBUG)echo "
hiddenValue=$hiddenValue"; echo "
"; echo ""; if($oType){ $tgFlagSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' ".$wTg." ORDER BY instanceNo "; if($DEBUG)echo "
tgFlagSql=$tgFlagSql"; $tgFlagRes = @mysqli_query($pubConn,$tgFlagSql); $tgFlagRow = @mysqli_fetch_array($tgFlagRes); echo mysqli_error($pubConn); do { $instanceNo = $tgFlagRow[instanceNo]; $initValue = $tgFlagRow[initValue]; if($DEBUG)echo "
initValue=$initValue"; $hex_4 = substr($initValue,8,2); if($DEBUG)echo "
hex_4=$hex_4"; $bin_4 = omc_keep_length(DecBin(HexDec($hex_4)),0,8); if($DEBUG)echo "
bin_4=$bin_4"; $tgFlag = $tgFlagArr[$instanceNo][0] = substr($bin_4,7,1); //echo "
tgFlag=$tgFlag"; }while($tgFlagRow = @mysqli_fetch_array($tgFlagRes)); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; }else{ echo ""; echo ""; echo ""; } echo ""; echo ""; if($tgFlag){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if($cdrFlag){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; if($voFlag){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; if($atFlag){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if($lpFlag){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if($backFlag){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if($mptyFlag){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; if($tandemFlag){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; if($incomingCallType){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; if($radioChannelControl){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; if($fullRateSpeechV3){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; if($fullRateSpeechV2){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; if($fullRateSpeechV1){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; if($halfRateSpeechV3){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; if($halfRateSpeechV1){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; if($sendST_digitFlag){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; if($ISUP_type){ echo ""; }else{ echo ""; } echo ""; echo "
Add trunk group
Trunk group#"; echo ""; echo "
Trunk group $tNum
TG flagYes"; echo "No Yes"; echo "No 
Category"; echo ""; echo "
DPC
CDROn "; echo "OffOn "; echo "Off
AnnouncementOn "; echo "OffOn "; echo "Off
Alternative TG flagYes"; echo "No Yes"; echo "No 
Alternative TG
Incoming loopbackYes"; echo "No Yes"; echo "No 
Network indicator"; echo ""; echo "
Circuit selection"; echo ""; echo "
Collision back offOn "; echo "OffOn "; echo "Off
Location"; echo ""; echo "
MPTY enableYes"; echo "No Yes"; echo "No 
Tandem restrictionYes"; echo "No Yes"; echo "No 
Incoming call typeIn "; echo "NormalIn "; echo "Normal
Radio Channel ControlControl By Operator "; echo "Control By MSControl By Operator "; echo "Control By MS
Full Rate speech V3Enable "; echo "DisableEnable "; echo "Disable
Full Rate speech V2Enable "; echo "DisableEnable "; echo "Disable
Full Rate speech V1Enable "; echo "DisableEnable "; echo "Disable
Half Rate speech V3Enable "; echo "DisableEnable "; echo "Disable
Half Rate speech V1Enable "; echo "DisableEnable "; echo "Disable
Send ST digit flagEnable "; echo "DisableEnable "; echo "Disable
ISUP_typeANSI "; echo "ITUANSI "; echo "ITU
"; //echo "
Remark:"; echo "
"; if($oType){ echo ""; echo "  "; }else{ echo ""; echo "  "; echo ""; } echo ""; echo ""; echo ""; //echo ""; echo "
"; ?> Remarks:

TG number: Trunk group number, ranging from 0 to 255 (for new trunk group)

TG flag: Y=TG enable, N=TG disable

Category: PSTN=to PSTN, IP=to VMS and VPS, HPLMN=to HPLMN, VPLMN=to VPLMN, SUB=to BSC

DPC: Destination point code of this trunk group

CDR: CDR on or off option for this trunk group

Announcement (Voice): Voice announcement enable or disable for this trunk group

Alternative TG flag (ALT flag): Alternative trunk group enable or disable option

Alternative TG (ALT TG): Alternative trunk group for backup purpose

Loop back: Incoming call loop back enable or disable, used for MSC loop back

Network indicator (NI): Specify network type: International, International spare (Inter-s), National, National spare (Na-s)

Circuit selection (Circuit): Preferred circuit selection mode, include clockwise, anti-clockwise, odd and even

Collision back off (Back off): Back off on or off when simultaneously select the same channel with the opposite side

Location: For normal trunk group, select Both. For a trunk group to a VPS, configure this trunk group as MSC0 or MSC1

MPTY enable (MPTY): Multi-party call flag, Yes=enable, No=disable. For all trunk groups to BSC, select Yes

Tandem restriction:
Y: Tandem disabled. Not support transit call from PSTN to PSTN via this trunk group
N: Tandem enabled. Support transit call from PSTN to PSTN via this trunk group