JSON API » phones » phones/update

Updates an existing telephone line.

Input parameters

Requires authentication and the administrator, residential, user, or wholesale role privileges.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
nameStringTelephone line to update.Yes
acrInteger1 to reject calls with unknown or withheld callerid, 0 not to.NoCurrent value.
allowed_uaStringSIP User Agents that are allowed to register on this telephone line.No
aocInteger1 to send advice of charge, 0 not to.No0
btypeStringDestination type on busy.NoCurrent value.
bnumberStringDestination number on busy.NoCurrent value.
call_maximumDecimalMaximum spending per day. -1 for no limit.NoCurrent value.
callerid_externalStringCallerid on external calls. A number, "default", "name", "original", or "original_own_number".NoCurrent value.
callerid_internalStringCallerid on internal calls. A number, "default", "name", "original", or "original_own_number".NoCurrent value.
callerid_locationStringLocation callerid. A number or "original_own_number".NoCurrent value.
callername_externalStringCaller name on external calls.NoCurrent value.
callername_internalStringCaller name on internal calls.NoCurrent value.
codecStringPreferred codec. Empty string for any.NoCurrent value.
cosIntegerID of class of service. 0 for default. 1 for system COS that allows all calls.NoCurrent value.
descriptionStringDescription.NoCurrent value.
deliveryString"register" to send registration as request URI, "last_number" to send last called number.NoCurrent value.
dialplanStringDial plan. Empty string for default.NoCurrent value.
directInteger1 to allow callers to enter this number in IVR menus and the auto-attendant, 0 not to.NoCurrent value.
dndInteger1 to reject all calls, 0 not to.NoCurrent value.
dtypeStringDestination type on no answer.NoCurrent value.
dnumberStringDestination number on no answer.NoCurrent value.
emergency_address1StringLine 1 of the emergency address.NoCurrent value.
emergency_address2StringLine 2 of the emergency address.NoCurrent value.
emergency_address3StringLine 3 of the emergency address.NoCurrent value.
emergency_address_cityStringCity of emergency address.NoCurrent value.
emergency_address_stateStringState of emergency address.NoCurrent value.
emergency_address_codeStringPost or zip code of emergency address.NoCurrent value.
emergency_address_otherStringOther emergency address information.NoCurrent value.
emergency_countryStringCountry of emergency address.NoCurrent value.
emergency_location_codeStringEmergency location code. Normally empty string.NoCurrent value.
expect_registeredInteger0 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.NoCurrent value.
forwardingStringForward all calls to this number. Empty string for none.NoCurrent value.
use_forwardingInteger1 to enable use of forwarding number, 0 not to.NoCurrent value.
languageStringLanguage code. Empty string for default.NoCurrent value.
ltypeString"phone" if logged in as a virtual phone, empty string if not.NoCurrent value.
lnumberStringTelephone line logged in on top of as virtual phone. Empty string for none.NoCurrent value.
mailboxStringMailbox for message waiting indicator and direct mailbox access.NoCurrent value.
mediaString"voice" or "fax".NoCurrent value.
missedemailInteger1 to send owner notification of missed calls if owner set, 0 not to.NoCurrent value.
musicIntegerID of music on hold. 0 for none.NoCurrent value.
music_ringingInteger1 to play music to caller when ringing, 0 to play ringing.NoCurrent value.
ownerIntegerID of owner. 0 for none.NoCurrent value.
panelInteger1 to display in control panel, 0 not to.NoCurrent value.
passwordStringSIP password.NoCurrent value.
pinStringPIN. Empty string for none.NoCurrent value.
pingInteger1 to SIP ping handset, 0 not to.NoCurrent value.
planIntegerID of rate plan. 0 for default.NoCurrent value.
presentation_externalIntegerPresentation on external calls.NoCurrent value.
presentation_internalIntegerPresentation on internal calls.NoCurrent value.
recordgroupIntegerID of record group. 0 for none.NoCurrent value.
registrarStringHostname to register to for provisioning. Empty string to use rate plan SIP domain.NoCurrent value.
ringtimeIntegerRing time in seconds.NoCurrent value.
screenInteger1 to screen calls and play callerid, 2 to ask callers to record name, 0 not to screen.NoCurrent value.
sourceStringOnly allow from this IP address. Empty string for any.NoCurrent value.
totalmaximumIntegerMaximum number of calls to allow to/from telephone. -1 for no limit.NoCurrent value.
utypeStringDestination type on unregistered.NoCurrent value.
unumberStringDestination number on unregistered.NoCurrent value.
unumber_groupInteger1 to follow the utype and unumber on group calls, 0 not to.NoCurrent value.
validationInteger1 to validate input then return, 0 for full action.No0

Responses

CodeDescription
201Input passed validation. Only returned if validation=1.
204Success.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
403Your rate plan does not allow this.
404The 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

VersionChanges
4.4presentation_internal, allowed_ua parameter added.
4.3hardware_address, provision1, and provisioning parameters removed.
4.0use_forwarding parameter added.
3.14aoc 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.13Function added.