JSON API » phones » phones/update
Updates an existing telephone line.
Input parameters
Requires authentication and the administrator, residential, user, or wholesale role privileges.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
name | String | Telephone line to update. | Yes | |
acr | Integer | 1 to reject calls with unknown or withheld callerid, 0 not to. | No | Current value. |
aoc | Integer | 1 to send advice of charge, 0 not to. | No | 0 |
btype | String | Destination type on busy. | No | Current value. |
bnumber | String | Destination number on busy. | No | Current value. |
call_maximum | Decimal | Maximum spending per day. -1 for no limit. | No | Current value. |
callerid_external | String | Callerid on external calls. A number, "default", "name", "original", or "original_own_number". | No | Current value. |
callerid_internal | String | Callerid on internal calls. A number, "default", "name", "original", or "original_own_number". | No | Current value. |
callerid_location | String | Location callerid. A number or "original_own_number". | No | Current value. |
callername_external | String | Caller name on external calls. | No | Current value. |
callername_internal | String | Caller name on internal calls. | No | Current value. |
codec | String | Preferred codec. Empty string for any. | No | Current value. |
cos | Integer | ID of class of service. 0 for default. 1 for system COS that allows all calls. | No | Current value. |
description | String | Description. | No | Current value. |
delivery | String | "register" to send registration as request URI, "last_number" to send last called number. | No | Current value. |
dialplan | String | Dial plan. Empty string for default. | No | Current value. |
direct | Integer | 1 to allow callers to enter this number in IVR menus and the auto-attendant, 0 not to. | No | Current value. |
dnd | Integer | 1 to reject all calls, 0 not to. | No | Current value. |
dtype | String | Destination type on no answer. | No | Current value. |
dnumber | String | Destination number on no answer. | No | Current value. |
emergency_address1 | String | Line 1 of the emergency address. | No | Current value. |
emergency_address2 | String | Line 2 of the emergency address. | No | Current value. |
emergency_address3 | String | Line 3 of the emergency address. | No | Current value. |
emergency_address_city | String | City of emergency address. | No | Current value. |
emergency_address_state | String | State of emergency address. | No | Current value. |
emergency_address_code | String | Post or zip code of emergency address. | No | Current value. |
emergency_address_other | String | Other emergency address information. | No | Current value. |
emergency_country | String | Country of emergency address. | No | Current value. |
emergency_location_code | String | Emergency location code. Normally empty string. | No | Current value. |
expect_registered | Integer | 0 if not expected to be registered and no unregistered alerts should be sent, 1 if expected to be registered, 2 if expected to be registered and alerts of phone address changes should be sent. | No | Current value. |
forwarding | String | Forward all calls to this number. Empty string for none. | No | Current value. |
use_forwarding | Integer | 1 to enable use of forwarding number, 0 not to. | No | Current value. |
hardware_address | String | Hardware address, such as MAC address. | No | Current value. |
language | String | Language code. Empty string for default. | No | Current value. |
ltype | String | "phone" if logged in as a virtual phone, empty string if not. | No | Current value. |
lnumber | String | Telephone line logged in on top of as virtual phone. Empty string for none. | No | Current value. |
mailbox | String | Mailbox for message waiting indicator and direct mailbox access. | No | Current value. |
media | String | "voice" or "fax". | No | Current value. |
missedemail | Integer | 1 to send owner notification of missed calls if owner set, 0 not to. | No | Current value. |
music | Integer | ID of music on hold. 0 for none. | No | Current value. |
music_ringing | Integer | 1 to play music to caller when ringing, 0 to play ringing. | No | Current value. |
owner | Integer | ID of owner. 0 for none. | No | Current value. |
panel | Integer | 1 to display in control panel, 0 not to. | No | Current value. |
password | String | SIP password. | No | Current value. |
pin | String | PIN. Empty string for none. | No | Current value. |
ping | Integer | 1 to SIP ping handset, 0 not to. | No | Current value. |
plan | Integer | ID of rate plan. 0 for default. | No | Current value. |
presentation_external | Integer | Presentation on external calls. | No | Current value. |
provision1 | String | Special provisioning data. | No | Current value. |
provisioning | Integer | ID of provisioning template. 0 for automatic or if provisioning is not enabled. | No | Current value. |
recordgroup | Integer | ID of record group. 0 for none. | No | Current value. |
registrar | String | Hostname to register to for provisioning. Empty string to use rate plan SIP domain. | No | Current value. |
ringtime | Integer | Ring time in seconds. | No | Current value. |
screen | Integer | 1 to screen calls and play callerid, 2 to ask callers to record name, 0 not to screen. | No | Current value. |
source | String | Only allow from this IP address. Empty string for any. | No | Current value. |
totalmaximum | Integer | Maximum number of calls to allow to/from telephone. -1 for no limit. | No | Current value. |
utype | String | Destination type on unregistered. | No | Current value. |
unumber | String | Destination number on unregistered. | No | Current value. |
unumber_group | Integer | 1 to follow the utype and unumber on group calls, 0 not to. | No | Current value. |
validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 |
Responses
Code | Description |
---|---|
201 | Input passed validation. Only returned if validation=1. |
204 | Success. |
400 | Invalid input parameters specified. Check the key and message fields for more details. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
403 | Your rate plan does not allow this. |
404 | The telephone line does not exist, or you do not have permission to update it. |
Data returned
No data is returned.
Example: Changing the description
http://enswitch.example.com/api/json/phones/update/?auth_username=user;auth_password=password;name=1234567;description=example{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }
Change history
Version | Changes |
---|---|
4.0 | use_forwarding parameter added. |
3.14 | aoc input parameter added. cos input parameter changed to allow 0 for default and 1 to allow all calls. expect_registered input parameter changed to allow 2 for expected registered and alert for address changes. |
3.13 | Function added. |