SipSettingsApi

Version 32 (Adrian Georgescu, 09/28/2009 02:29 pm)

1 1 Adrian Georgescu
= SIP Settings API =
2 1 Adrian Georgescu
 
3 1 Adrian Georgescu
[[TOC(WikiStart, Sip*, depth=3)]]
4 1 Adrian Georgescu
5 1 Adrian Georgescu
== API address ==
6 1 Adrian Georgescu
7 20 Adrian Georgescu
To access the API, a client must connect using HTTP protocol to the following address: 
8 1 Adrian Georgescu
9 29 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml
10 19 Adrian Georgescu
11 20 Adrian Georgescu
To be authorized, the client must use a TLS client certificate, this certificate can be retrieved in the Info tab of the web page for the SIP account settings.
12 28 Adrian Georgescu
13 23 Adrian Georgescu
The return is encoded using [http://json.org json].
14 23 Adrian Georgescu
15 22 Adrian Georgescu
== TLS Certificate ==
16 1 Adrian Georgescu
17 13 Adrian Georgescu
Use the web settings page and navigate to the Info tab. Download the TLS certificate in the format supported by your HTTP client. 
18 1 Adrian Georgescu
19 14 Adrian Georgescu
 * !user@domain.crt format can be use by command line tools like curl 
20 14 Adrian Georgescu
 * !user@domain.p12 format can be imported in web browsers
21 5 Adrian Georgescu
22 7 Adrian Georgescu
The .p12 file contains the same certificate stored in a way that can be loaded by web browsers like Safari on MacOSX or Firefox.  To unlock the .p12 file you must use the password for your SIP account.
23 1 Adrian Georgescu
24 1 Adrian Georgescu
== API calls ==
25 1 Adrian Georgescu
26 1 Adrian Georgescu
You can test all API commands by using the '''curl''' command line utility as follows:
27 1 Adrian Georgescu
28 1 Adrian Georgescu
{{{
29 31 Adrian Georgescu
curl -k -E user@domain.crt https://enrollment.sipthor.net/settings.phtml?action=account
30 1 Adrian Georgescu
}}}
31 3 Adrian Georgescu
32 3 Adrian Georgescu
The following actions are supported:
33 1 Adrian Georgescu
34 1 Adrian Georgescu
 1. Return the account information:
35 1 Adrian Georgescu
{{{
36 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_account
37 1 Adrian Georgescu
}}}
38 1 Adrian Georgescu
 1. Return the SIP aliases:
39 1 Adrian Georgescu
{{{
40 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_aliases
41 1 Adrian Georgescu
}}}
42 1 Adrian Georgescu
 1. Return the ENUM numbers:
43 1 Adrian Georgescu
{{{
44 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_enum
45 1 Adrian Georgescu
}}}
46 4 Adrian Georgescu
 1. Return the last incoming and outgoing calls:
47 4 Adrian Georgescu
{{{
48 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_calls
49 4 Adrian Georgescu
}}}
50 30 Adrian Georgescu
 1. Return the list of registered devices
51 30 Adrian Georgescu
{{{
52 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_devices
53 30 Adrian Georgescu
}}}
54 1 Adrian Georgescu
 1. Return the prepaid balance and active prepaid calls:
55 1 Adrian Georgescu
{{{
56 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_prepaid
57 1 Adrian Georgescu
}}}
58 1 Adrian Georgescu
 1. Return the history of prepaid balance:
59 1 Adrian Georgescu
{{{
60 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_balance_history
61 1 Adrian Georgescu
}}}
62 1 Adrian Georgescu
 1. Return the curent monthly usage:
63 1 Adrian Georgescu
{{{
64 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_monthly_usage
65 1 Adrian Georgescu
}}}
66 1 Adrian Georgescu
 1. Return the list of diversions:
67 1 Adrian Georgescu
{{{
68 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_diversions
69 1 Adrian Georgescu
}}}
70 1 Adrian Georgescu
 1. Return the list of accept rules:
71 1 Adrian Georgescu
{{{
72 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_accept
73 1 Adrian Georgescu
}}}
74 1 Adrian Georgescu
 1. Return the list of reject rules:
75 1 Adrian Georgescu
{{{
76 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_reject
77 1 Adrian Georgescu
}}}
78 1 Adrian Georgescu
 1. Return the voicemail settings:
79 1 Adrian Georgescu
{{{
80 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_voicemail
81 1 Adrian Georgescu
}}}
82 9 Adrian Georgescu
 1. Enabled Do Not Disturb
83 9 Adrian Georgescu
{{{
84 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_dnd_on
85 9 Adrian Georgescu
}}}
86 9 Adrian Georgescu
 1. Disable Do Not Disturb
87 9 Adrian Georgescu
{{{
88 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_dnd_off
89 9 Adrian Georgescu
}}}
90 17 Adrian Georgescu
 1. Enable Do Not Disturb for 60 minutes
91 9 Adrian Georgescu
{{{
92 29 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=dnd_on&duration=60
93 9 Adrian Georgescu
}}}
94 10 Adrian Georgescu
 1. Enabled privacy (hide Caller Id for outgoing calls)
95 10 Adrian Georgescu
{{{
96 29 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=privacy_on
97 10 Adrian Georgescu
}}}
98 10 Adrian Georgescu
 1. Disable privacy
99 10 Adrian Georgescu
{{{
100 29 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=privacy_off
101 10 Adrian Georgescu
}}}
102 11 Adrian Georgescu
 1. Add an alias to our own account 
103 11 Adrian Georgescu
{{{
104 29 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=add_alias&username=alice
105 11 Adrian Georgescu
}}}
106 16 Adrian Georgescu
 1. Set diversions
107 16 Adrian Georgescu
{{{
108 29 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_diversions&FUNC=target&FBUS=target&...
109 16 Adrian Georgescu
}}}
110 16 Adrian Georgescu
{{{
111 16 Adrian Georgescu
FUNC = Forward unconditional all calls
112 16 Adrian Georgescu
FBUS = Forward on Busy
113 16 Adrian Georgescu
FNOL = Forward on Not Online
114 16 Adrian Georgescu
FNOA = Forward on No Answer
115 16 Adrian Georgescu
FUNV = Forward when Not Available based on Accept rules
116 25 Adrian Georgescu
117 27 Adrian Georgescu
Pre-defined keywords for diversion targets:
118 26 Adrian Georgescu
119 24 Adrian Georgescu
<voice-mailbox>
120 25 Adrian Georgescu
<mobile-number>
121 25 Adrian Georgescu
122 24 Adrian Georgescu
}}}