# MessageDeliveryFailureReason Property The MessageDeliveryFailureReason property indicates for which reason the text message sending failed. Syntax
    [long=] SiteKiosk.Plugins("SitePhone").MessageDeliveryFailureReason
Possible Values
    Long value that retrieves the last message delivery failure reason.
The property is read only. Remarks Possible status flags are: MDFR_UNKNOWN = -1; MDFR_MISC_ERROR = 0; MDFR_SERVER_CONNECT_FAILED = 1; MDFR_NO_SMS_CAPABILITY = 2; MDFR_INSUFFICIENT_FUNDS = 3; MDFR_INVALID_CONFIRMATION_CODE = 4; MDFR_USER_BLOCKED = 5; MDFR_IP_BLOCKED = 6; MDFR_NODE_BLOCKED = 7; Examples The following example sends a text message and alerts possible errors.
    <SCRIPT TYPE="text/javascript">
    window.external.InitScriptInterface();
    SitePhone = SiteKiosk.Plugins("SitePhone");

    var MDFR_MISC_ERROR = 0;
    var MDFR_SERVER_CONNECT_FAILED = 1;
    var MDFR_NO_SMS_CAPABILITY = 2;
    var MDFR_INSUFFICIENT_FUNDS = 3;
    var MDFR_INVALID_CONFIRMATION_CODE = 4;
    var MDFR_USER_BLOCKED = 5;
    var MDFR_IP_BLOCKED = 6;
    var MDFR_NODE_BLOCKED = 7;

    success = SitePhone.SendTextMessage("+1 918 555 5000", "Hello world!");
    if(!success)
    {
        switch(SitePhone.MessageDeliveryFailureReason)
        {
            case MDFR_MISC_ERROR:
                alert("Message delivery failed: Misc error");
                break;
            case MDFR_SERVER_CONNECT_FAILED:
                alert("Message delivery failed:
                    Server connection could not be established");
                break;
            case MDFR_NO_SMS_CAPABILITY:
                alert("Message delivery failed:
                    No short message capability");
                break;
            case MDFR_INSUFFICIENT_FUNDS:
                alert("Message delivery failed: Insufficient funds");
                break;
            case MDFR_INVALID_CONFIRMATION_CODE:
                alert("Message delivery failed:
                    Invalid confirmation code");
                break;
            case MDFR_USER_BLOCKED:
                alert("Message delivery failed: User blocked");
                break;
            case MDFR_IP_BLOCKED:
                alert("Message delivery failed: IP blocked");
                break;
            case MDFR_NODE_BLOCKED:
                alert("Message delivery failed: Node blocked");
                break;
            default:
                alert("Message delivery failed");
        }
    }
    </SCRIPT>
Applies to SiteKiosk v7.0 (and later versions). Back to top