SipSettingsApi

Version 64 (Adrian Georgescu, 10/19/2012 11:35 am)

1 61 Adrian Georgescu
h1. SIP Account Management API
2 46 Adrian Georgescu
3 63 Adrian Georgescu
This API can be used from third party applications running in and end-point that wish to interact with the SIP account data stored on the server. Data can be read or modified by calling various functions.
4 46 Adrian Georgescu
5 64 Adrian Georgescu
h2. LDAP server
6 64 Adrian Georgescu
7 64 Adrian Georgescu
 * LDAP server address: tls://ldap.sipthor.net:636
8 64 Adrian Georgescu
 * LDAP search base: ou=addressbook, dc=sip2sip, dc=info
9 64 Adrian Georgescu
10 64 Adrian Georgescu
11 62 Adrian Georgescu
h2. Server Address
12 46 Adrian Georgescu
13 1 Adrian Georgescu
To access the API, a client must connect using HTTP protocol to the following address: 
14 1 Adrian Georgescu
15 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml
16 1 Adrian Georgescu
17 1 Adrian Georgescu
The return is encoded using "json":http://json.org.
18 1 Adrian Georgescu
19 1 Adrian Georgescu
h2. API Functions
20 46 Adrian Georgescu
21 50 Adrian Georgescu
The following actions are supported:
22 49 Adrian Georgescu
23 49 Adrian Georgescu
h3. Identity
24 1 Adrian Georgescu
25 51 Adrian Georgescu
Returns identity information:
26 1 Adrian Georgescu
<pre>
27 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_identity
28 46 Adrian Georgescu
</pre>
29 50 Adrian Georgescu
30 50 Adrian Georgescu
h3. SIP aliases
31 50 Adrian Georgescu
32 51 Adrian Georgescu
Return the SIP aliases:
33 1 Adrian Georgescu
<pre>
34 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_aliases
35 1 Adrian Georgescu
</pre>
36 50 Adrian Georgescu
37 51 Adrian Georgescu
Add an alias to our own account
38 50 Adrian Georgescu
<pre>
39 50 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=add_alias&username=alice
40 50 Adrian Georgescu
</pre>
41 50 Adrian Georgescu
42 50 Adrian Georgescu
h3. ENUM numbers
43 50 Adrian Georgescu
44 51 Adrian Georgescu
Return the ENUM numbers:
45 1 Adrian Georgescu
<pre>
46 46 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_enum
47 1 Adrian Georgescu
</pre>
48 46 Adrian Georgescu
49 50 Adrian Georgescu
h3. Call history
50 50 Adrian Georgescu
51 51 Adrian Georgescu
Returns call history:
52 51 Adrian Georgescu
53 1 Adrian Georgescu
<pre>
54 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_history
55 48 Adrian Georgescu
</pre>
56 50 Adrian Georgescu
57 50 Adrian Georgescu
h3. Registered devices
58 50 Adrian Georgescu
59 51 Adrian Georgescu
Return the list of registered devices
60 47 Adrian Georgescu
<pre>
61 46 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_devices
62 1 Adrian Georgescu
</pre>
63 1 Adrian Georgescu
64 50 Adrian Georgescu
h3. Prepaid
65 50 Adrian Georgescu
66 51 Adrian Georgescu
Return the prepaid balance and active calls:
67 1 Adrian Georgescu
<pre>
68 46 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_prepaid
69 46 Adrian Georgescu
</pre>
70 51 Adrian Georgescu
71 51 Adrian Georgescu
Return the history of prepaid balance:
72 1 Adrian Georgescu
<pre>
73 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_balance_history
74 1 Adrian Georgescu
</pre>
75 51 Adrian Georgescu
76 51 Adrian Georgescu
Return the curent monthly usage:
77 1 Adrian Georgescu
<pre>
78 46 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_monthly_usage
79 46 Adrian Georgescu
</pre>
80 50 Adrian Georgescu
81 50 Adrian Georgescu
h3. Call forwarding
82 50 Adrian Georgescu
83 51 Adrian Georgescu
Return the call forwarding settings:
84 1 Adrian Georgescu
<pre>
85 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_call_forwarding
86 1 Adrian Georgescu
</pre>
87 50 Adrian Georgescu
88 51 Adrian Georgescu
Set call forwarding
89 50 Adrian Georgescu
<pre>
90 50 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_call_forwarding&FUNC=target&FBUS=target&...
91 50 Adrian Georgescu
</pre>
92 50 Adrian Georgescu
<pre>
93 50 Adrian Georgescu
FUNC = Forward unconditional all calls
94 50 Adrian Georgescu
FBUS = Forward on Busy
95 50 Adrian Georgescu
FNOL = Forward on Not Online
96 1 Adrian Georgescu
FNOA = Forward on No Answer
97 50 Adrian Georgescu
FUNV = Forward when Not Available based on Accept rules
98 50 Adrian Georgescu
99 1 Adrian Georgescu
Pre-defined keywords for diversion targets:
100 1 Adrian Georgescu
101 50 Adrian Georgescu
<voice-mailbox>
102 50 Adrian Georgescu
<mobile-number>
103 50 Adrian Georgescu
104 50 Adrian Georgescu
</pre>
105 50 Adrian Georgescu
106 1 Adrian Georgescu
h3. Call filtering
107 50 Adrian Georgescu
 
108 51 Adrian Georgescu
Return the list of accept rules:
109 1 Adrian Georgescu
<pre>
110 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_accept_rules
111 1 Adrian Georgescu
</pre>
112 51 Adrian Georgescu
113 51 Adrian Georgescu
Return the list of reject rules:
114 46 Adrian Georgescu
<pre>
115 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_reject_rules
116 1 Adrian Georgescu
</pre>
117 50 Adrian Georgescu
118 50 Adrian Georgescu
h3. Voicemail settings
119 1 Adrian Georgescu
120 51 Adrian Georgescu
Return the voicemail settings:
121 1 Adrian Georgescu
<pre>
122 46 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_voicemail
123 46 Adrian Georgescu
</pre>
124 50 Adrian Georgescu
125 50 Adrian Georgescu
h3. Do not disturb
126 1 Adrian Georgescu
127 51 Adrian Georgescu
Enabled Do Not Disturb
128 46 Adrian Georgescu
<pre>
129 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_dnd_on
130 1 Adrian Georgescu
</pre>
131 51 Adrian Georgescu
132 51 Adrian Georgescu
Disable Do Not Disturb
133 46 Adrian Georgescu
<pre>
134 46 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_dnd_off
135 1 Adrian Georgescu
</pre>
136 51 Adrian Georgescu
137 51 Adrian Georgescu
Enable Do Not Disturb for 60 minutes
138 1 Adrian Georgescu
<pre>
139 46 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_dnd_on&duration=60
140 46 Adrian Georgescu
</pre>
141 1 Adrian Georgescu
142 50 Adrian Georgescu
h3. Privacy
143 50 Adrian Georgescu
144 51 Adrian Georgescu
Enabled privacy (hide Caller Id for outgoing calls)
145 1 Adrian Georgescu
<pre>
146 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_privacy_on
147 1 Adrian Georgescu
</pre>
148 51 Adrian Georgescu
149 51 Adrian Georgescu
Disable privacy
150 1 Adrian Georgescu
<pre>
151 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_privacy_off
152 46 Adrian Georgescu
</pre>
153 52 Adrian Georgescu
154 57 Adrian Georgescu
h3. Data replication
155 1 Adrian Georgescu
156 57 Adrian Georgescu
These function can be used by multiple client instances to replicate arbitrary data among themselves. An example of such application is bidirectional replication of chat messages between multiple clients configured for the same account. 
157 57 Adrian Georgescu
158 58 Adrian Georgescu
Get journal entries
159 52 Adrian Georgescu
160 52 Adrian Georgescu
<pre>
161 55 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_journal_entries&except_uuid=UUID&after_id=ID
162 52 Adrian Georgescu
</pre>
163 52 Adrian Georgescu
164 60 Adrian Georgescu
UUID is the GRUU identifier of the SIP client. ID must be replaced with the last replicated journal_id received from a previous get_journal_entries call. The return contains an array with 'data' entities that were put using the 'put_journal_entries' call.
165 52 Adrian Georgescu
166 58 Adrian Georgescu
Put journal entries
167 52 Adrian Georgescu
168 52 Adrian Georgescu
<pre>
169 52 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=put_journal_entries
170 1 Adrian Georgescu
</pre>
171 1 Adrian Georgescu
172 59 Adrian Georgescu
The request must be done using POST method by passing two variables uuid=UUID and data=DATA. 
173 59 Adrian Georgescu
174 59 Adrian Georgescu
UUID is the GRUU identifier of the SIP client.  
175 59 Adrian Georgescu
176 59 Adrian Georgescu
DATA must be a json encoded associative array containing the 'id' and 'data' keys. 'id' value must be client own identifier corresponding to the replicated data. 
177 59 Adrian Georgescu
178 59 Adrian Georgescu
'data' value can be anything the client understands when reading it back using  a get_journal_entries call. Is recommended that 'data' values are encrypted using a key known only by the client.
179 58 Adrian Georgescu
180 60 Adrian Georgescu
The response from the server contains a json encoded array with mappings between client id and server journal id that can be saved by the client for further reference that can be used for 'get_journal_entries' calls.