Project

General

Profile

SipSettingsApi » History » Version 62

Adrian Georgescu, 08/03/2012 11:36 AM

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