MOR API provider create
From Kolmisoft Wiki
Jump to navigationJump to search
Description
MOR API for creating providers.
Usage
- From MOR X17 call: /api/provider_create
- Methods: POST, GET(if allowed, not recomended)
Parametres
- u - username to login. Required.
- hash – SHA1 hash constructed using API Secret Key ( More described in Constructing hash). Required.
- name - Provider's name, must be unique Required.
- tech - Technology to use, can be any from (providertypes.name) (dahdi, SIP, IAX2, H323) Required.
- tariff_id - Tariff to use, can be any Provider Tariff (tariffs.purpose == 'provider') Required.
- server_ids - Asterisk Servers, must be in following format "1,3,4", if this parameter is not used, all Asterisk Servers are automatically assigned
- active - 1 for active, 0 for not active
- dtmfmode - DTMF Mode, accepted values [inband, info, rfc2833, auto]. If CCL is active and Provider is SIP, then accepted values are [rfc2833, auto]
- location_id - Any Location (locations) by owner (locations.user_id)
- timeout - Ringing Timeout, any integer value which is equal to 30 or higher
- max_timeout - Call Timeout, any integer value which is equal to 0 or higher
- call_limit - Call Limit, any integer value which is equal to 0 or higher
- balance_limit - Balance limit, any decimal value (value separated by dot ".")
- login - Authentication Login/Username ("anonymous" and "unknown" are not allowed)
- password - Authentication Password
- register - Authentication Register, 0 - Not register, 1 - Register. If Network related type is Dynamic, Register is automatically set to 0
- cid_name - Provider CallerID Name
- cid_number - Provider CallerID Number
- network_type - Network related type, accepted values [hostname ip dynamic]
- server_ip - Network related Hostname. If Network related type is Dynamic, Hostname is automatically set to 'dynamic'
- ipaddr - Network related Server IP. If Network related type is Dynamic, Server IP is automatically set to blank
- port - Network related Port, any integer value which is higher than 0. If Network related type is Dynamic, Port is automatically set to 0.
- fromdomain - SIP Specific Fromdomain
- fromuser - SIP Specific Fromuser
Request
If API Secret Key = secret
You send:
HTML POST: http://<SERVER IP>/billing/api/provider_create?u=admin&name=ApiProvider&tech=SIP&tariff_id=1&server_ids=1&hash=e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4
Returns
Success
<?xml version="1.0" encoding="UTF-8"?> <page> <status> <success>Provider created</success> <provider_id>7</provider_id> </status> </page>