Sun Java System Messaging Server 6 2005Q4 Administration Guide

Example SMS Mapping Table

An example SMS_TEXT mapping table is shown in Example D–1. The numbers inside parentheses at the end of each line correspond to the item numbers in the section titled Explanatory Text that follows this table.


Example D–1 Example SMS_TEXT Mapping Table.


SMS_TEXT

   H|From:*        H|F:$0$R$Y       (1)
   H|Subject:*     H|S:$0$R$Y       (1)
   H|F:*<*>*       H|F:$1$R$Y       ()
   H|F:*(*)*       H|F:$0$2$R$Y     (2)
   H|F:*"*"*       H|F:$0$2$R$Y     (3)
   H|F:*@*         H|F:$0$R$Y       (4)
   H|%:$ *         H|$0:$1$R$Y      (5)
   H|%:*$          H|$0:$1$R$Y      (5)
   H|%:*$ $ *      H|$0:$1$ $2$R$Y  (6)
   B|*--*          B|$0-$1$R        (7)
   B|*..*          B|$0.$1$R        (7)
   B|*!!*          B|$0!$1$R        (7)
   B|*??*          B|$0?$1$R        (7)
   B|*$ $ *        B|$0$ $1$R       (6)
   B|$ *           B|$0$R           (5)
   B|*$            B|$0$R           (5)

               

Explanatory Text

The entries in the example SMS_TEXT mapping table above are explained below:

In the example above, the metacharacter $R is used to implement and control iterative application of the mappings. By iterating on these mappings, powerful filtering is achieved. For instance, the simple mappings to remove a single leading or trailing space (6) or reduce two spaces to a single space (7) become, when taken as a whole, a filter which strips all leading and trailing spaces and reduces all consecutive multiple spaces to a single space. Such filtering helps reduce the size of each SMS message.

  1. These two entries cause From: and Subject: header lines to be included in an SMS message. From: and Subject: are abbreviated as, respectively, F: and S:. Some of the other entries may have further effects on From: and Subject: header lines.

    This entry will reduce a From: header line containing a <...> pattern to only the text within the angle brackets. For example:

    F: "John C. Doe" <jdoe@siroe.com> (Hello)

    will be replaced with:

    F: jdoe@siroe.com

  2. This entry will remove, inclusively, everything inside of a (...) pattern in a From: header line. For example:

    F: "John C. Doe" <jdoe@siroe.com> (Hello)

    will be replaced with:

    F: "John C. Doe" <jdoe@siroe.com>

  3. This entry will remove, inclusively, everything inside of a “...” pattern in a From: header line. For example:

    F: "John C. Doe" <jdoe@siroe.com> (Hello)

    will be replaced with:

    F: <jdoe@siroe.com> (Hello)

  4. This entry will remove, inclusively, everything to the right of an at-sign, @, in a From: header line. For example:

    F: "John C. Doe" <jdoe@siroe.com> (Hello)

    will be replaced with:

    F: "John C. Doe" <jdoe@

  5. These four entries remove leading and trailing spaces from lines in the message header and body.

  6. These two entries reduce two spaces to a single space in lines of the message header and body.

  7. These four entries reduce double dashes, periods, exclamation and question marks to single occurrences of the matching character. Again, this helps save bytes in an SMS message.

The order of the entries is very important. For instance, with the given ordering, the body of the message From: header line:

From: "John C. Doe" (Hello)

will be reduced to:

jdoe

The steps taken to arrive at this are as follows:

  1. We begin with the From: header line:

    From: "John C. Doe" (Hello)

    The pattern in the first mapping entry matches this and produces the result:

    F: "John C. Doe" (Hello)

    The $R metacharacter in the result string causes the result string to be remapped.

  2. The mapping is applied to the result string of the last step. This produces:

    F: jdoe@siroe.com

    The $R in the mapping causes the entire set of mappings to be re-applied to the result of this step.

  3. Next, the mapping is applied producing:

    F: jdoe

    The $R in the mapping causes the entire set of mappings to be re-applied to the result of this step.

  4. Next, the mapping is applied producing:

    F:jdoe

    The $R in the mapping causes the entire set of mappings to be re-applied to the result of this step.

  5. Since no other entries match, the final result string:

    F:jdoe

    is incorporated into the SMS message.


    Note –

    The imsimta test-mapping utility may be used to test a mapping table. For instance,


    # imsimta test -mapping -noimage_file -mapping_file=test.txt
    Enter table name: SMS_TEXT
    Input string: H|From: "John C. Doe"  (Hello)
    Output string: H|F:jdoe
    Output flags: [0,1,2,89]
    Input string: ^D
    #

    For further details on the imsimta test utility, see imsimta test in Sun Java System Messaging Server 6 2005Q4 Administration Reference.