⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ringgroups.html.svn-base

📁 asterisk-gui asterisk网关接口编程 控制asterisk的接口
💻 SVN-BASE
📖 第 1 页 / 共 2 页
字号:
}function localajaxinit(){	ASTGUI.events.add( _$('radio_fbvm') , 'click', switch_fb_selects );	ASTGUI.events.add( _$('radio_fbivr') , 'click', switch_fb_selects );	ASTGUI.events.add( _$('radio_fbhgp') , 'click', switch_fb_selects );	ASTGUI.events.add( _$('button_add_toringlist') , 'click', function(){		a2b(_$('select_listofchannels'),_$('select_ringthesechannels'));	});	ASTGUI.events.add( _$('button_remove_fromringlist') , 'click', function(){		a2b(_$('select_ringthesechannels'),_$('select_listofchannels'));	});	ASTGUI.events.add( _$('button_removeall_fromringlist') , 'click', function(){		var y = _$('select_ringthesechannels');		var z = _$('select_listofchannels');		while (y.options.length){			y.selectedIndex = 0;			a2b(y,z);		}	});	// Load all user extensions	// Load Fall back extensions - Voicemail (same user extensions) and IVR menus	// Load Zap Channels	//	// Load all existing Ringgroups into the ringgroups object 	// Display ringgroup object as table.	//	// so we need to load users.conf and extensions.conf	//		parent.FXS_PORTS_DETECTED.each( function(y) {		LISTOFCHANNELS['Zap/' + y] = {};		LISTOFCHANNELS['Zap/' + y]['ChannelName'] = 'Analog Phone ' + y;	});	config2json('users.conf', 1, get_users) ;	parent.loadscreen(this);}function get_users(n){	var l, h;	var el = _$('select_voicemails');	for( l in n ){	if(n.hasOwnProperty(l)){		if( l =='general'){ continue;} // ignore 'general' context		if ( n[l]['context'] && unescape(n[l]['context']) == asterisk_guiTDPrefix + l ) { // ignore trunks in users.conf			continue;		}		if( !n[l]['trunkstyle'] ){ // all entries from users.conf other than trunks			UserExtensions.push(l);			if( n[l]['hassip']=='yes'){				LISTOFCHANNELS['SIP/' + l] = {};				LISTOFCHANNELS['SIP/' + l]['ChannelName'] = 'SIP/' + l + " -- " + n[l]['fullname'];			}			if( n[l]['hasiax']=='yes'){				LISTOFCHANNELS['IAX2/' + l] = {};				LISTOFCHANNELS['IAX2/' + l]['ChannelName'] = 'IAX2/' + l + " -- " + n[l]['fullname'];			}			if( n[l]['zapchan'] ){				var m = n[l]['zapchan'];				if( LISTOFCHANNELS[ 'Zap/' + m ] ){					LISTOFCHANNELS['Zap/'+m]['ChannelName'] = "Analog Phone -- " + n[l]['fullname'];				}			}			ASTGUI.selectbox.append(el, l + " -- " + n[l]['fullname'] , 'Voicemail(' + l + ',b)');		}	}}	config2json('extensions.conf', 0, read_extensions) ;}function read_extensions(n){	// read ringgroups, voicemenus	var l, t, h;	var el = _$('select_vmenus');	var get_menuname = function(c){		var r,s;		for( r =0; r < c.length; r++){			s = unescape(c[r]);			if( s.match('comment=') ){return "VoiceMenu " + s.split('comment=')[1];}		}		return null;	}	var get_ringGroupExtensions = function(c){		var r,s;		for( r =0; r < c.length; r++){			s = ASTGUI.parseContextLine.read(c[r]);			if( s[0] == "exten" && c[r].match(RG_FORMAT) && c[r].match('Goto') ) {				var u = s[1].split('Goto(')[1].split('|')[0];				var f = u.substr(RG_FORMAT.length);				if(!ringgroups[f]){ ringgroups[f] = {}; }				ringgroups[f].rgExten = ASTGUI.parseContextLine.getExten(s[1]);			}		}	}	for( l in n ){	if(n.hasOwnProperty(l)){		if(l == specialcontext){			get_ringGroupExtensions(n[l]);			continue;		}		t = l.substr(0,RG_FORMAT.length);		if(  t == RG_FORMAT ){ // if is a ring group			parse_addtoringgroups(l, n[l]);			continue;		}		t = l.substr(0,17);		if( t =='voicemenu-custom-' ){ // if is a Voice Menu			ASTGUI.selectbox.append(el,get_menuname(n[l]), 'Goto('+ l + '|s|1)' );		}	}}	clear_table();	showlist_of_rules();}function parse_addtoringgroups(u, v){	//ringgroups	var f = u.substr(RG_FORMAT.length);	if(!ringgroups[f]){ ringgroups[f] = {}; }	var this_ringgroup = ringgroups[f];	this_ringgroup.rgname = u;	this_ringgroup.rgchannels = [];	this_ringgroup.laststep = '';	this_ringgroup.ringstyle = '';	if(  v[0].match(RG_COMMENT+'=')  ){		f = v[0].split(RG_COMMENT+'=');		this_ringgroup.rgname = f[1] ;	}	var nd=0, indexes=[];	for( var a=1; a < v.length-1; a++ ){		if( v[a].match('s,n,Dial') ) {			nd++;			indexes.push(a);		}	}	var rc;	if(nd==1){ 		this_ringgroup.ringstyle = 'ringall';		rc = v[indexes[0]].split('Dial(')[1].split(',')[0].split('&') ;		this_ringgroup.ringTime = v[indexes[0]].split('Dial(')[1].split(',')[1].split(')')[0] ;		for(a=0; a < rc.length; a++){ this_ringgroup.rgchannels.push(rc[a]); }	}	if(nd>1){		this_ringgroup.ringstyle = 'ringinorder';		for(a=0; a < indexes.length; a++){			rc = v[indexes[a]].split('Dial(')[1].split(',')[0];			this_ringgroup.ringTime = v[indexes[a]].split('Dial(')[1].split(',')[1].split(')')[0] ;			this_ringgroup.rgchannels.push(rc);		}	}	// finally take a look at last step - if no one answers	this_ringgroup.laststep = v[v.length-1].split('s,n,')[1];}function add_rg(){	var u;	isNewRG = 1;	_$('form_caption').innerHTML = "<B>Add Ring Group</B>";	_$('select_voicemails').style.display = "none";	_$('select_vmenus').style.display = "none";	_$('radio_fbhgp').checked = true;	_$('text_rgname').value = '';	_$('text_rgExten').value = '';	_$('ringgroup_editdiv').style.display = '';	_$('text_ringTime').value = "20"; 	var r = _$('select_ringthesechannels');	var y = _$('select_listofchannels');	ASTGUI.selectbox.clear(r);	ASTGUI.selectbox.clear(y);	for( var u in LISTOFCHANNELS ){ if(LISTOFCHANNELS.hasOwnProperty(u)) {		ASTGUI.selectbox.append( y, LISTOFCHANNELS[u]['ChannelName'], u );	}}}function cancel_rg(){ _$('ringgroup_editdiv').style.display = 'none'; }</script><body onload="localajaxinit()"  bgcolor="FFFFFF"><div style="font-size : 12px; padding : 4px 6px 4px 6px; border-style : solid none solid none; border-top-color : #BDC7E7; border-bottom-color : #182052; border-width : 1px 0px 1px 0px; background-color : #ef8700; color : #ffffff;">	<span style="margin-left: 4px;font-weight:bold;">Ring Groups</span>	<span style="cursor: pointer; cursor: hand;" onclick="window.location.href=window.location.href;" >&nbsp;<img src="images/refresh.png" title=" Refresh " border=0 >&nbsp;</span>	&nbsp;&nbsp;	<input id="create_rule" type=button value="New Ring Group" class="input8" onclick="add_rg();"></div><div id="maintable1">	<table class="table_blacksm" cellpadding=2 cellspacing=2 border=0 align=center width=500 id="table_one">		<tr>	<td width=35>S.No</td>			<td align=left>Ring Group</td>			<td align="center" width=115>Options</td>		</tr>	</table>	<div id="rgsTable_div" style="height:430px;width=100%; overflow :auto; padding : 0px 0px 0px 0px;">		<table id="rgsTable" cellpadding=2 cellspacing=1 border=0 align=center width=500 bgcolor="#DEDEDE"></table>	</div>	<BR></div><div id="ringgroup_editdiv" STYLE="display:none; position: absolute; left: 20; top: 40; width:480; height:430; background-color:#F4EFE5; border-width: 1px; border-color: #7E5538; border-style: solid; z-index:5">	<table width="100%" cellpadding=0 cellspacing=0  onmousedown="ASTGUI.startDrag(event , 'ringgroup_editdiv');">	<TR bgcolor="#7E5538"  style="background-image:url('images/title_gradient.gif');">		<TD><font color="#FFFFFF">&nbsp;&nbsp;<span id="form_caption"></span></FONT></TD>		<TD Height="20" align="right" style="cursor: move">			<A href="#" onclick="$('cancel').click();" style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</A>		</TD>		<TD width=4></TD>	</TR>	</table>	<table cellpadding=2 cellspacing=2 border=0 width="100%" align="center">		<tr>			<td>Name: <input type="text" id="text_rgname" size=15 class="input9"></td>			<td colspan=2 align="center">				Strategy: <select id="select_strategy" class="input8"><option value="ringall">Ring all</option><option  value="ringinorder">Ring in Order</option></select>			</td>		</tr>		<tr>	<td width=200 align=center valign=top>				<select id="select_ringthesechannels" style="width: 175px" class="input10" size=8></select>			</td>			<td width=80 align=center valign=top>				<input type="button" id="button_add_toringlist" value="&#8592;"><BR><BR>				<input type="button" id="button_remove_fromringlist" value="&#8594;">				<BR><BR>				<input type="button" id="button_removeall_fromringlist" value="&#187;&#187;">			</td>			<td width=200 align=center valign=top>				<select id="select_listofchannels" style="width: 175px" class="input10" size=8></select>			</td>		</tr>		<tr>	<td align=center valign=top>				<B>Ring Group Members</B>			</td>			<td width=80 align=center>			</td>			<td width=200 align=center valign=top>				<B>Available Channels</B>			</td>		</tr>		<tr>	<td align=center valign=top colspan=3>			Extension for this ring group (optional) : <input type=text id="text_rgExten" size=5 class="input9">			</td>		</tr>		<tr>	<td align=center valign=top colspan=3>			Ring (each/all) for these many seconds : <input type=text id="text_ringTime" size=2 class="input9">			</td>		</tr>		<tr>	<td colspan=2 align="left" class="field_text">				If not answered <BR>				<LABEL FOR="radio_fbvm">				<input name='failbacktype' type='radio' id='radio_fbvm' value='radio_fbvm'>Goto Voicemail of this user</LABEL><BR>				<LABEL FOR="radio_fbivr">				<input name='failbacktype' type='radio' id='radio_fbivr' value='radio_fbivr'>Goto an IVR menu</LABEL><BR>				<LABEL FOR="radio_fbhgp">				<input name='failbacktype' type='radio' id='radio_fbhgp' value='radio_fbhgp'>HangUp</LABEL>			</td>			<td>				<select id="select_voicemails" class="input8"></select>				<select id="select_vmenus" class="input8"></select>			</td>		</tr>		<tr>	<td align=center colspan=3 valign=bottom height=40>				<input id="save" type=button value="Save" class="input9" onclick="save_rg();">&nbsp;&nbsp;				<input id="cancel" type=button value="Cancel" class="input9" onclick="cancel_rg();">			</td>		</tr>	</table></div></body>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -