SipSettingsApi

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