/// <summary> /// Event handler for the RTP packets. /// </summary> /// <param name="sender">the packet sniffer in this case</param> /// <param name="eventArgs">contains the port number and RTP data stream.</param> private void OnRTPArrived(object sender, RTPPacketEventArgs eventArgs) { ToneDetected toneDetected; // if we care about the port...process. if (RTPPort == eventArgs.Port) { try { if (!someToneDetected) { toneDetected = audioStreamState.AddPacket(eventArgs.Packet); if (toneDetected != ToneDetected.NONE) { someToneDetected = true; ClsException.WriteToLogFile( string.Format("{0} Tone Detected: {1}", phoneNumber, toneDetected.ToString())); RaiseNonHumanDetected(toneDetected); } } } catch (Exception ex) { ex.Data.Add("My Key", "VMukti--:--VmuktiModules--:--VmuktiModules--:--Call Center--:--AutoProgressiveSoftPhone--:--AutoProgressivePhone.Business--:--RTCAudioWithToneDetect.cs--:--OnRTPArrived()--"); ClsException.WriteToErrorLogFile(ex); } } }
public static bool OpenDataBaseClient() { try { if (chHttpDataBaseService == null) { //change supernode ip to bootstrap ip chHttpDataBaseService = (IHttpBootStrapDataBaseService)objHttpDataBase.OpenClient <IHttpBootStrapDataBaseService>("http://" + VMuktiInfo.BootStrapIPs[0] + ":80/HttpDataBase"); chHttpDataBaseService.svcJoin(); ClsException.WriteToLogFile("Database channel open sucessfully."); } return(true); } catch (System.ServiceModel.EndpointNotFoundException exp) { VMuktiHelper.ExceptionHandler(exp, "OpenDataBaseClient()", "clsDataBaseChannel.cs"); VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null); chHttpDataBaseService = (IHttpBootStrapDataBaseService)objHttpDataBase.OpenClient <IHttpBootStrapDataBaseService>("http://" + VMuktiInfo.BootStrapIPs[0] + ":80/HttpDataBase"); chHttpDataBaseService.svcJoin(); return(true); } catch (System.ServiceModel.CommunicationException exp) { VMuktiHelper.ExceptionHandler(exp, "OpenDataBaseClient()", "clsDataBaseChannel.cs"); VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null); chHttpDataBaseService = (IHttpBootStrapDataBaseService)objHttpDataBase.OpenClient <IHttpBootStrapDataBaseService>("http://" + VMuktiInfo.BootStrapIPs[0] + ":80/HttpDataBase"); chHttpDataBaseService.svcJoin(); return(true); } catch (Exception exp) { VMuktiHelper.ExceptionHandler(exp, "OpenDataBaseClient()", "clsDataBaseChannel.cs"); return(false); } }
private void Dispose(bool disposing) { try { ClsException.WriteToLogFile("Dispose Calling in P2P Presentation"); objNetTcpPresentation = null; channelNettcpPresentation = null; } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "Dispose(bool disposing)", "P2PPresentationClient.cs"); } }
private void Dispose(bool disposing) { try { ClsException.WriteToLogFile("Dispose calling in P2P WhiteBoard"); objNetTcpWhiteBoardp = null; channelNettcpWhiteBoard = null; } catch (Exception exp) { VMuktiAPI.VMuktiHelper.ExceptionHandler(exp, "Dispose()", "P2PWhiteBoardClient.cs"); } }
// private bool disposed; public void Dispose() { try { ClsException.WriteToLogFile("CALLING DISPOSE(TRUE)"); Dispose(true); GC.SuppressFinalize(this); } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "Dispose", "ChatDummy.cs"); } }
private void Dispose(bool disposing) { try { ClsException.WriteToLogFile("Dispose calling in P2P FileSearch"); objNetTcpFileSearch = null; channelNettcpFileTransfer = null; } catch (Exception exp) { VMuktiAPI.VMuktiHelper.ExceptionHandler(exp, "Dispose", "P2PFileSearchClient.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 P2PPresentationDummy_EntsvcSignOutPPT(clsMessageContract mcSignOutPPT) { try { for (int i = 0; i < lstNodes.Count; i++) { mcSignOutPPT.strMsg = "SignOut"; List <clsMessageContract> lstMessage = (List <clsMessageContract>)hashMessages[lstNodes[i]]; lstMessage.Add(mcSignOutPPT); hashMessages[lstNodes[i]] = lstMessage; } } catch (Exception ex) { ClsException.WriteToLogFile("P2PPresentationDummy_EntsvcSignOutPPT() :- PresentationDummy.cs :_ +" + ex.Message); } }
private void OnIRTCRegistrationStateChangeEvent(IRTCRegistrationStateChangeEvent Registrationevent) { try { RTC_REGISTRATION_STATE regstate; regstate = Registrationevent.State; switch (regstate) { case RTC_REGISTRATION_STATE.RTCRS_REGISTERING: { break; } case RTC_REGISTRATION_STATE.RTCRS_REGISTERED: { entstatus(this, "Registered"); break; } case RTC_REGISTRATION_STATE.RTCRS_REJECTED: { entstatus(this, "Rejected"); break; } case RTC_REGISTRATION_STATE.RTCRS_ERROR: { entstatus(this, "RegistrationError"); int statusCode = Registrationevent.StatusCode; ClsException.WriteToLogFile("SIP User Registration Error, Code:" + statusCode); break; } } } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "OnIRTCRegistrationStateChangeEvent()", "Audio\\Audio.Business\\RTCAudio.cs"); } }
//public static StringBuilder CreateTressInfo() //{ // StringBuilder sb = new StringBuilder(); // sb.Append("User Is : " + VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName); // sb.AppendLine(); // sb.Append("Peer Type is : " + VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType.ToString()); // sb.AppendLine(); // sb.Append("User's SuperNode is : " + VMuktiAPI.VMuktiInfo.CurrentPeer.SuperNodeIP); // sb.AppendLine(); // sb.Append("User's Machine Ip Address : " + VMuktiAPI.GetIPAddress.ClsGetIP4Address.GetIP4Address()); // sb.AppendLine(); // sb.AppendLine("----------------------------------------------------------------------------------------"); // return sb; //} public ChatDummy(string MyName, string UName, int Id, string netP2pUri, string httpUri) { try { UserName = MyName; MyId = Id; RegHttpServer(httpUri); RegNetP2PClient(netP2pUri); if (netP2pUri != null || netP2pUri != "") { ClsException.WriteToLogFile("NetP2PUri : " + netP2pUri); } if (httpUri != null || httpUri != "") { ClsException.WriteToLogFile("HttpUri : " + httpUri); } } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "ChatDummy", "ChatDummy.cs"); } }
public void SendEmailTo(string To, string Subject, string msg) { try { ClsException.WriteToLogFile("Calender: User sending Email"); ClsException.WriteToLogFile("Email Sending," + To + "," + Subject + "," + msg); if (SMTPServer.Equals("") || SMTPPort != -1 || SMTPUserName.Equals("") || SMTPPassword.Equals("")) { DataSet dsSMTP = ClsCalender.getSMTPCredentials(); foreach (DataRow drSMTP in dsSMTP.Tables[0].Rows) { string fieldName = drSMTP["FieldName"].ToString(); switch (fieldName) { case "SMTPServer": { SMTPServer = drSMTP["FieldValue"].ToString(); break; } case "SMTPPort": { SMTPPort = int.Parse(drSMTP["FieldValue"].ToString()); break; } case "SMTPUserName": { SMTPUserName = drSMTP["FieldValue"].ToString(); break; } case "SMTPPassword": { SMTPPassword = drSMTP["FieldValue"].ToString(); break; } default: break; } } } if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp) { clsMailInfo objMail = new clsMailInfo(); objMail.strFrom = SMTPUserName; objMail.strTo = To; objMail.strSubject = Subject; objMail.strMsg = msg; objMail.strServer = SMTPServer; objMail.intPort = SMTPPort; objMail.strPwd = SMTPPassword; clsMailDBClient.chHttpMailDBService.svcSendMail(objMail); } else { System.Net.Mail.MailMessage mailMsg = new System.Net.Mail.MailMessage(); mailMsg.From = new System.Net.Mail.MailAddress(SMTPUserName); mailMsg.To.Add(To); mailMsg.Subject = Subject; mailMsg.SubjectEncoding = System.Text.Encoding.UTF8; mailMsg.Body = msg; mailMsg.BodyEncoding = System.Text.Encoding.UTF8; mailMsg.Priority = System.Net.Mail.MailPriority.High; mailMsg.IsBodyHtml = true; System.Net.Mail.SmtpClient SmtpMail = new System.Net.Mail.SmtpClient(SMTPServer, SMTPPort); SmtpMail.Credentials = new System.Net.NetworkCredential(SMTPUserName, SMTPPassword); SmtpMail.EnableSsl = true; SmtpMail.Send(mailMsg); } } catch (Exception exp) { VMuktiAPI.VMuktiHelper.ExceptionHandler(exp, "SendEmailTo()", "ctlAddEvent.xaml.cs"); } }