pari: branch 2.0 r4091 - /branches/2.0/config/voicemail.html

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Mon Nov 10 15:46:04 CST 2008


Author: pari
Date: Mon Nov 10 15:46:04 2008
New Revision: 4091

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

  Close AA50-2307 - Setting 'Direct Voicemail Dial' doesn't add the 'a' extension for VoicemailMain



Modified:
    branches/2.0/config/voicemail.html

Modified: branches/2.0/config/voicemail.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/voicemail.html?view=diff&rev=4091&r1=4090&r2=4091
==============================================================================
--- branches/2.0/config/voicemail.html (original)
+++ branches/2.0/config/voicemail.html Mon Nov 10 15:46:04 2008
@@ -28,9 +28,39 @@
 
 </style>
 <script>
+
+//
+/*
+; direct voicemail dial - version 0.1
+[default]
+exten = _*6XXX,1,VoiceMail(${EXTEN:1}@default) 
+exten = 5700,1,VoiceMailMain(${CALLERID(num)}@default)
+
+
+
+; direct voicemail dial - version 0.2
+[default]
+exten = _#6XXX,1,VoiceMail(${EXTEN:1}@default,s) 
+exten = 5700,1,VoiceMailMain(${CALLERID(num)}@default)
+
+
+
+; direct voicemail dial - version 0.3
+[default]
+exten = _#6XXX,1,Set(MBOX=${EXTEN:1}@default)
+exten = _#6XXX,n,VoiceMail(${MBOX})
+exten = a,1,VoicemailMain(${MBOX})
+exten = 5700,1,VoiceMailMain(${CALLERID(num)}@default)
+
+
+*/
+//
+
+
+var TMP_VMEXTEN_TODELETE = '';
 var TODELETE = '';
 var OLD_DVD = '1,VoiceMail(${EXTEN:1}@default' ;
-var DVD = ',1,VoiceMail(${EXTEN:1}@default,s)' ; // direct voicemail dial
+//var DVD = ',1,VoiceMail(${EXTEN:1}@default,s)' ; // direct voicemail dial
 
 var localajaxinit = function( ){
 	(function (){
@@ -56,7 +86,8 @@
 		_$('directVoiceMailDial').checked = false;
 		var r = context2json({ filename:'extensions.conf' , context : 'default' , usf:0 });
 		for( var ri = 0; ri < r.length ; ri ++ ){
-			if( (r[ri].beginsWith('exten=_*') || r[ri].beginsWith('exten=_#') )&& r[ri].contains(DVD) ){
+			if( ((r[ri].beginsWith('exten=_*') || r[ri].beginsWith('exten=_#') ) && r[ri].contains(OLD_DVD) ) || r[ri].contains( 'Set(MBOX=${EXTEN:1}@default)' ) ){
+				TMP_VMEXTEN_TODELETE = ASTGUI.parseContextLine.getExten(r[ri]);
 				_$('directVoiceMailDial').checked = true;
 				break;
 			}
@@ -105,23 +136,31 @@
 	};
 
 
-
 	(function(){
+		var tmp_arr = [ 'exten=a,' ] ;
+		if( TMP_VMEXTEN_TODELETE.trim().length ){
+			tmp_arr.push( 'exten=' + TMP_VMEXTEN_TODELETE );
+		}
+
 		ASTGUI.miscFunctions.delete_LinesLike(
-			{ context_name : 'default' ,
-				beginsWithArr: ['exten=_*','exten=_#'] ,
+			{
+				context_name : 'default' ,
+				beginsWithArr: tmp_arr ,
 				filename: 'extensions.conf',
-				hasThisString: OLD_DVD,
-				cb:function(){}
+				//hasThisString: TMP_VMEXTEN_TODELETE,
+				cb:function(){
+					var ues = parent.sessionData.GUI_PREFERENCES.ue_start ;
+					if( _$('directVoiceMailDial').checked && ues ){
+						var tmp_dvdExten = '_#' + ues.charAt(0) + 'X'.times( String(ues).length -1 ) ;
+						var u = new listOfSynActions('extensions.conf');
+						u.new_action('append', 'default', 'exten', tmp_dvdExten + ',1,Set(MBOX=${EXTEN:1}@default)' );
+						u.new_action('append', 'default', 'exten', tmp_dvdExten + ',n,VoiceMail(${MBOX})' );
+						u.new_action('append', 'default', 'exten', 'a,1,VoicemailMain(${MBOX})');
+						u.callActions();
+					}
+				}
 			}
 		);
-
-		if( _$('directVoiceMailDial').checked && parent.sessionData.GUI_PREFERENCES.ue_start ){
-			var s = '_#' + parent.sessionData.GUI_PREFERENCES.ue_start.charAt(0) + 'X'.times( String(parent.sessionData.GUI_PREFERENCES.ue_start).length -1 ) + DVD ;
-			var u = new listOfSynActions('extensions.conf');
-			u.new_action('append', 'default', 'exten', s);
-			u.callActions();
-		}
 	})();
 
 




More information about the asterisk-gui-commits mailing list