2012年2月23日 星期四

如何將 Lync 與 FreePBX/ Trixbox 整合


花很多時間將 Lync 2010 FE 透過 Lync Mediation Server 連接FreePBX( Trixbox),如果沒有做成文件,以後一定會找不到。

所需的東西:
1. TrixBox (目前可抓到 Trixbox 2.8.0.4 CE) , 相關說明如下
http://www.diybl.com/course/6_system/linux/Linuxjs/2008106/148288.html
http://www.msexchange.org/articles_tutorials/exchange-server-2010/mobility-client-access/how-configure-unified-messaging-asterisk-sip-gateway-part2.html

2. Client : 3CXPhone
http://www.3cx.com/VOIP/voip-phone.html

3. TrixBox 設定方法:
http://www.fintechcommunications.com/blog/?p=60
http://imaucblog.com/archive/2009/10/03/part-1-how-to-integrate-exchange-2010-or-2007-with-trixbox-2-8/

4. Lync 設定方法:
http://www.circuitid.com/blog/lync-setup-guide-using-circuitid-part-1-configuring-mediation-server
http://www.circuitid.com/blog/lync-setup-guide-using-circuitid-part-2-configuring-voice-routing

5. 注意事項:
Lync 內部都走E.164 (+開頭的Formate,例如:+2015),如果透過SIP Trunk丟給PBX時,有的FreePBX 不接受"+"號,需將+號移除。

這個動作在Lync 叫 : Outbound route translation ,(說明請看:Translating Outbound dials strings)
http://technet.microsoft.com/en-us/library/gg412757.aspx
http://technet.microsoft.com/en-us/library/gg425831.aspx
http://blogs.technet.com/b/csps/p/uimap59.aspx

如果效果是要將E.164 的formate (例如:+2015) 往 PSTN Gateway 送時,就會取消"+",為 2015 。  
則可於Trunk Configuration 內這樣設定:
Starting digits = +2 : 開頭為+2
Length= exactly 5 : 這裡的Length 是說含加號,共五碼 (例如: +2015)
Digits to remove = 1 : 移除第一碼,即加號
Digits to add = "": 不加上任何字元
http://designinglync.blogspot.com/2011/05/lync-dial-plans-and-normalization-rules.html

6. 語音/視訊通訊最低頻寬說明:
http://technet.microsoft.com/zh-tw/library/gg398334.aspx

7. Trixbox 有用的說明
http://www.freepbx.org/support/documentation/howtos/howto-setting-up-voip-provider-trunks/freepbx-sip-trunks-powered-by-ban

2012年2月7日 星期二

archive system log by schedule tasks


' 由於某些軟體會產生大量的檔案,特建立備存機制,
' 1. 將特定目錄下的子目錄都備存起來,並刪除空的子目錄
' 2. 需先安裝WINRAR
' 3. 將下列程式做成.vbs 檔案
' 4. 建立Task schedule , 將備存的目錄設為參數
'
'--- .vbs 程式開始
Option Explicit
 
' 宣告變數
Dim FSO, agoDays, modifiedDate, ArcFolder  ,myArgs, GetDateTimeFM, wshshell

' 建立檔案系統物件(File System Object)
Set FSO = CreateObject("Scripting.FileSystemObject")
' 建立執行的shell 物件
Set wshshell=createobject ("wscript.shell")
'取得第一個變數
Set myArgs = WScript.arguments
' 欲備存檔案所在之目錄    
ArcFolder = myArgs(0)
' 取得日期(yyyy_mm_dd_hh_nn_ss)
GetDateTimeFM = GetFormattedDateTime()

' 呼叫備存檔案的子程序
ArcFilesInFolder FSO.GetFolder(ArcFolder)    

' 呼叫刪除空Folder的子程序
DelFoldersInFolder FSO.GetFolder(ArcFolder)    

' 備存目錄的子程序
Sub ArcFilesInFolder(folder)
  ' 宣告變數
  Dim file, subFolder,strshell
  ' 如果遇到子目錄,也要進去檢查並刪除
  For Each subFolder in folder.SubFolders
      strshell = "WinRAR.exe a -r -df " + SubFolder + "-dt-" + GetDateTimeFM + ".rar " + subFolder + "\"
      Call wshshell.run (strshell,0)
Next
End Sub  

' 刪除檔案的子程序
Sub DelFoldersInFolder(folder)
  ' 宣告變數
  Dim dfile, dsubFolder, fdEmpty  
  ' 如果遇到子目錄,要先進去檢查並刪除
  For Each dsubFolder in folder.SubFolders
      DelFoldersInFolder dsubFolder
Next  
  fdEmpty = True
  ' 找出目前所在目錄內所有的檔案
  For Each dfile In folder.Files ' 檢查檔案日期是否符合條件,若符合,就刪除
      fdEmpty = False
  Next    
  For Each dsubFolder in folder.SubFolders
  fdEmpty = False
    Next
    If fdEmpty = True Then
    folder.delete
  End If
End Sub  

' 取得日期的函式
Function GetFormattedDateTime
  Dim strNow, strDD, strMM, strYYYY,strHH,strNN,strSS
strYYYY = DatePart("yyyy",Now())
strMM = Right("0" & DatePart("m",Now()),2) 'month
strDD = Right("0" & DatePart("d",Now()),2) 'day
strHH = Right("0" & DatePart("h",Now()),2) 'hour
strNN = Right("0" & DatePart("n",Now()),2)  'mintue
strSS = Right("0" & DatePart("s",Now()),2) 'second
GetFormattedDateTime = strYYYY & "_" & strMM & "_" & strDD & "_" & strHH & "_" & strNN & "_" & strSS
End Function
'--- .vbs 程式結束

2012年2月6日 星期一

How to archive Discussion Application in Lotus Notes?

開發過Lotus Notes 應用系統系統的都知道,只要文件Copy再貼上,@DocumentUnid 一定不一樣,因次,應用系統通常都會自己建一個 UniqueID 欄位,來處理文件複製/貼上而造成相關文件對應不起來的這種問題。

但是, Discussion 是一個特別的資料庫,它是討論區,既然是"討論",就會有前/後(主文/回應/回應的回應)的問題,除非所有預設的View 都再客制,否則無法以自製 UniqueID來處理前/後文關係,因此通常都不再客制Document ID欄位。

這時後的備存,只能使用系統預設的備存工具,來保留資料移動到不同系統/目錄時,仍能有相同的Document ID。

1. 先設定Archiving Rule : Database => Properties => Archive Setting => Archive settings 設定視窗
   Basics => 設定目的地 (A Server 到 B Server )
   Criteria => 同Mail , 設定那些目錄需備存
   Advanced => 正常備存後刪除
   Schedule => 不能設...怎麼辦? 
2. 設定代理程式,自動啟動備存排程: 
Dim s As New notessession
Dim db As notesdatabase
Set db = s.currentdatabase
Call db.archiveNow()
Exit Sub