pari: branch 2.0 r4261 - /branches/2.0/config/js/

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Dec 2 15:53:45 CST 2008


Author: pari
Date: Tue Dec  2 15:53:45 2008
New Revision: 4261

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=4261
Log:


 Making Changes to allow use of 'Skype' as a possible trunk in Calling Rules



Modified:
    branches/2.0/config/js/astman.js
    branches/2.0/config/js/callingrules.js
    branches/2.0/config/js/pbx.js

Modified: branches/2.0/config/js/astman.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/astman.js?view=diff&rev=4261&r1=4260&r2=4261
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Tue Dec  2 15:53:45 2008
@@ -1830,6 +1830,11 @@
 					var channel = u[0] + '/' + u[1] ;
 					u.splice(0,2);
 					WhatToDial = u.join('/'); // take the part after second '/'
+				}
+				if( u.length == 2){
+					var trunkname = u[0] ;
+					var channel = u[0] ;
+					var WhatToDial = u[1] ;
 				}
 			}
 			// we expect WhatToDial to be in '1${EXTEN:1}' or in '${EXTEN}' or in '${EXTEN:1}' or in '9${EXTEN}' format or a plain extensin string

Modified: branches/2.0/config/js/callingrules.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/callingrules.js?view=diff&rev=4261&r1=4260&r2=4261
==============================================================================
--- branches/2.0/config/js/callingrules.js (original)
+++ branches/2.0/config/js/callingrules.js Tue Dec  2 15:53:45 2008
@@ -60,6 +60,7 @@
 	}else{
 		_$('toLocalDest').checked = false;
 		ASTGUI.selectbox.selectOption(DOM_new_crl_trunk, tmp_cr.firstTrunk );
+
 		DOM_new_crl_tr_stripx.value = tmp_cr.stripdigits_firstTrunk  ;
 		DOM_new_crl_tr_prepend.value = tmp_cr.firstPrepend ;
 		if(tmp_cr.secondTrunk){
@@ -116,6 +117,12 @@
 			ASTGUI.selectbox.append( DOM_new_crl_trunk, a[0], a[1] );
 			ASTGUI.selectbox.append( DOM_new_crl_fotrunk , a[0], a[1] );
 		});
+
+		var modules_show = ASTGUI.cliCommand('module show');
+		if( modules_show.contains('res_skypeforasterisk') && modules_show.contains('chan_skype.so') ){
+			ASTGUI.selectbox.append( DOM_new_crl_trunk , 'Skype', 'Skype');
+			ASTGUI.selectbox.append( DOM_new_crl_fotrunk , 'Skype', 'Skype');
+		}
 	})();
 };
 
@@ -305,15 +312,18 @@
 			return ;
 		}
 
-		var Trunk_Build_str = ',${' + t1 + '}/' + DOM_new_crl_tr_prepend.value + '${EXTEN:' + tmp_stripx  + '}' ;
+		var t1_braces = (t1 == 'Skype') ? t1 : '${' + t1 + '}' ;
+		var Trunk_Build_str = ',' + t1_braces + '/' + DOM_new_crl_tr_prepend.value + '${EXTEN:' + tmp_stripx  + '}' ;
 		var foTrunk_Build_str = ',' ;
+
 		if(DOM_new_crl_foChkbx.checked){
-			foTrunk_Build_str += '${' + t2 + '}/' + DOM_new_crl_fotr_prepend.value + '${EXTEN:' + tmp_fotr_stripx + '}' ;
-		}
-
-		var t1 = ',' + t1 ;
-		var t2 = ',' + t2 ;
-		var as = DOM_new_crl_pattern.value + ',1,Macro(' + ASTGUI.contexts.dialtrunks + Trunk_Build_str + foTrunk_Build_str + t1 + t2 + ')' ;
+			var t2_braces = (t2 == 'Skype') ? t2 : '${' + t2 + '}' ;
+			foTrunk_Build_str += t2_braces + '/' + DOM_new_crl_fotr_prepend.value + '${EXTEN:' + tmp_fotr_stripx + '}' ;
+		}
+
+		var t1_cidarg = ( t1 == 'Skype') ? ',' : ',' + t1 ;
+		var t2_cidarg = ( t2 == 'Skype') ? ',' : ',' + t2 ;
+		var as = DOM_new_crl_pattern.value + ',1,Macro(' + ASTGUI.contexts.dialtrunks + Trunk_Build_str + foTrunk_Build_str + t1_cidarg + t2_cidarg + ')' ;
 	}
 
 	if( isNew ){

Modified: branches/2.0/config/js/pbx.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/pbx.js?view=diff&rev=4261&r1=4260&r2=4261
==============================================================================
--- branches/2.0/config/js/pbx.js (original)
+++ branches/2.0/config/js/pbx.js Tue Dec  2 15:53:45 2008
@@ -1091,6 +1091,7 @@
 		},
 
 		getTrunkName: function(TRUNK){ // astgui_managetrunks.misc.getTrunkName(TRUNK)
+			if( TRUNK == 'Skype' ) return TRUNK ;
 			var r = sessionData.pbxinfo.trunks;
 			if ( r.sip[TRUNK] ) { return r.sip[TRUNK]['trunkname'] || TRUNK ; }
 			if ( r.iax[TRUNK] ) { return r.iax[TRUNK]['trunkname'] || TRUNK ; }




More information about the asterisk-gui-commits mailing list