SipSettingsApi » History » Version 36
Adrian Georgescu, 09/28/2009 10:24 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 | You can test the following API commands by using the '''curl''' command line utility as follows: |
27 | |||
28 | 3 | Adrian Georgescu | {{{ |
29 | 1 | Adrian Georgescu | curl -k -E user@domain.crt https://enrollment.sipthor.net/settings.phtml?action=get_account |
30 | }}} |
||
31 | |||
32 | The following actions are supported: |
||
33 | |||
34 | 36 | Adrian Georgescu | 1. Create a new SIP account (no need for a certificate for this function) |
35 | {{{ |
||
36 | https://enrollment.sipthor.net/enrollment.phtml?email=user@example.com&password=xyz |
||
37 | }}} |
||
38 | 1 | Adrian Georgescu | 1. Return the account information: |
39 | {{{ |
||
40 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_account |
41 | 1 | Adrian Georgescu | }}} |
42 | 1. Return the SIP aliases: |
||
43 | {{{ |
||
44 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_aliases |
45 | 1 | Adrian Georgescu | }}} |
46 | 1. Return the ENUM numbers: |
||
47 | {{{ |
||
48 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_enum |
49 | 1 | Adrian Georgescu | }}} |
50 | 4 | Adrian Georgescu | 1. Return the last incoming and outgoing calls: |
51 | {{{ |
||
52 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_calls |
53 | 4 | Adrian Georgescu | }}} |
54 | 30 | Adrian Georgescu | 1. Return the list of registered devices |
55 | {{{ |
||
56 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_devices |
57 | 30 | Adrian Georgescu | }}} |
58 | 1 | Adrian Georgescu | 1. Return the prepaid balance and active prepaid calls: |
59 | {{{ |
||
60 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_prepaid |
61 | 1 | Adrian Georgescu | }}} |
62 | 1. Return the history of prepaid balance: |
||
63 | {{{ |
||
64 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_balance_history |
65 | 1 | Adrian Georgescu | }}} |
66 | 1. Return the curent monthly usage: |
||
67 | {{{ |
||
68 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_monthly_usage |
69 | 1 | Adrian Georgescu | }}} |
70 | 1. Return the list of diversions: |
||
71 | {{{ |
||
72 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_diversions |
73 | 1 | Adrian Georgescu | }}} |
74 | 1. Return the list of accept rules: |
||
75 | {{{ |
||
76 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_accept |
77 | 1 | Adrian Georgescu | }}} |
78 | 1. Return the list of reject rules: |
||
79 | {{{ |
||
80 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_reject |
81 | 1 | Adrian Georgescu | }}} |
82 | 1. Return the voicemail settings: |
||
83 | {{{ |
||
84 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=get_voicemail |
85 | 1 | Adrian Georgescu | }}} |
86 | 9 | Adrian Georgescu | 1. Enabled Do Not Disturb |
87 | {{{ |
||
88 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=set_dnd_on |
89 | 9 | Adrian Georgescu | }}} |
90 | 1. Disable Do Not Disturb |
||
91 | {{{ |
||
92 | 32 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=set_dnd_off |
93 | 9 | Adrian Georgescu | }}} |
94 | 17 | Adrian Georgescu | 1. Enable Do Not Disturb for 60 minutes |
95 | 9 | Adrian Georgescu | {{{ |
96 | 33 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=set_dnd_on&duration=60 |
97 | 9 | Adrian Georgescu | }}} |
98 | 10 | Adrian Georgescu | 1. Enabled privacy (hide Caller Id for outgoing calls) |
99 | {{{ |
||
100 | 33 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=set_privacy_on |
101 | 10 | Adrian Georgescu | }}} |
102 | 1. Disable privacy |
||
103 | {{{ |
||
104 | 33 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=set_privacy_off |
105 | 10 | Adrian Georgescu | }}} |
106 | 11 | Adrian Georgescu | 1. Add an alias to our own account |
107 | {{{ |
||
108 | 29 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=add_alias&username=alice |
109 | 11 | Adrian Georgescu | }}} |
110 | 16 | Adrian Georgescu | 1. Set diversions |
111 | {{{ |
||
112 | 29 | Adrian Georgescu | https://enrollment.sipthor.net/settings.phtml?action=set_diversions&FUNC=target&FBUS=target&... |
113 | 16 | Adrian Georgescu | }}} |
114 | {{{ |
||
115 | FUNC = Forward unconditional all calls |
||
116 | FBUS = Forward on Busy |
||
117 | FNOL = Forward on Not Online |
||
118 | FNOA = Forward on No Answer |
||
119 | FUNV = Forward when Not Available based on Accept rules |
||
120 | 25 | Adrian Georgescu | |
121 | 27 | Adrian Georgescu | Pre-defined keywords for diversion targets: |
122 | 26 | Adrian Georgescu | |
123 | 24 | Adrian Georgescu | <voice-mailbox> |
124 | 25 | Adrian Georgescu | <mobile-number> |
125 | |||
126 | 24 | Adrian Georgescu | }}} |