API Version: 6.5

Call barring

Permissions

Unless otherwise specified, this requires System-Admin or Company-Admin access.
It is important to note that call barring rules applied to the default company are effectively treated as system wide, all-company rules.

Inbound or outbound

All operations will default to create/read/update/delete of an outbound call barring rule unless an inbound scope or value which evaluates to a true value is specified in the operation.

command 'create'

Path: /rest/dialplan/create/ 6.3.23
Create an outbound call barring rule:
{
    "type": "barred"
    "values": {
        "prefix": "a prefix or exact match pattern",
        "company": "required - company to apply rule to",
        "passcode": "optional 0 to 8 digit numeric pin"
    }
}
Create an inbound call barring rule:
{
    "type": "barred"
    "values": {
        "inbound": true,
        "prefix": "a prefix or exact match pattern",
        "company": "required - company to apply rule to",
        "ddi": "optional inbound DDI for rule to apply to",
        "redir": "optional 0 to 8 digit redirect target (extension)",
        "qprio": "optional queue priority bump"
    }
}
Return value:
{
    "result": "success",
    "numrows": rows-created
}

command 'read'

Path: /rest/dialplan/read/ 6.3.22
Read a list of call barring rules
{
    "type": "barred"
    "scope": {
        "inbound": "optional - if true, query inbound rules, else outbound",
        "prefix": "optional - a prefix or exact match pattern, or a list of several",
        "company": "optional - filter results to specific companies",
        "ddi": "optional - matches ddi",
        "passcode": "optional - matches either redir (inbound) or passcode (outbound)",
        "qprio": "optional - queue priority bump (inbound only)"
    }
}
Return value:
{
    "result": "success",
    "values": {
        "company": [
            {
                "prefix": "prefix"
            },
            {
                "prefix": "prefix",
                "ddi": "ddi",
                "redir": "redirext target",
                "qprio": q-prio-bump
            },
            ... more rules
        ],
        ... other companies

    }
    numrows: number-of-rows
}

command 'update'

Path: /rest/dialplan/update/ 6.3.23
Update one or more existing call barring rules with a new DDI, pincode or redirection. If the specified scope covers many rules, all of them will be updated.
{
    "type": "barred"
    "scope": {
        "company": "required - a single company",
        "inbound": "optional - if true, query inbound rules, else outbound",
        "prefix": "optional - a prefix or exact match pattern, or a list of several",
        "ddi": "optional - matches ddi (inbound only)",
        "redir": "optional - matches redir (inbound only)",
        "qprio": "optional - matches qprio (inbound only)",
        "passcode": "optional - matches passcode (outbound only)"
    },
    "values": {
        "ddi": "optional - ddi (inbound only)",
        "redir": "optional - redir (inbound only)",
        "qprio": "optional - qprio (inbound only)",
        "passcode": "optional - passcode (outbound only)"
    }
}
Return value:
{
    "result": "success",
    "numrows": rows-updated
}

command 'delete'

Path: /rest/dialplan/update/ 6.3.23
Delete one or more call barring rules. If the specified scope covers many rules, all of them will be updated.
{
    "type": "barred"
    "scope": {
        "company": "required - a single company",
        "inbound": "optional - if true, query inbound rules, else outbound",
        "prefix": "optional - a prefix or exact match pattern, or a list of several",
        "ddi": "optional - matches ddi (inbound only)",
        "redir": "optional - matches redir (inbound only)",
        "qprio": "optional - matches qprio (inbound only)",
        "passcode": "optional - matches passcode (outbound only)"
    }
}
Return value:
{
    "result": "success",
    "numrows": rows-deleted
}