public void HostRecordedFiles(object lstparam) { try { List <object> lstTempObj = (List <object>)lstparam; strUri = lstTempObj[0].ToString(); NetPeerClient npcRecordedFiles = new NetPeerClient(); ((NetP2PBootStrapRecordedFileDelegate)objRecordedFiles).EntsvcRecordedFileJoin += new NetP2PBootStrapRecordedFileDelegate.delsvcRecordedFileJoin(PredictiveDialer_EntsvcRecordedFileJoin); ((NetP2PBootStrapRecordedFileDelegate)objRecordedFiles).EntsvcSendRecordedFiles += new NetP2PBootStrapRecordedFileDelegate.delsvcSendRecordedFiles(PredictiveDialer_EntsvcSendRecordedFiles); ((NetP2PBootStrapRecordedFileDelegate)objRecordedFiles).EntsvcRecordedFileUnJoin += new NetP2PBootStrapRecordedFileDelegate.delsvcRecordedFileUnJoin(PredictiveDialer_EntsvcRecordedFileUnJoin); channelNetTcpUploadRecorededFiles = (INetP2PBootStrapRecordedFileChannel)npcRecordedFiles.OpenClient <INetP2PBootStrapRecordedFileChannel>(strUri, lstTempObj[1].ToString(), ref objRecordedFiles); clsMessageContract objContract = new clsMessageContract(); objContract.uname = VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName; objContract.fName = ""; objContract.fExtension = ""; objContract.fLength = 0; objContract.fStream = new MemoryStream(); channelNetTcpUploadRecorededFiles.svcRecordedFileJoin(objContract); } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "HostRecordedFiles()", "MyDialer.xaml.cs"); } }
public void svcBtnUp(clsMessageContract streamButtonUp) { if (EntsvcBtnUp != null) { EntsvcBtnUp(streamButtonUp); } }
public void svcAllowControl(clsMessageContract streamControl) { if (EntsvcAllowControl != null) { EntsvcAllowControl(streamControl); } }
public void svcRecordedFileUnJoin(clsMessageContract mcRFUnJoin) { if (EntsvcRecordedFileUnJoin != null) { EntsvcRecordedFileUnJoin(mcRFUnJoin); } }
public void svcSendRecordedFiles(clsMessageContract mcSendRecordedFiles) { if (EntsvcSendRecordedFiles != null) { EntsvcSendRecordedFiles(mcSendRecordedFiles); } }
public void svcAllowView(clsMessageContract streamView) { if (EntsvcAllowView != null) { EntsvcAllowView(streamView); } }
public void svcSendXY(clsMessageContract streamXY) { if (EntsvcSendXY != null) { EntsvcSendXY(streamXY); } }
public void svcBtnDown(clsMessageContract mcBtnDown) { if (EntsvcBtnDown != null) { EntsvcBtnDown(mcBtnDown); } }
public void svcSetUserList(clsMessageContract streamSetUserList) { if (EntsvcSetUserList != null) { EntsvcSetUserList(streamSetUserList); } }
public void svcStopControl(clsMessageContract streamUName) { if (EntsvcStopControl != null) { EntsvcStopControl(streamUName); } }
public void svcSelectedDesktop(clsMessageContract mcSelectedDesktop) { if (EntsvcSelectedDesktop != null) { EntsvcSelectedDesktop(mcSelectedDesktop); } }
public void svcStopControl(clsMessageContract mcStopControl) { if (EntsvcStopControl != null) { EntsvcStopControl(mcStopControl); } }
public void svcSendMessage(clsMessageContract mcSendMessage) { if (EntsvcSendMessage != null) { EntsvcSendMessage(mcSendMessage); } }
public void svcGetUserList(clsMessageContract mcGetUserList) { if (EntsvcGetUserList != null) { EntsvcGetUserList(mcGetUserList); } }
public void svcJoin(clsMessageContract mcJoin) { if (EntsvcJoin != null) { EntsvcJoin(mcJoin); } }
public void svcSendXY(clsMessageContract mcSendXY) { if (EntsvcSendXY != null) { EntsvcSendXY(mcSendXY); } }
public void svcBtnUp(clsMessageContract mcBtnUp) { if (EntsvcBtnUp != null) { EntsvcBtnUp(mcBtnUp); } }
public void svcJoin(clsMessageContract streamUName) { if (EntsvcJoin != null) { EntsvcJoin(streamUName); } }
public void svcBtnDown(clsMessageContract streamButtonDown) { if (EntsvcBtnDown != null) { EntsvcBtnDown(streamButtonDown); } }
public void svcSendMessage(clsMessageContract streamImage) { if (EntsvcSendMessage != null) { EntsvcSendMessage(streamImage); } }
void RegPresentationp2pClient(string P2PUri) { try { NetPeerClient npcDummyPresentation = new NetPeerClient(); objNetTcpPresentation = new clsNetTcpPresentation(); ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcJoin += new clsNetTcpPresentation.delsvcJoin(P2PPresentationClient_EntsvcJoin); ((clsNetTcpPresentation)objNetTcpPresentation).EntsvcUnJoin += new clsNetTcpPresentation.delsvcUnJoin(P2PPresentationClient_EntsvcUnJoin); channelNettcpPresentation = (INetTcpPresentationChannel)npcDummyPresentation.OpenClient <INetTcpPresentationChannel>(P2PUri, P2PUri.ToString().Split(':')[2].Split('/')[2], ref objNetTcpPresentation); while (tempcounter < 20) { try { clsMessageContract objContract = new clsMessageContract(); objContract.strFrom = UserName; objContract.strMsg = ""; channelNettcpPresentation.svcJoin(objContract); tempcounter = 20; } catch { tempcounter++; System.Threading.Thread.Sleep(1000); } } } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "RegPresentationp2pClient()", "P2PPresentationClient.cs"); } }
public void svcSelectedDesktop(clsMessageContract streamUName) { if (EntsvcSelectedDesktop != null) { EntsvcSelectedDesktop(streamUName); } }
public void svcSendKey(clsMessageContract streamKey) { if (EntsvcSendKey != null) { EntsvcSendKey(streamKey); } }
void P2PPresentationClient_EntsvcJoin(clsMessageContract mcJoin) { try { } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "P2PPresentationClient_EntsvcJoin()", "P2PPresentationClient.cs"); } }
public clsGetMessage svcGetMessages(clsMessageContract streamRecipient) { if (EntsvcGetMessages != null) { return(EntsvcGetMessages(streamRecipient)); } else { return(null); } }
public IAsyncResult BeginsvcGetSlide(clsMessageContract mcSRecipient, AsyncCallback callback, object asyncState) { if (EntBeginsvcGetSlide != null) { return(EntBeginsvcGetSlide(mcSRecipient, callback, asyncState)); } else { return(null); } }
void PresentationDummy_EntsvcSetSlide(clsMessageContract mcSetSlide) { try { channelNettcpPresentation.svcSetSlide(mcSetSlide); } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "PresentationDummy_EntsvcSetSlide()", "PresentationDummy.cs"); } }
void PresentationDummy_EntsvcGetUserList(clsMessageContract mcGetUserList) { try { channelNettcpPresentation.svcGetUserList(mcGetUserList); } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "PresentationDummy_EntsvcGetUserList()", "PresentationDummy.cs"); } }
void PresentationDummy_EntsvcJoin(clsMessageContract mcJoin) { try { lstNodes.Add(mcJoin.strFrom); hashMessages.Add(mcJoin.strFrom, new List <clsMessageContract>()); } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "PresentationDummy_EntsvcJoin()", "PresentationDummy.cs"); } }
public void svcSendRecordedFiles(clsMessageContract mcSendRecordedFiles) { try { if (EntsvcSendRecordedFiles != null) { EntsvcSendRecordedFiles(mcSendRecordedFiles); } } catch (Exception ex) { ClsException.WriteToLogFile("svcSendRecordedFiles() :- NetP2PBootStrapRecordedFileDelegate.cs" + ex.Message); } }
public void svcRecordedFileUnJoin(clsMessageContract mcRFUnJoin) { try { if (EntsvcRecordedFileUnJoin != null) { EntsvcRecordedFileUnJoin(mcRFUnJoin); } } catch (Exception ex) { ClsException.WriteToLogFile("svcRecordedFileUnJoin() :- NetP2PBootStrapRecordedFileDelegate.cs" + ex.Message); } }
void fncRecordedFileUpload(long LeadID, DateTime CalledDate, long DispositionID) { try { string ZoneName = Dialer_AutoProgressive.Business.ClsDisposition.GetZoneName(LeadID); string DispositionName = channelManager.GetDispositionName(DispositionID); string PhoneNo = channelManager.GetPhoneNo(LeadID); //Point out to the file from a specific folder DateTime dt = DateTime.Now; string FilePath = StrOrkaInstallDirectory + @"\AudioRecordings\" + dt.ToString("yyyy") + "\\" + dt.ToString("MM") + "\\" + dt.ToString("dd") + "\\" + dt.ToString("HH"); string[] FileName = Directory.GetFiles(FilePath); //string fname = System.IO.Path.GetFileName(FileName[0] string oldFilePath = FilePath + "\\" + System.IO.Path.GetFileName(FileName[0]); string fext = System.IO.Path.GetExtension(FileName[0]); string date = CalledDate.ToString("yyyy") + CalledDate.ToString("MM") + CalledDate.ToString("dd"); string time = CalledDate.ToString("HH") + "." + CalledDate.ToString("mm") + "." + CalledDate.ToString("ss"); string newFileName = DispositionName + "_" + ZoneName + "_" + date + "_" + time + "_" + PhoneNo + fext; string newFilePath = FilePath.Trim() + "\\" + newFileName.Trim(); FileInfo fi = new FileInfo(oldFilePath); if (File.Exists(newFilePath)) File.Delete(newFilePath); else File.Move(oldFilePath, newFilePath); channelManager.ActiveChannel.RecordedFileName = newFileName; FileStream fs = new FileStream(newFilePath, FileMode.Open, FileAccess.Read); byte[] FileData = new byte[fs.Length]; fs.Read(FileData, 0, (int)fs.Length); fs.Close(); //fs.Flush(); MemoryStream mms = new MemoryStream(FileData); mms.Position = 0; clsMessageContract objContract = new clsMessageContract(); objContract.uname = VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName; objContract.fName = System.IO.Path.GetFileName(newFilePath); objContract.fExtension = System.IO.Path.GetExtension(newFilePath); objContract.fLength = mms.Length; objContract.fStream = mms; channelNetTcpUploadRecorededFiles.svcSendRecordedFiles(objContract); File.Delete(newFilePath); } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex,"fncRecordedFileUpload","AutoDialer-MyDialer.xaml.cs"); } }
void MyDialer_EntsvcRecordedFileUnJoin(clsMessageContract mcRFUnJoin) { }
void MyDialer_EntsvcSendRecordedFiles(clsMessageContract mcSendRecordedFiles) { try { //if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrentMachineIP == VMuktiAPI.VMuktiInfo.BootStrapIPs[0]) //{ // if (VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName != mcSendRecordedFiles.uname) // { // System.Xml.XmlDocument ConfDoc = new System.Xml.XmlDocument(); // ConfDoc.Load(AppDomain.CurrentDomain.BaseDirectory.ToString() + "Configuration.xml"); // System.Xml.XmlNodeList xmlNodes = null; // xmlNodes = ConfDoc.GetElementsByTagName("PhysicalPathOfVirtualDirectory"); // string VirtualDirectoryPath = xmlNodes[0].Attributes["Value"].Value.ToString(); // if (!Directory.Exists(VirtualDirectoryPath + "\\AudioRecordedFiles")) // { // Directory.CreateDirectory(VirtualDirectoryPath + "\\AudioRecordedFiles"); // } // byte[] byteArray = fncStreamToByteArry(mcSendRecordedFiles.fStream); // FileStream fs = new FileStream(VirtualDirectoryPath, FileMode.OpenOrCreate, FileAccess.Write); // fs.Seek(0, SeekOrigin.Begin); // fs.Write(byteArray, 0, byteArray.Length); // fs.Close(); // //MessageBox.Show("File has been uploaded successfully on server"); // } //} } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "ctlSearch_EntsvcJoin()", "ctlSearch.xaml.cs"); } }
//Hosting RecordedFiles Service public void HostRecordedFiles(object lstparam) { try { List<object> lstTempObj = (List<object>)lstparam; strUri = lstTempObj[0].ToString(); NetPeerClient npcRecordedFiles = new NetPeerClient(); ((NetP2PBootStrapRecordedFileDelegate)objRecordedFiles).EntsvcRecordedFileUnJoin +=new NetP2PBootStrapRecordedFileDelegate.delsvcRecordedFileUnJoin(MyDialer_EntsvcRecordedFileUnJoin); ((NetP2PBootStrapRecordedFileDelegate)objRecordedFiles).EntsvcSendRecordedFiles+=new NetP2PBootStrapRecordedFileDelegate.delsvcSendRecordedFiles(MyDialer_EntsvcSendRecordedFiles); ((NetP2PBootStrapRecordedFileDelegate)objRecordedFiles).EntsvcRecordedFileJoin+=new NetP2PBootStrapRecordedFileDelegate.delsvcRecordedFileJoin(MyDialer_EntsvcRecordedFileJoin); channelNetTcpUploadRecorededFiles = (INetP2PBootStrapRecordedFileChannel)npcRecordedFiles.OpenClient<INetP2PBootStrapRecordedFileChannel>(strUri, lstTempObj[1].ToString(), ref objRecordedFiles); clsMessageContract objContract = new clsMessageContract(); objContract.uname = VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName; objContract.fName = ""; objContract.fExtension = ""; objContract.fLength = 0; objContract.fStream = new MemoryStream(); channelNetTcpUploadRecorededFiles.svcRecordedFileJoin(objContract); } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "HostRecordedFiles()", "MyDialer.xaml.cs"); } }