JSON API » peers » peers/update
Updates an existing peer.
Input parameters
Requires authentication and the system role privilege.
| Name | Type | Description | Required | Default value |
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes | |
| auth_password | String | Authentication password. | Yes | |
| id | Integer | ID of peer to update. | Yes | |
| called_prefix | String | Prefix to prepend to called number. | No | Current value. |
| called_strip_hash | Integer | 1 to strip trailing # characters from called number, 0 not. | No | Current value. |
| callerid | String | Callerid to force. Empty string for existing. | No | Current value. |
| callerid_unknown | String | Callerid when unknown. Empty string for none. | No | Current value. |
| callerid_withheld | String | Callerid when withheld. Empty string for none. | No | Current value. |
| channel_group | Integer | DAHDI or Zap channel group. | No | Current value. |
| charge | Integer | 1 to charge customers for calls, 0 not to. | No | Current value. |
| codecs | String | List of acceptable codecs, separated by commas. | No | Current value. |
| context | String | extensions.conf context. | No | Current value. |
| costs | Integer | 1 if peer has own costs, 0 if peer uses system costs. | No | Current value. |
| currency | String | Currency costs are in. | No | Current value. |
| customer | Integer | ID of customer to reserve for. 0 for none. -1 for all. | No | Current value. |
| description | String | Description. | No | Current value. |
| destination | String | SIP or IAX destination(s) to send calls to. | No | Current value. |
| dialplan_called | String | Dial plan called number is sent in. | No | Current value. |
| dialplan_caller | String | Dial plan callerid is sent in. | No | Current value. |
| dtmfmode | String | DTMF mode. "inband", "info", "rfc2833" or "rfc4733". | No | Current value. |
| fail_percent | Integer | Percentage of calls to fail. | No | Current value. |
| name | String | Name. | No | Current value. |
| outmaximum | Integer | Maximum concurrent calls. -1 for no limit. | No | Current value. |
| password | String | SIP or IAX password to send. | No | Current value. |
| plan_customer | Integer | ID of customer (and children) allowed to create routing exceptions to this peer. 0 for none, -1 for all. | No | Current value. |
| proxy | String | SIP proxy to send calls via. Empty string to send direct. | No | Current value. |
| send_asserted_identity | Integer | 1 to send the P-Asserted-Identity SIP header, 0 not to. | No | Current value. |
| send_privacy | Integer | 1 to send the Privacy SIP header, 0 not to. | No | Current value. |
| send_rpid | Integer | 1 to send the Remote-Party-ID SIP header, 0 not to. | No | Current value. |
| type | String | Type. "context", "dahdi", "iax", "sip", "pjsip" or "zap". | No | Current value. |
| url_costs | String | A URL to look up costs. Normally empty string. | No | Current value. |
| username | String | SIP or IAX username to send. | 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. |
| 404 | The 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
| Version | Changes |
|---|---|
| 4.2 | type parameter "pjsip" value added, dtmfmode parameter "rfc4733" value added. |
| 3.15 | costs input parameter added. |
| 3.13 | Function added. |
