<!--
 Copyright (c) 2008 Broadcom Corporation

 This program is the proprietary software of Broadcom Corporation and/or
 its licensors, and may only be used, duplicated, modified or distributed
 pursuant to the terms and conditions of a separate, written license
 agreement executed between you and Broadcom (an "Authorized License").
 Except as set forth in an Authorized License, Broadcom grants no license
 (express or implied), right to use, or waiver of any kind with respect to
 the Software, and Broadcom expressly reserves all rights in and to the
 Software and all intellectual property rights therein.  IF YOU HAVE NO
 AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY,
 AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE
 SOFTWARE.

 Except as expressly set forth in the Authorized License,

 1.     This program, including its structure, sequence and organization,
 constitutes the valuable trade secrets of Broadcom, and you shall use all
 reasonable efforts to protect the confidentiality thereof, and to use this
 information only in connection with your use of Broadcom integrated circuit
 products.

 2.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED
 "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS
 OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH
 RESPECT TO THE SOFTWARE.  BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL
 IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR
 A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET
 ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME
 THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE.

 3.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM
 OR ITS LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL,
 INDIRECT, OR EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY
 RELATING TO YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM
 HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN
 EXCESS OF THE AMOUNT ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1,
 WHICHEVER IS GREATER. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY
 FAILURE OF ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.

****************************************************************************
  $Id:

  Filename: voicesip_digitmap.html
  Author: zhangyajun 
  Creation Date: 2011-04-29

****************************************************************************
end_copyright_header -->
<html>
   <head>
   
      <style type="text/css">
      ul#tabs { list-style-type: none; margin: 30px 0 0 0; padding: 0 0 0.3em 0; }
      ul#tabs li { display: inline; }
      ul#tabs li a { color: #42454a; background-color: #dedbde; border: 1px solid #c9c3ba; border-bottom: none; padding: 0.3em; text-decoration: none; }
      ul#tabs li a:hover { background-color: #f1f0ee; }
      ul#tabs li a.selected { color: #000; background-color: #f1f0ee; font-weight: bold; padding: 0.7em 0.3em 0.38em 0.3em; }
      div.tabContent { border: 1px solid #c9c3ba; padding: 0.5em; background-color: #f1f0ee; }
      div.tabContent.hide { display: none; }
      </style>
      
      <meta HTTP-EQUIV='Pragma' CONTENT='no-cache;'>
      <link rel="stylesheet" href='stylemain.css' type='text/css'>
      <link rel="stylesheet" href='colors.css' type='text/css'>
      <script language="javascript"><%ejGetOther(forbidHTMLCode)%></script>
      <script language="javascript" src="util.js"></script>
<script language="javascript">

//var maxLines = 2;
/*
if ( maxLines.search("ejGetVoice") >= 0 ) {
   maxLines = 2; // if not provided by provisioning, hard-code maxLines
}
*/
var maxSp = '<%ejGetVoice(maxSp)%>';
var maxEntry = '<%ejGetOther(sysInfo, maxDigitMapEntry)%>';
var locationQuery="sessionKey=<%ejGetOther(sessionKey)%>";

var obj1Items = '<%ejGetObject(MDMOID_OS_DIGIT_MAP)%>';

var obj1Cols = numOfCol(obj1Items);
var obj1Rows = numOfRow(obj1Items);
/* NOTICE: MDMOID_USERS is Type1/Type2 object, follow variables are arrays */
var dmappiefixnum = getColFromList(obj1Items, 0);
var dmapopnum = getColFromList(obj1Items, 1);
var dmaplen = getColFromList(obj1Items, 2);
var dmaproute = getColFromList(obj1Items, 3);
var dmapindex = getColFromList(obj1Items, 4);

function btnAdddmap(current_view) {
   var code = 'location="voicesip_digitmap_add.html"';
   eval(code);
}

function btnEdit(id)
{
    var loc = 'digitmapedit.cmd?';
    loc += '&ID='+ id ;
    var code = 'location="' + loc + '"';
    eval(code);
}

function removeClick(rml) {
   var lst = '';
   if (rml.length > 0)
      for (i = 0; i < rml.length; i++) {
         if ( rml[i].checked == true )
            lst += rml[i].value + ', ';
      }
   else if ( rml.checked == true )
      lst = rml.value;

   var loc = 'voicesipdmap.cmd?action=remove&rmLst=' + lst +"&"+ locationQuery;
   var code = 'location="' + loc + '"';
   eval(code);
}

function frmLoad(current_view) {
   
}

function fillObj1Items(){
	var i;
	for(i=0; i < obj1Rows; i++){
		document.writeln("<tr>");
		document.writeln("<td align='center'><input type='checkbox' name='rml' value='"+ dmappiefixnum[i] +"'></td>");
		document.writeln("<td align='center'>&nbsp;"+ dmappiefixnum[i] +"</td>");
		document.writeln("<td align='center'>&nbsp;"+ dmapopnum[i] +"</td>");
		document.writeln("<td align='center'>&nbsp;"+ dmaplen[i] +"</td>");
		if(dmaproute[i]==0)
		    document.writeln("<td align='center'>&nbsp;VoIP</td>");
		else
			document.writeln("<td align='center'>&nbsp;Deny</td>");
		document.writeln("<td align='center'><input type='button' name='edit' onClick='btnEdit(\"" 
			+ dmapindex[i] + "\")' value='Edit'></td>");

		document.writeln("</tr>");
	}
}

</script>
</head>

<body onLoad="frmLoad('digitmap')">
<blockquote>
	<form> 
	<b>Voice -- SIP Digit Map Setting</b>
	<p></p>
	<br>
	<table border='1' cellpadding='4' cellspacing='0'>
	<tr>
		<td class='hd'>Remove</td>
		<td class='hd'>Prefix Number</td>
		<td class='hd'>OP Number</td>
		<td class='hd'>User Dial Length</td>
		<td class='hd'>Route</td>
		<td class='hd'>Edit</td>
	</tr>
	<script language='javascript'>
	<!--hide
		fillObj1Items();
	//-->
	</script>
	</table>
		<script TYPE="text/javascript">
		    if(obj1Rows < parseInt(maxEntry)) 
                document.writeln("<input type='button' onClick=\"btnAdddmap('digitmap')\" value='Add' ID='dslatm_add' >");
            else
                document.writeln("<input type='button' onClick=\"btnAdddmap('digitmap')\" value='Add' ID='dslatm_add' disabled>");
			if((obj1Rows > 0))
                document.writeln("<input type='button' onClick='removeClick(this.form.rml)' value='Remove' ID='dslatm_remove'>");
			else
                document.writeln("<input type='button' onClick='removeClick(this.form.rml)' value='Remove' ID='dslatm_remove' disabled>");
		</script>     
	</form>
</blockquote>
</body>
</html>


