Part 1 learn and compile exsisting
In MyExcel.cs , find a reference to
|
using Excel = Microsoft.Office.Interop.Excel; |
If really need this component ?
solution is :

Now this program can be compiled , When it is normally running on server 24 , the interface is this form :

Part 2 How to simulate a run-time environment
- First , install filezilla server in local machine , set username , pwd ,and home folder
- Second , create a sql server DB for test , here is all needed script
CreateDBSQL
- Then , config connection string in catcher program
- Create Catcher_VMS.cs for VMS cdr format
- final the program can run normally .
Part 3 Code analyze
- Catcher_InsertThread.cs only duty for insert cdr into db , cdr is come from
|
if (!m_CDRPool.TryDequeue(out cdr)) |
But , where m_CDRPool was EnQueue ? in Catcher.cs ‘s Worker() function , processcdr function do it .
Part 4 VMS side cdr format
here is the zip file : 20180718160119_09
in this file , exist such column of CDR :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
com_id = 0 ref_no = 'eb5fe71d-0644-46b6-bb1a-df431d3d7ea3-a363' Y in_call_time = '2018-07-18 15:59:41.961' Y out_call_time = '2018-07-18 15:59:42.010' alert_time = '2018-07-18 15:59:42.022' answer_time = '2018-07-18 15:59:47.047' Y release_time = '2018-07-18 16:01:19.055' Y call_type = '4' op_id = 'WHCTEST(IN)' Y b_pin = 'c2c_ws' r_pin = 'c2c_ws' prov_id = '84' prov_area_code = '' status_code = 408 Y cause_code = 102 Y error_code = 0 max_talk_len = 86400 talk_len = 92 Y exact_call_len = 98 Y first_disc = 'O' final_release = 1 called = '55556011234567' Y caller = '852446913' Y to_called = '55556011234567' Y mod_called = '55556011234567' Y mod_caller = '852446913' Y out_called = '332996011234567' Y out_caller = '852446913' Y c_rpp_prof_name = '' p_rpp_prof_name = '' route_prof_name = '' rm_area_code = '' route_plan_name = '' period_plan = '' a_call_hd = '2C3AA624' a_sgn_call_id = '92494-19872@103.244.191.198' a_node_id = 82 a_ptime = 20 a_codec = 0 a_loc_addr = '103.244.191.198' Y a_loc_port = 6000 a_rem_addr = '103.244.191.198' Y a_rem_port = 6001 a_is_answer = 1 a_rx_bytes = 0 a_rx_packets = 0 b_call_hd = 'F01AF44D' b_sgn_call_id = 'ac7e8611-fa4b-494a-b303-9b9f5e1f5195-0xF01AF44D' b_node_id = 84 b_ptime = 20 b_codec = 0 b_loc_addr = '103.244.191.198' b_loc_port = 6001 b_rem_addr = '103.244.191.198' b_rem_port = 6000 b_is_answer = 1 b_rx_bytes = 0 b_rx_packets = 0 upd_user = 'SWITCH' upd_prog = 'SWITCH' upd_date = getdate() reserved1 = 'ALEG()IPS(103.244.191.198:5030)PVL(84)' reserved2 = 'BLEG()IPS(103.244.191.198:5090)' |
- next , look at how SH ‘s catcher deal with CDR file , it is in this function
Catcher_misc.cs ‘s
|
void ProcessCDR(int CDRID, string folder, string filename, int start_position, ref int end_position, ref int raw_cdr, ref int valid_cdr, ref int proc_cdr, ref int bad_cdr) |
Part 5 Q&A
- what CatcherName,CDRID,SwitchID mean ?
CatcherName is the name of catcherlist .
Switch mean each FTP server , it include
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
public int DetailID; public string SwitchID; public string HostName; public string IPAddr; public string FTPUser; // FTP indentify public string FTPPwd; public int FTPUsePassive; public string CDRFormatID; // for this switch ,use which format public string CDRPath; //cdr file store path public string Extension; //what cdr file extension , txt or else public string CatcherID; //correspond catch ID public string FilterID; public double AlarmErrRate; public string Email; public int CheckFTPInterval; public DateTime StartDate; public int Active; public int insert_thread; public int pool_size; |
it is defined in Catch.cs ‘s worker function
and assigned from store procedure :
|
DBCommands.sp_Catcher_CreateFile(CatcherList.CatcherName, mConfig.SwitchID, mConfig.CDRPath, file.name, file_date, file_size, download_from, downloaded_size, DateTime.Now, speed, ref CDRID)) |
- How to create a test FTP server on win 10
- what is the purpose of catcher ‘s filter ?
Part 6 DB
CreateDBSQL
Appendix
- Visual studio : expand all code —> Ctrl + M + P , Unexpand all code —> Ctrl + M + O
- How to delete split container control : click the control , then press escape , then press delete key .
- How to convert yyyy-MM-dd HH:mm:ss fff to datetime
|
cdr.SetupTime = DateTime.ParseExact(ss[64], "yyyy-MM-dd HH:mm:ss.fff", null); |
See Also
TODO
———————————————– 2018-8-15
关闭窗口前提示: 否则线程泄露
窗口版本号,日期
程序图标
VMS format 读到 go 的时候,跳过, 不报错
设置连接串的地方
rateplan, help , about 去掉
右边2个listview设置固定时间刷新 — 10 分钟
Settings
- local ftp server login : liuyang , piercing