SipSettingsApi » History » Version 35
  Adrian Georgescu, 09/28/2009 10:23 PM 
  
| 1 | 1 | Adrian Georgescu | = SIP Settings API = | 
|---|---|---|---|
| 2 | |||
| 3 | [[TOC(WikiStart, Sip*, depth=3)]] | ||
| 4 | |||
| 5 | == API address == | ||
| 6 | |||
| 7 | 20 | Adrian Georgescu | To access the API, a client must connect using HTTP protocol to the following address: | 
| 8 | 1 | Adrian Georgescu | |
| 9 | 29 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml | 
| 10 | 19 | Adrian Georgescu | |
| 11 | 20 | Adrian Georgescu | To be authorized, the client must use a TLS client certificate, this certificate can be retrieved in the Info tab of the web page for the SIP account settings. | 
| 12 | 28 | Adrian Georgescu | |
| 13 | 23 | Adrian Georgescu | The return is encoded using [http://json.org json]. | 
| 14 | |||
| 15 | 22 | Adrian Georgescu | == TLS Certificate == | 
| 16 | 1 | Adrian Georgescu | |
| 17 | 13 | Adrian Georgescu | Use the web settings page and navigate to the Info tab. Download the TLS certificate in the format supported by your HTTP client. | 
| 18 | 1 | Adrian Georgescu | |
| 19 | 14 | Adrian Georgescu | * !user@domain.crt format can be use by command line tools like curl | 
| 20 | * !user@domain.p12 format can be imported in web browsers | ||
| 21 | 5 | Adrian Georgescu | |
| 22 | 7 | Adrian Georgescu | The .p12 file contains the same certificate stored in a way that can be loaded by web browsers like Safari on MacOSX or Firefox. To unlock the .p12 file you must use the password for your SIP account. | 
| 23 | 1 | Adrian Georgescu | |
| 24 | == API calls == | ||
| 25 | |||
| 26 | 35 | Adrian Georgescu | 1. Create a new SIP account | 
| 27 | {{{ | ||
| 28 | https://enrollment.sipthor.net/enrollment.phtml?email=user@example.com&password=xyz | ||
| 29 | }}} | ||
| 30 | 1 | Adrian Georgescu | |
| 31 | 35 | Adrian Georgescu | You can test the following API commands by using the '''curl''' command line utility as follows: | 
| 32 | |||
| 33 | 3 | Adrian Georgescu | {{{ | 
| 34 | 1 | Adrian Georgescu | curl -k -E user@domain.crt https://enrollment.sipthor.net/settings.phtml?action=get_account | 
| 35 | 34 | Adrian Georgescu | }}} | 
| 36 | |||
| 37 | The following actions are supported: | ||
| 38 | |||
| 39 | 1 | Adrian Georgescu | 1. Return the account information: | 
| 40 | {{{ | ||
| 41 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_account | 
| 42 | 1 | Adrian Georgescu | }}} | 
| 43 | 1. Return the SIP aliases: | ||
| 44 | {{{ | ||
| 45 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_aliases | 
| 46 | 1 | Adrian Georgescu | }}} | 
| 47 | 1. Return the ENUM numbers: | ||
| 48 | {{{ | ||
| 49 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_enum | 
| 50 | 1 | Adrian Georgescu | }}} | 
| 51 | 4 | Adrian Georgescu | 1. Return the last incoming and outgoing calls: | 
| 52 | {{{ | ||
| 53 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_calls | 
| 54 | 4 | Adrian Georgescu | }}} | 
| 55 | 30 | Adrian Georgescu | 1. Return the list of registered devices | 
| 56 | {{{ | ||
| 57 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_devices | 
| 58 | 30 | Adrian Georgescu | }}} | 
| 59 | 1 | Adrian Georgescu | 1. Return the prepaid balance and active prepaid calls: | 
| 60 | {{{ | ||
| 61 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_prepaid | 
| 62 | 1 | Adrian Georgescu | }}} | 
| 63 | 1. Return the history of prepaid balance: | ||
| 64 | {{{ | ||
| 65 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_balance_history | 
| 66 | 1 | Adrian Georgescu | }}} | 
| 67 | 1. Return the curent monthly usage: | ||
| 68 | {{{ | ||
| 69 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_monthly_usage | 
| 70 | 1 | Adrian Georgescu | }}} | 
| 71 | 1. Return the list of diversions: | ||
| 72 | {{{ | ||
| 73 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_diversions | 
| 74 | 1 | Adrian Georgescu | }}} | 
| 75 | 1. Return the list of accept rules: | ||
| 76 | {{{ | ||
| 77 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_accept | 
| 78 | 1 | Adrian Georgescu | }}} | 
| 79 | 1. Return the list of reject rules: | ||
| 80 | {{{ | ||
| 81 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_reject | 
| 82 | 1 | Adrian Georgescu | }}} | 
| 83 | 1. Return the voicemail settings: | ||
| 84 | {{{ | ||
| 85 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_voicemail | 
| 86 | 1 | Adrian Georgescu | }}} | 
| 87 | 9 | Adrian Georgescu | 1. Enabled Do Not Disturb | 
| 88 | {{{ | ||
| 89 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=set_dnd_on | 
| 90 | 9 | Adrian Georgescu | }}} | 
| 91 | 1. Disable Do Not Disturb | ||
| 92 | {{{ | ||
| 93 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=set_dnd_off | 
| 94 | 9 | Adrian Georgescu | }}} | 
| 95 | 17 | Adrian Georgescu | 1. Enable Do Not Disturb for 60 minutes | 
| 96 | 9 | Adrian Georgescu | {{{ | 
| 97 | 33 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=set_dnd_on&duration=60 | 
| 98 | 9 | Adrian Georgescu | }}} | 
| 99 | 10 | Adrian Georgescu | 1. Enabled privacy (hide Caller Id for outgoing calls) | 
| 100 | {{{ | ||
| 101 | 33 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=set_privacy_on | 
| 102 | 10 | Adrian Georgescu | }}} | 
| 103 | 1. Disable privacy | ||
| 104 | {{{ | ||
| 105 | 33 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=set_privacy_off | 
| 106 | 10 | Adrian Georgescu | }}} | 
| 107 | 11 | Adrian Georgescu | 1. Add an alias to our own account | 
| 108 | {{{ | ||
| 109 | 29 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=add_alias&username=alice | 
| 110 | 11 | Adrian Georgescu | }}} | 
| 111 | 16 | Adrian Georgescu | 1. Set diversions | 
| 112 | {{{ | ||
| 113 | 29 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=set_diversions&FUNC=target&FBUS=target&... | 
| 114 | 16 | Adrian Georgescu | }}} | 
| 115 | {{{ | ||
| 116 | FUNC = Forward unconditional all calls | ||
| 117 | FBUS = Forward on Busy | ||
| 118 | FNOL = Forward on Not Online | ||
| 119 | FNOA = Forward on No Answer | ||
| 120 | FUNV = Forward when Not Available based on Accept rules | ||
| 121 | 25 | Adrian Georgescu | |
| 122 | 27 | Adrian Georgescu | Pre-defined keywords for diversion targets: | 
| 123 | 26 | Adrian Georgescu | |
| 124 | 24 | Adrian Georgescu | <voice-mailbox> | 
| 125 | 25 | Adrian Georgescu | <mobile-number> | 
| 126 | |||
| 127 | 24 | Adrian Georgescu | }}} |