API Version: 6.5

User

Permissions

Requires System-Admin or Company-Admin permissions.

command 'create'

Requires System-Admin permission.
Extensions are always created as "Ring-All" type and can be edited if required.
Path: /rest/dialplan/create/ 6.3.10+
{
    "type": "extension",
    "values": {
        "virt_exten": "extension number" or ["ext", "ext"...],
        "company": "company",
        "private": bool,            // true to create as private ext.
        "voicemail": bool,            // Enable voicemail on creation
        "nightmode": null or 0 to 9        // 0..9 = nightmode 1..10
    }
}
The return value is of the form:
{
    "result": "success",
    "numrows": number-of-rows
}
For example:
{
    "type": "extension",
    "values":{
        "virt_exten": "342",
        "company": "test",
        "voicemail": true,
        "nightmode": 0
    }
}
{
    "result": "success",
    "numrows": 1
}

command 'read'

Path: /rest/dialplan/read/
Note 1) If a column name of owner is specified in the columns specifier, it will be filled with the contact ID of the owner of the extension, or null if there is none.
Note 2) The scoped_exten scope value is artificial, and is constructed on-the-fly. The code will attempt to optimise the query but this is a heavier operation than querying virt_exten.
Available columns are:
virt_exten	: The base extension name or number
company		: The company id this extensions exists in
scoped_exten	: Either 'extension' or 'extension_company' (The latter for private extensions)
owner		: The contact ID of the extension's owner
name		: The extensions' name
ring_type	: The type of extension eg 'A'll, 'H'unt, 'Q'ueue, 'C'onference, soft'F'ax
callerid	: CallerID override. A prefix of '-' means withheld
ring_time	: Ring duration, or null for global default
{
    "type": "extension",
    "scope": {
        "virt_exten": ["extension numbers", ...],        // eg "400"
        "scoped_exten": ["scoped extension numbers", ...],    // eg "400_company"
        "company": "company"
    },
    "columns": [
        "column name",
        ...
    ]
}
The return value is of the form:
{
    "result": "success",
    "values": [
        {
            "column": "column-value",
            ...
        },
        ...
    ],
    "numrows": number-of-rows
}
For example:
{
    "type": "extension",
    "scope": {
        "scoped_exten": "400_test"
    },
    "columns": [
        "virt_exten",
        "company",
        "scoped_exten",
        "owner"
    ]
}
{
    "result": "success",
    "values": [
        {
            "virt_exten": "400",
            "company": "test",
            "scoped_exten": "400_test",
            "owner": 781
        }
    ],
    "numrows": 1
}

command 'readfull'

Path: /rest/dialplan/readfull/ 6.3.10+
Unlike the read command above, you cannot query the owner using this call. On the other hand, the full complement of columns as documented under update below can be accessed instead.
Note: The scoped_exten scope value is artificial, and is constructed on-the-fly. The code will attempt to optimise the query but this is a heavier operation than querying virt_exten.
{
    "type": "extension",
    "scope": {
        "virt_exten": ["extension numbers", ...],        // eg "400"
        "scoped_exten": ["scoped extension numbers", ...],    // eg "400_company"
        "company": "company"
    },
    "columns": [
        "column name",
        ...
    ]
}
The return value is of the form:
{
    "result": "success",
    "values": [
        {
            "column": "column-value",
            ...
        },
        ...
    ],
    "numrows": number-of-rows
}

command 'update'

Path: /rest/dialplan/update/ 6.3.10+
Requires System-Admin or Company-Admin permissions. The scope specification must resolve to exactly one extension to be updated.
{
    "type": "extension",
    "scope": {
        "virt_exten": "extension numbers",        // eg "400"
        "scoped_exten": "scoped extension number",    // eg "400_company"
        "company": "company"
    },
    "values": {
        "column": "value",                // See below.
        ...
    }
}
The return value is of the form:
{
    "result": "success",
    "numrows": 1
}
The currently modifyable columns and their meanings are as follows. Note that this call cannot be used to modify the extension's number, company or private/public status:
name:                   The extension name as a string, alphanumeric, dot, space, dash and underscore.
voicemail_box:          The voicemail box for this extension, or '' for none.
voicemail_mon:          Voicemail monitor: 1 On, 2 Owner Phone, 3 Off, 4 Owner Calls
priority:               Line allocation priority: 0: highest to 10: lowest or null for no line
ring_type:              A:                All at once
                        H:                Hunt Dialling
                        Q:                Call Queuing
                        I:                IVR Menu
                        F:                Soft Fax
                        T:                Tannoy/Pager
                        C:                Conference Access
                        O:                Parking Orbit
                        V:                Voicemail Pickup
                        P:                External VM Pickup
                        X:                External Access
ring_time:              0 to 999 seconds, or null for system global.
			For 'Q' type it is a Queue timeout.
			For 'O' type this is number of orbits in range 0 to 49.
passcode:               numeric or null.
phonebook:              Phonebook visibility setting.
                        0:                Ex-directory
                        1:                Visible in same company
                        2:                Visible to all logged-in PABX users
                        3:                Fully listed
                        Single company units will ignore 1 and treat as 0
                        Hosted mode systems will ignore all values except 0 and 3, and 3 is treated like 1.
callerid:               CallerID for outbound calls. Prefix with '-' to request number witheld by default.
ivr_menu:               IVR menu name for 'I' type extensions.
vm_jump_star:           Jump extension from voicemail with '*'
vm_jump_zero:           Jump extension from voicemail with '0'
no_vm_jump:             Day-mode no-answer jump target.
no_vm_jump_night:       Night-mode no-answer jump target.
intro_day:              00 to 99, intro message in day mode.
intro_night:            00 to 99, intro message in night mode.
busy_retry:             Busy retry attempts for 'A' type extensions.
rec_override:           Bitfield value for call recording (0 to 63), null for company default:
                        1:                Internal Made
                        2:                External Made
                        4:                Internal Received
                        8:                External Received
                        16:               Force NEVER
                        32:               OTR allowed
moh_in:                 0 (default) or 1 to 5
moh_out:                0 (default) or 1 to 5
subtype:                Queue configuration string for 'Q' type extensions
			Conference configuration for 'C' type extensions
                        or '' for non-Queue.  (see below)
cname_prefix_ext:       CallerID name prefix for external calls.
cname_prefix_int:       CallerID name prefix for internal calls.
                        null: Global default
                        0:                Off/disable
                        1-6:              number of digits off end of (external) number
                        exten:            Use extension number
                        exnam:            Use extension name
fid:                    Handset forwards treated as DnD for this extension. null (system default), 0 off or 1 on.
nightmode:              -1 for no nightmode, 0-9 for Nightmodes 1 thru 10.
bounce_mode:            Only valid for 'A', 'H' and 'Q' type extensions
                        disabled:         no call bounce back
                        1:                return to line 1
                        orig:             return to original call line
                        last:             return to last line of handset
                        fall:             just use fall-through
bounce_before:          Boolean true/false. True to bounce before checking for jump/voicemail
bounce_duration:        Time before fall-through, 0 for never
bounce_type:            once:             Call once then fall-thru
                        many:             Call repeats until timeout"
bounce_fall:            Fallback target extension or ''.
vm_callback:            Enable returning calls from within this extensions own voicemail box.
                        0:                Use global setting
                        1:                Enabled
                        -1:               Disabled
email:                  Fallback voicemail email address.
email_vm_att:           Fallback voicemail attach setting (Bool)
email_vm_del:           Fallback voicemail delete on send setting (Bool)
subtype conference configuration parameters have one optional value:
Byte 1:                 Q                 Quiet no-announce conference
subtype queue configuration parameters make up a single 18 character string as follows:
Byte 1:                 Queue type
                        (Lower-case letters play only hold music)
                        a                 Ring All - One call at a time
                        d                 Ring All - No queue if first
                        e                 Ring All - Avoid queueing
                        r                 Cyclic - One call at a time
                        f                 Cyclic - Max num. calls
                        l                 Ordered - Try agents in order (not on hosted, requires restart)
                        (Capital letters enable Queue position announcements)
                        A                 Ring All - One call at a time
                        D                 Ring All - No queue if first
                        E                 Ring All - Avoid queueing
                        R                 Cyclic - One call at a time
                        F                 Cyclic - Max num. calls
                        L                 Ordered - Try agents in order (not on hosted, requires restart)
Byte 2:                 'y' or ' '        y: Autopause agents if not answering.
Byte 3:                 'Y', 'y' or ' '   y: Exit queue if no agents. Y: Exit queue if no agents or all-paused
Byte 4:                 'y' or ' '        y: Play ringing instead of MOH
Byte 5:                 'y' or ' '        y: Announce hold time to agent
Byte 6:                 Dynamic priorities
                        ' '               off
                        1                 Min priority increases 1 per 10sec
                        3                 Min priority increases 1 per 30sec
                        y                 Min priority increases 1 per minute
                        l                 Min priority increases quick to slow
Byte 7,8:               '  ' or 01 to 99  Queue default caller priority
Byte 9,10:              '  ' - reserved
Byte 11,12:             '  ' or 00 to 99 - Prompt message to play periodically
Byte 13,14:             '  ' or 00 to 99 - Prompt message to play periodically
Byte 15,16:             '  ' or 00 to 99 - Prompt message to play periodically
Byte 17,18:             '  ' or 00 to 99 - Prompt message to play periodically
Byte 19:		'y' or ' '        y: Enable abandoned call emails.

command 'delete'

Path: /rest/dialplan/delete/ 6.3.10+
Requires System-Admin permission. The scope specification must resolve to exactly one extension to be deleted.
Deleting an extension will purge it's voicemail from the PABX and remove all other references to that extension from user ownerships, IVR menus etc.
{
    "type": "extension",
    "scope": {
        "virt_exten": "extension numbers",        // eg "400"
        "scoped_exten": "scoped extension number",    // eg "400_company"
        "company": "company"
    }
}
The return value is of the form:
{
    "result": "success",
    "numrows": 1,
    "mailbox": "Indication of success/failure of mailbox purge"
}