JSON API » phones » phones/create

Creates a new telephone line.

Input parameters

Requires authentication and the administrator or wholesale role privileges.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
nameStringSIP username.Yes
passwordStringSIP password.Yes, unless copy_password is specified.
acrInteger1 to reject calls with unknown or withheld callerid, 0 not to.No0
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.No"hangup"
bnumberStringDestination number on busy.NoEmpty string.
call_maximumDecimalMaximum spending per day. -1 for no limit.No-1
callerid_externalStringCallerid on external calls. A number, "default", "name", "original", or "original_own_number".No"default"
callerid_internalStringCallerid on internal calls. A number, "default", "name", "original", or "original_own_number".No"default"
callerid_locationStringLocation callerid. A number, "original_own_number", or empty string for none.NoEmpty string.
callername_externalStringCaller name on external calls.NoEmpty string.
callername_internalStringCaller name on internal calls.NoEmpty string.
codecStringPreferred codec. Empty string for any.NoEmpty string.
copy_passwordStringAnother telephone line in the same customer to copy the password from. Empty string to use the password parameter instead.NoEmpty string.
cosIntegerID of class of service. 0 for default. 1 for system COS that allows all calls.No0
customerIntegerID of customer to create in.NoCustomer of authentication user.
descriptionStringDescription.NoEmpty string.
deliveryString"register" to send registration as request URI, "last_number" to send last called number.No"register"
dialplanStringDial plan. Empty string for default.NoEmpty string.
directInteger1 to allow callers to enter this number in IVR menus and the auto-attendant, 0 not to.No1
dndInteger1 to reject all calls, 0 not to.No0
dtypeStringDestination type on no answer.No"hangup"
dnumberStringDestination number on no answer.NoEmpty string.
emergency_address1StringLine 1 of the emergency address.NoEmpty string.
emergency_address2StringLine 2 of the emergency address.NoEmpty string.
emergency_address3StringLine 3 of the emergency address.NoEmpty string.
emergency_address_cityStringCity of emergency address.NoEmpty string.
emergency_address_stateStringState of emergency address.NoEmpty string.
emergency_address_codeStringPost or zip code of emergency address.NoEmpty string.
emergency_address_otherStringOther emergency address information.NoEmpty string.
emergency_countryStringCountry of emergency address.NoEmpty string.
emergency_location_codeStringEmergency location code. Normally empty string.NoEmpty string.
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.No1
forwardingStringForward all calls to this number. Empty string for none.NoEmpty string.
use_forwardingInteger1 to enable use of forwarding number, 0 not to.No1
hardware_addressStringHardware address, such as MAC address.NoEmpty string.
languageStringLanguage code. Empty string for default.NoEmpty string.
ltypeString"phone" if logged in as a virtual phone, empty string if not.NoEmpty string.
lnumberStringTelephone line logged in on top of as virtual phone. Empty string for none.NoEmpty string.
mailboxStringMailbox for message waiting indicator and direct mailbox access.i Empty string for none.NoEmpty string.
mediaString"voice" or "fax".No"voice"
missedemailInteger1 to send owner notification of missed calls if owner set, 0 not to.No0
musicIntegerID of music on hold. 0 for default.No0
music_ringingInteger1 to play music to caller when ringing, 0 to play ringing.No0
ownerIntegerID of owner. 0 for none.No0
panelInteger1 to display in control panel, 0 not to.No0
pinStringPIN. Empty string for none.NoEmpty string.
pingInteger1 to SIP ping handset, 0 not to.No0
planIntegerID of rate plan. 0 for default.No0
presentation_externalIntegerPresentation on external calls.No1
presentation_internalIntegerPresentation on internal calls.No1
provision1StringSpecial provisioning data.NoEmpty string.
provisioningIntegerID of provisioning template. 0 for automatic or if provisioning is not enabled.No0
recordgroupIntegerID of record group. 0 for none.No0
registrarStringHostname to register to for provisioning. Empty string to use rate plan SIP domain.NoEmpty string.
ringtimeIntegerRing time in seconds.No15
screenInteger1 to screen calls and play callerid, 2 to ask callers to record name, 0 not to screen.No0
sourceStringOnly allow from this IP address. Empty string for any.NoEmpty string.
totalmaximumIntegerMaximum number of calls to allow to/from telephone. -1 for no limit.No-1
utypeStringDestination type on unregistered.No"hangup"
unumberStringDestination number on unregistered.NoEmpty string.
unumber_groupInteger1 to follow the utype and unumber on group calls, 0 not to.No
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.

Data returned

No data is returned.

Example: With required parameters

http://enswitch.example.com/api/json/phones/create/?auth_username=user;auth_password=password;name=1234567;password=secret

{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }

Change history

VersionChanges
4.4presentation_internal, allowed_ua parameter added.
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.