mCore™ .NET SMS Library 1.2

mCore.SMS.IncomingCallIndication Property

Description:

The IncomingCallIndication property gets or sets a boolean value that defines whether incoming calls will raise a NewIncomingCall event.

Namespace: mCore
Assembly: mCoreLib (in mCoreLib.dll)

Remarks:

Exceptions:

mCore.GeneralException

Usage Example:

Visual Basic

Public Class MyClass
   Public WithEvents objSMS As New mCore.SMS
  
   Public Sub New()
      Try     
         SetCommParameters()
         objSMS.IncomingCallIndication = True
      Catch ex As mCore.GeneralException
         MsgBox(ex.Message)
      End Try
   End Sub

   'Incoming Call Event Handling
   'A message box will pop-up whenever
   'a new incoming call is received

   Private Sub objSMS_NewIncomingCall(ByVal sender As Object, _
               ByVal e As mCore.IncomingCallEventArgs) _
               Handles objSMS.NewIncomingCall

      MsgBox("Incoming call from: " & e.CallerID, _
         MsgBoxStyle.Information, "Incoming Call")

   End Sub

   Public Sub SetCommParameters()
      Try
         objSMS.Port = "COM1"
         objSMS.BaudRate = mCore.BaudRate.BaudRate_19200
         objSMS.DataBits = mCore.DataBits.Eight
         objSMS.StopBits = mCore.StopBits.One
         objSMS.Parity = mCore.Parity.None
         objSMS.FlowControl = mCore.FlowControl.RTS_CTS

      Catch ex As mCore.GeneralException
         MsgBox(ex.Message)
      Catch ex As Exception
      End Try
   End Function
End Class

 
C#

class MyClass
{
   public mCore.SMS objSMS = new mCore.SMS();

   public MyClass()

   {
      try
      {
         SetCommParameters();
         objSMS.IncomingCallIndication = true;
      }
      catch (mCore.GeneralException e)
      {
         MessageBox.Show(e.ToString());
      }

      objSMS.NewIncomingCall +=
         new mCore.SMS.IncomingCallHandler(objSMS_NewIncomingCall);
   }

   //Incoming Call Event Handling
   //A message box will pop-up whenever
   //a new incoming call is received

   private void objSMS_NewIncomingCall
      (object sender, mCore.IncomingCallEventArgs e)
   {
      MessageBox.Show("Incoming call from: " + e.CallerID);
   }

   public static void SetCommParameters()
   {
      try
      {
         objSMS.Port = "COM1";
         objSMS.BaudRate = mCore.BaudRate.BaudRate_19200;
         objSMS.DataBits = mCore.DataBits.Eight;
         objSMS.StopBits = mCore.StopBits.One;
         objSMS.Parity = mCore.Parity.None;
         objSMS.FlowControl = mCore.FlowControl.RTS_CTS;
      }

      catch (mCore.GeneralException e)
      {
         MessageBox.Show(e.ToString());
      }
      catch (Exception e)
      {
      }
   }
}

See Also:

mCore.SMS.NewIncomingCall Event
mCore.NewIncomingCallEventArgs Class

 

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved