SipSettingsApi

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