Project

General

Profile

SipSettingsApi » History » 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
 * 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
16
https://enrollment.sipthor.net/settings.phtml
17
18
The return is encoded using "json":http://json.org.
19
20
h2. API Functions
21 46 Adrian Georgescu
22 50 Adrian Georgescu
The following actions are supported:
23 49 Adrian Georgescu
24
h3. Identity
25 1 Adrian Georgescu
26 51 Adrian Georgescu
Returns identity information:
27 1 Adrian Georgescu
<pre>
28
https://enrollment.sipthor.net/settings.phtml?action=get_identity
29 46 Adrian Georgescu
</pre>
30 50 Adrian Georgescu
31
h3. SIP aliases
32
33 51 Adrian Georgescu
Return the SIP aliases:
34 1 Adrian Georgescu
<pre>
35
https://enrollment.sipthor.net/settings.phtml?action=get_aliases
36
</pre>
37 50 Adrian Georgescu
38 51 Adrian Georgescu
Add an alias to our own account
39 50 Adrian Georgescu
<pre>
40
https://enrollment.sipthor.net/settings.phtml?action=add_alias&username=alice
41
</pre>
42
43
h3. ENUM numbers
44
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
52 51 Adrian Georgescu
Returns call history:
53
54 1 Adrian Georgescu
<pre>
55
https://enrollment.sipthor.net/settings.phtml?action=get_history
56 48 Adrian Georgescu
</pre>
57 50 Adrian Georgescu
58
h3. Registered devices
59
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
65 50 Adrian Georgescu
h3. Prepaid
66
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
</pre>
71 51 Adrian Georgescu
72
Return the history of prepaid balance:
73 1 Adrian Georgescu
<pre>
74
https://enrollment.sipthor.net/settings.phtml?action=get_balance_history
75
</pre>
76 51 Adrian Georgescu
77
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
</pre>
81 50 Adrian Georgescu
82
h3. Call forwarding
83
84 51 Adrian Georgescu
Return the call forwarding settings:
85 1 Adrian Georgescu
<pre>
86
https://enrollment.sipthor.net/settings.phtml?action=get_call_forwarding
87
</pre>
88 50 Adrian Georgescu
89 51 Adrian Georgescu
Set call forwarding
90 50 Adrian Georgescu
<pre>
91
https://enrollment.sipthor.net/settings.phtml?action=set_call_forwarding&FUNC=target&FBUS=target&...
92
</pre>
93
<pre>
94
FUNC = Forward unconditional all calls
95
FBUS = Forward on Busy
96
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
100 1 Adrian Georgescu
Pre-defined keywords for diversion targets:
101
102 50 Adrian Georgescu
<voice-mailbox>
103
<mobile-number>
104
105
</pre>
106
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
https://enrollment.sipthor.net/settings.phtml?action=get_accept_rules
112
</pre>
113 51 Adrian Georgescu
114
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
</pre>
118 50 Adrian Georgescu
119
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
</pre>
125 50 Adrian Georgescu
126
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
</pre>
132 51 Adrian Georgescu
133
Disable Do Not Disturb
134 46 Adrian Georgescu
<pre>
135
https://enrollment.sipthor.net/settings.phtml?action=set_dnd_off
136 1 Adrian Georgescu
</pre>
137 51 Adrian Georgescu
138
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
</pre>
142 1 Adrian Georgescu
143 50 Adrian Georgescu
h3. Privacy
144
145 51 Adrian Georgescu
Enabled privacy (hide Caller Id for outgoing calls)
146 1 Adrian Georgescu
<pre>
147
https://enrollment.sipthor.net/settings.phtml?action=set_privacy_on
148
</pre>
149 51 Adrian Georgescu
150
Disable privacy
151 1 Adrian Georgescu
<pre>
152
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
159 58 Adrian Georgescu
Get journal entries
160 52 Adrian Georgescu
161
<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
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
<pre>
170
https://enrollment.sipthor.net/settings.phtml?action=put_journal_entries
171 1 Adrian Georgescu
</pre>
172
173 59 Adrian Georgescu
The request must be done using POST method by passing two variables uuid=UUID and data=DATA. 
174
175
UUID is the GRUU identifier of the SIP client.  
176
177
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
179
'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.