Aggregate an inbound SMS

    When receiving a message that has been fragmented due to its length, Voxbone sends you back a JSON object that contains information about each fragment so you can reassemble them into one message.

    The following is the parameters you receive for each inbound message:

    Field Type Description
    from String Sender phone number (with +)
    uuid String Voxbone Message ID (Up to 36 characters).
    time Time (UTC) Time (UTC) when Voxbone first received the message
    msg String Inbound message body, UTF8 encoded.
    frag->frag_ref Integer ID of group of fragments
    frag->frag_total Integer Total number of fragments sms was split into.
    frag->frag_num Integer sequence number of which fragment in group this message is

    The frag_ref can be used as a unique identifier for each full message composed of x numbers of fragments, denoted by frag_num. You know your message is fully recomposed when you’ve received frag_num 1 all the way to frag_num = frag_total.

    Aggregation Logic

    You will need to store each fragment and develop a logic to keep the fragments as long as needed until you retrieve all fragments of the message. You will also need to implement a logic for error cases where some fragments are not retrieved or some characters are missing.