# OnMessageStateChanged Event Fires when the MessageDeliveryStatus Property changes. Syntax
    SiteKiosk.Plugins("SitePhone").OnMessageStateChanged = handler
Remarks The object that caused the event can be referenced in the event function using "this". Examples The following example keeps a HTML element containing the message state up to date.
    <div id="MessageDeliveryStatus"></div>
    <SCRIPT TYPE="text/javascript">
    window.external.InitScriptInterface();
    SitePhone = SiteKiosk.Plugins("SitePhone");

    SitePhone.OnMessageStateChanged = OnMessageStateChanged;

    var MDS_UNDEFINED = 0;
    var MDS_ANALYZING = 1;
    var MDS_ACCEPTABLE = 2;
    var MDS_NOT_ROUTABLE = 3;
    var MDS_DELIVERY_PENDING = 4;
    var MDS_DELIVERY_SUCCESSFUL = 5;
    var MDS_DELIVERY_FAILED = 6;

    function OnMessageStateChanged()
    {
       switch (SitePhone.MessageDeliveryStatus)
       {
          case MDS_ANALYZING:
             MessageDeliveryStatus.innerHTML = "Analyzing...";
             break;
          case MDS_NOT_ROUTABLE:
             MessageDeliveryStatus.innerHTML =
                "Message delivery not possible.";
             break;
          case MDS_DELIVERY_PENDING:
             MessageDeliveryStatus.innerHTML =
                "Message delivery pending...";
             break;
          case MDS_DELIVERY_SUCCESSFUL:
             MessageDeliveryStatus.innerHTML =
                "Message delivery successful.";
             break;
          case MDS_DELIVERY_FAILED:
             MessageDeliveryStatus.innerHTML = "Message delivery failed.";
             break;
          //...
       }
    }
    </SCRIPT>
Applies to SiteKiosk v7.0 (and later versions). Back to top