node-pdu
    Preparing search index...

    Class VP

    Represents the Validity Period (VP) of an SMS message.

    Defines how long an SMS is stored at the SMSC before delivery attempts cease. This duration ensures messages remain relevant and can vary from minutes to days based on the sender's preference.

    Index

    Constructors

    • Constructs a Validity Period (VP) instance.

      Parameters

      • options: VPOptions = {}

        An object containing optional parameters for the VP instance

      Returns VP

    Properties

    PID_ASSIGNED: 0 = 0x00

    Accessors

    • get dateTime(): null | Date

      Retrieves the datetime set for the Validity Period.

      This property represents the exact date and time the SMS should be considered valid. If null, it implies that a specific datetime has not been set for this validity period.

      Returns null | Date

      The datetime as a Date object or null if not set

    • get interval(): null | number

      Retrieves the interval set for the Validity Period.

      This property represents the duration in seconds for which the SMS should be considered valid. If null, it implies that a specific interval has not been set for this validity period.

      Returns null | number

      The interval in seconds or null if not set

    Methods

    • Sets the datetime for the SMS Validity Period.

      This method allows setting a specific date and time until which the SMS is considered valid. Can be set using a Date object or a string that can be parsed into a Date.

      Parameters

      • datetime: string | Date

        The datetime to set as a Date object or a string representation

      Returns VP

      The instance of this VP, allowing for method chaining

    • Sets the interval for the SMS Validity Period.

      This method allows setting a specific duration in seconds until which the SMS is considered valid. It's an alternative to setting a specific datetime.

      Parameters

      • interval: number

        The interval in seconds to set for the validity period

      Returns VP

      The instance of this VP, allowing for method chaining

    • Converts the Validity Period to a PDU string representation.

      This method generates a string suitable for inclusion in a PDU, based on the validity period's format. It can handle both absolute and relative formats and adjusts the PDU's validity period format accordingly. This is critical for ensuring that the SMS's validity period is correctly interpreted by the SMSC.

      Parameters

      • pdu: PDU

        The PDU instance to which this validity period belongs

      Returns string

      A string representation of the validity period for inclusion in the PDU