JSON API » peers » peers/update

Updates an existing peer.

Input parameters

Requires authentication and the system role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
idIntegerID of peer to update.Yes
called_prefixStringPrefix to prepend to called number.NoCurrent value.
called_strip_hashInteger1 to strip trailing # characters from called number, 0 not.NoCurrent value.
calleridStringCallerid to force. Empty string for existing.NoCurrent value.
callerid_unknownStringCallerid when unknown. Empty string for none.NoCurrent value.
callerid_withheldStringCallerid when withheld. Empty string for none.NoCurrent value.
channel_groupIntegerDAHDI or Zap channel group.NoCurrent value.
chargeInteger1 to charge customers for calls, 0 not to.NoCurrent value.
codecsStringList of acceptable codecs, separated by commas.NoCurrent value.
contextStringextensions.conf context.NoCurrent value.
costsInteger1 if peer has own costs, 0 if peer uses system costs.NoCurrent value.
currencyStringCurrency costs are in.NoCurrent value.
customerIntegerID of customer to reserve for. 0 for none. -1 for all.NoCurrent value.
descriptionStringDescription.NoCurrent value.
destinationStringSIP or IAX destination(s) to send calls to.NoCurrent value.
dialplan_calledStringDial plan called number is sent in.NoCurrent value.
dialplan_callerStringDial plan callerid is sent in.NoCurrent value.
dtmfmodeStringDTMF mode. "inband", "info", or "rfc2833".NoCurrent value.
fail_percentIntegerPercentage of calls to fail.NoCurrent value.
nameStringName.NoCurrent value.
outmaximumIntegerMaximum concurrent calls. -1 for no limit.NoCurrent value.
passwordStringSIP or IAX password to send.NoCurrent value.
plan_customerIntegerID of customer (and children) allowed to create routing exceptions to this peer. 0 for none, -1 for all.NoCurrent value.
proxyStringSIP proxy to send calls via. Empty string to send direct.NoCurrent value.
send_asserted_identityInteger1 to send the P-Asserted-Identity SIP header, 0 not to.NoCurrent value.
send_privacyInteger1 to send the Privacy SIP header, 0 not to.NoCurrent value.
send_rpidInteger1 to send the Remote-Party-ID SIP header, 0 not to.NoCurrent value.
typeStringType. "context", "dahdi", "iax", "sip", or "zap".NoCurrent value.
url_costsStringA URL to look up costs. Normally empty string.NoCurrent value.
usernameStringSIP or IAX username to send.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.
404The peer does not exist.

Data returned

No data is returned.

Example: Changing the name

http://enswitch.example.com/api/json/peers/update/?auth_username=user;auth_password=password;id=123;name=example

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

Change history

VersionChanges
3.15costs input parameter added.
3.13Function added.