Project

General

Profile

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