api:sip:account:get
Table of Contents
API : SIP account Get
Introduction
This request will return the the specified SIP account.
Request
| URL | https://api.telecomx.dk/sip/ACCOUNT_ID | |
|---|---|---|
| Method | GET | |
| Access level | VIEWER, MANAGER or OWNER if user belongs to the customer. RESELLER if customer belongs to the reseller. ADMIN. |
|
| Param | ACCOUNT_ID | Id of the SIP account (24 hex-char string). |
| Query | expand | True to expand numbers with additional details. See description below. |
Query example
https://api.telecomx.dk/sip/1234567890ABCDEF12345678
Response
| Json object | ||
|---|---|---|
| _id | Id | Unique SIP account id. |
| customer | Id | Id of customer the SIP account belongs to. |
| active | Boolean | True if the account is active and can handle calls. |
| name | String | Human readable name of the SIP account, or the first number of the account. |
| type | String | Type of account - always 'SIP'. |
| numbers | Array | Array of numbers that the account handles in E.164 format. |
| highRate | Boolean | True if account can be used for calling high rated numbers. |
| international | Boolean | True if account can be used for calling outside Denmark. |
| address | Id | Address the SIP account belongs to (for 112/114 emergency routing) and public phonebooks. |
| ratePlan | Id | Id of the SIP rate plan product this account should be invoiced by. |
| newRatePlan | Id | If a new rateplan should be applied at end of month, this is the plan (cannot change in mid-month). |
| parentSipAccount | Id | Id of another SIP account. If set, rating calls made on this account is made as if the calls were made on the other account. |
| pbx | Number | Id of hosted PBX cluster to use, null or 0 if not part of hosted PBX. |
| notes | String | Notes about the SIP account, only visible to RESELLER and ADMIN. |
| custom | Object | Custom data that 3rd parties may append, max. 4Kb. |
| status | String | 'ON' if the SIP client is connected/reachable, 'OFF' if unreachable. |
| sipServer | String | IP address of the SIP server currently handling this SIP account. Only visible for ADMIN. |
| userAgent | String | The latest user agent string received from the SIP client. |
| contact | String | The latest registration contact string as received from the SIP client. |
| connection | String | Method for the SIP client to connect: IP_AUTH - Calls are sent to the fixed IP address and port, client must use authentication to initiate outbound calls, and can only do so from the fixed IP address. IP_AUTH_REG - Client must be at the fixed IP address, must register to receive calls and must use authentication to initiate outbound calls. IP - Calls are sent to the fixed IP address and port, and outbound calls must be made from the fixed IP address - no authentication is required (Lync mode). COUNTRY_AUTH_REG - client must register to make and receive calls, and client must come from an IP address in one of the selected countries. |
| username | String | 16 characters auto-generated string. Can only be changed used the resetCredentials API call. |
| password | String | 16 characters auto-generated string. Can only be changed used the resetCredentials API call. |
| ipAddress | String | IP address the SIP client must originate from and calls are sent to if connection is not COUNTRY_AUTH_REG. |
| port | Integer | Port that calls are sent to if connection is IP or IP_AUTH, default 5060. |
| countries | String | Comma list of ISO3166 2 char country codes from where the SIP client may register, if connection is COUNTRY_AUTH_REG. |
| clipSA | Boolean | True if SIP client may present any phone number, false if SIP client may only present the numbers in numbers. |
| stripDkCountryCode | Boolean | True if +45 should be stripped before sending calls to the SIP client. |
| prefixMobileOriginated | Boolean | True if calls from mobile device should be prefixed with 03 before sending it to the SIP client. |
| failover | String | E.164 number or IP address or E.164@IP to redirect to when calls cannot be delivered to the sip client. |
| alwaysFailover | Boolean | True to always use the failover. |
| registerExpire | Integer | If connection method requires registration and the client is registered this is the time in seconds until next register request must be sent. -1 if not registered, omitted if registration not required. |
| invoicedUntil | Date | The date the account has been invoiced until. On or after this date the account should be invoiced again for the next period, starting on this date. |
| usageBlock | Boolean | True if highRate and international has been blocked due to high usage. Can only be unset by RESELLER or ADMIN users. |
| defaultNumber | String | Default number to present when a client presents an invalid a-number on an outbound call. Automatically set if not specified, and must be one of the numbers on the SIP account. |
| alwaysDefaultNumber | Boolean | If the default number must always be presented on outbound calls. |
| alwaysSecretNumber | Boolean | If outbound calls must always be presented with secret number. |
| billingCustomer | ObjectID | Alternate customer to bill this SIP account to. |
Note that properties holding no value may be omitted from the object.
If expand=true, then the numbers property is modified to be an array of object with the following properties:
| number | String | The phone number in E.164 format. |
| status | String | The current status of the number: IN_USE_THIS_ACCOUNT - The number is in use IN_PORTING_THIS_ACCOUNT - The number is being ported in |
| employee | Id | Id of the employee the number is used by, if linked to an employee. |
| employeeName | String | Name of the employee or function using the number. |
| addressOverride | Id | Optional address the phone number belongs to (for 112/114 emergency routing) and public phonebooks. This overrides the address on the SIP account. |
Example
{ _id: '1234567890ABCDEF12345678', customer: '1234567890ABCDEF12345678', active: true, name: 'Primary trunk CPH', type: 'SIP', numbers: ['+4570305050','+4570305051','+4570305052','+4580808080'], highRate: true, international: true, address: '1234567890ABCDEF12345678', ratePlan: '1234567890ABCDEF12345678', newRatePlan: null, parentSipAccount: null, pbx: 0, notes: 'A note about the SIP account', custom: null, status: 'ON', sipServer: 1.2.3.4, userAgent: 'Asterisk 1.8.13', contact: 'fhrtu373utiu38r8@77.66.100.10:5060', connection: 'IP_AUTH_REG', username: 'fhrtu373utiu38r8', password: 'eh378gi2ufvhghug', ipAddress: '77.66.100.10', port: null, countries: null, clipSA: true, stripDkCountryCode: true, prefixMobileOriginated: true, failover: '+4588888888@77.66.100.123', alwaysFailover: false, registerExpire: 352, invoicedUntil: '2014-01-01T12:34:56.000Z', defaultNumber: '+4570305050', alwaysDefaultNumber: false, alwaysSecretNumber: false }
Errors
| Error code | Message | Description |
|---|---|---|
| 404 | sipAccount | SIP account not found |
| 403 | access_denied | Insufficient access level |
api/sip/account/get.txt · Last modified: 2025/09/05 13:31 by Per Møller