SipSettingsApi

Version 68 (Adrian Georgescu, 12/08/2015 01:20 pm)

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 65 Adrian Georgescu
h2. Directory Services
6 1 Adrian Georgescu
7 65 Adrian Georgescu
SIP2SIP uses LDAP for directory services:
8 64 Adrian Georgescu
9 66 Adrian Georgescu
h3. Server address
10 66 Adrian Georgescu
11 66 Adrian Georgescu
tls://ldap.sipthor.net:636
12 66 Adrian Georgescu
13 66 Adrian Georgescu
h3. Search base
14 66 Adrian Georgescu
15 66 Adrian Georgescu
ou=addressbook, dc=sip2sip, dc=info
16 64 Adrian Georgescu
17 62 Adrian Georgescu
h2. Server Address
18 46 Adrian Georgescu
19 1 Adrian Georgescu
To access the API, a client must connect using HTTP protocol to the following address: 
20 1 Adrian Georgescu
21 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml
22 1 Adrian Georgescu
23 1 Adrian Georgescu
The return is encoded using "json":http://json.org.
24 1 Adrian Georgescu
25 68 Adrian Georgescu
h3. Authentication
26 68 Adrian Georgescu
27 68 Adrian Georgescu
To login  you must append &realm=sip2sip.info to the query string, then in the HTTP digest authentication form enter the username part without @sip2sip.info and the password. 
28 68 Adrian Georgescu
29 1 Adrian Georgescu
h2. API Functions
30 46 Adrian Georgescu
31 50 Adrian Georgescu
The following actions are supported:
32 49 Adrian Georgescu
33 49 Adrian Georgescu
h3. Identity
34 1 Adrian Georgescu
35 51 Adrian Georgescu
Returns identity information:
36 1 Adrian Georgescu
<pre>
37 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_identity
38 46 Adrian Georgescu
</pre>
39 50 Adrian Georgescu
40 50 Adrian Georgescu
h3. SIP aliases
41 50 Adrian Georgescu
42 51 Adrian Georgescu
Return the SIP aliases:
43 1 Adrian Georgescu
<pre>
44 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_aliases
45 1 Adrian Georgescu
</pre>
46 50 Adrian Georgescu
47 51 Adrian Georgescu
Add an alias to our own account
48 50 Adrian Georgescu
<pre>
49 50 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=add_alias&username=alice
50 50 Adrian Georgescu
</pre>
51 50 Adrian Georgescu
52 50 Adrian Georgescu
h3. ENUM numbers
53 50 Adrian Georgescu
54 51 Adrian Georgescu
Return the ENUM numbers:
55 1 Adrian Georgescu
<pre>
56 46 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_enum
57 1 Adrian Georgescu
</pre>
58 46 Adrian Georgescu
59 50 Adrian Georgescu
h3. Call history
60 50 Adrian Georgescu
61 51 Adrian Georgescu
Returns call history:
62 51 Adrian Georgescu
63 1 Adrian Georgescu
<pre>
64 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_history
65 48 Adrian Georgescu
</pre>
66 50 Adrian Georgescu
67 50 Adrian Georgescu
h3. Registered devices
68 50 Adrian Georgescu
69 51 Adrian Georgescu
Return the list of registered devices
70 47 Adrian Georgescu
<pre>
71 46 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_devices
72 1 Adrian Georgescu
</pre>
73 1 Adrian Georgescu
74 50 Adrian Georgescu
h3. Prepaid
75 50 Adrian Georgescu
76 51 Adrian Georgescu
Return the prepaid balance and active calls:
77 1 Adrian Georgescu
<pre>
78 46 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_prepaid
79 46 Adrian Georgescu
</pre>
80 51 Adrian Georgescu
81 51 Adrian Georgescu
Return the history of prepaid balance:
82 1 Adrian Georgescu
<pre>
83 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_balance_history
84 1 Adrian Georgescu
</pre>
85 51 Adrian Georgescu
86 51 Adrian Georgescu
Return the curent monthly usage:
87 1 Adrian Georgescu
<pre>
88 46 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_monthly_usage
89 46 Adrian Georgescu
</pre>
90 50 Adrian Georgescu
91 50 Adrian Georgescu
h3. Call forwarding
92 50 Adrian Georgescu
93 51 Adrian Georgescu
Return the call forwarding settings:
94 1 Adrian Georgescu
<pre>
95 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_call_forwarding
96 1 Adrian Georgescu
</pre>
97 50 Adrian Georgescu
98 51 Adrian Georgescu
Set call forwarding
99 50 Adrian Georgescu
<pre>
100 50 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_call_forwarding&FUNC=target&FBUS=target&...
101 50 Adrian Georgescu
</pre>
102 50 Adrian Georgescu
<pre>
103 50 Adrian Georgescu
FUNC = Forward unconditional all calls
104 50 Adrian Georgescu
FBUS = Forward on Busy
105 50 Adrian Georgescu
FNOL = Forward on Not Online
106 1 Adrian Georgescu
FNOA = Forward on No Answer
107 50 Adrian Georgescu
FUNV = Forward when Not Available based on Accept rules
108 50 Adrian Georgescu
109 1 Adrian Georgescu
Pre-defined keywords for diversion targets:
110 1 Adrian Georgescu
111 50 Adrian Georgescu
<voice-mailbox>
112 50 Adrian Georgescu
<mobile-number>
113 50 Adrian Georgescu
114 50 Adrian Georgescu
</pre>
115 50 Adrian Georgescu
116 1 Adrian Georgescu
h3. Call filtering
117 50 Adrian Georgescu
 
118 51 Adrian Georgescu
Return the list of accept rules:
119 1 Adrian Georgescu
<pre>
120 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_accept_rules
121 1 Adrian Georgescu
</pre>
122 51 Adrian Georgescu
123 51 Adrian Georgescu
Return the list of reject rules:
124 46 Adrian Georgescu
<pre>
125 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_reject_rules
126 1 Adrian Georgescu
</pre>
127 50 Adrian Georgescu
128 50 Adrian Georgescu
h3. Voicemail settings
129 1 Adrian Georgescu
130 51 Adrian Georgescu
Return the voicemail settings:
131 1 Adrian Georgescu
<pre>
132 46 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_voicemail
133 46 Adrian Georgescu
</pre>
134 50 Adrian Georgescu
135 50 Adrian Georgescu
h3. Do not disturb
136 1 Adrian Georgescu
137 51 Adrian Georgescu
Enabled Do Not Disturb
138 46 Adrian Georgescu
<pre>
139 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_dnd_on
140 1 Adrian Georgescu
</pre>
141 51 Adrian Georgescu
142 51 Adrian Georgescu
Disable Do Not Disturb
143 46 Adrian Georgescu
<pre>
144 46 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_dnd_off
145 1 Adrian Georgescu
</pre>
146 51 Adrian Georgescu
147 51 Adrian Georgescu
Enable Do Not Disturb for 60 minutes
148 1 Adrian Georgescu
<pre>
149 46 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_dnd_on&duration=60
150 46 Adrian Georgescu
</pre>
151 1 Adrian Georgescu
152 50 Adrian Georgescu
h3. Privacy
153 50 Adrian Georgescu
154 51 Adrian Georgescu
Enabled privacy (hide Caller Id for outgoing calls)
155 1 Adrian Georgescu
<pre>
156 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_privacy_on
157 1 Adrian Georgescu
</pre>
158 51 Adrian Georgescu
159 51 Adrian Georgescu
Disable privacy
160 1 Adrian Georgescu
<pre>
161 1 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_privacy_off
162 46 Adrian Georgescu
</pre>
163 52 Adrian Georgescu
164 57 Adrian Georgescu
h3. Data replication
165 1 Adrian Georgescu
166 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. 
167 57 Adrian Georgescu
168 58 Adrian Georgescu
Get journal entries
169 52 Adrian Georgescu
170 52 Adrian Georgescu
<pre>
171 67 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_journal_entries&except_uuid=UUID&after_timestamp=UNIX_TIMESTAMP
172 52 Adrian Georgescu
</pre>
173 52 Adrian Georgescu
174 67 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. Optionally after_timestamp can be used to retrieve entries recent than the given timestamp.
175 52 Adrian Georgescu
176 58 Adrian Georgescu
Put journal entries
177 52 Adrian Georgescu
178 52 Adrian Georgescu
<pre>
179 52 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=put_journal_entries
180 1 Adrian Georgescu
</pre>
181 1 Adrian Georgescu
182 59 Adrian Georgescu
The request must be done using POST method by passing two variables uuid=UUID and data=DATA. 
183 59 Adrian Georgescu
184 59 Adrian Georgescu
UUID is the GRUU identifier of the SIP client.  
185 59 Adrian Georgescu
186 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. 
187 59 Adrian Georgescu
188 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.
189 58 Adrian Georgescu
190 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.