SipSettingsApi

Version 35 (Adrian Georgescu, 09/28/2009 10:23 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 35 Adrian Georgescu
 1. Create a new SIP account
27 35 Adrian Georgescu
{{{
28 35 Adrian Georgescu
https://enrollment.sipthor.net/enrollment.phtml?email=user@example.com&password=xyz
29 35 Adrian Georgescu
}}}
30 1 Adrian Georgescu
31 35 Adrian Georgescu
You can test the following API commands by using the '''curl''' command line utility as follows:
32 35 Adrian Georgescu
33 3 Adrian Georgescu
{{{
34 1 Adrian Georgescu
curl -k -E user@domain.crt https://enrollment.sipthor.net/settings.phtml?action=get_account
35 34 Adrian Georgescu
}}}
36 34 Adrian Georgescu
37 34 Adrian Georgescu
The following actions are supported:
38 34 Adrian Georgescu
39 1 Adrian Georgescu
 1. Return the account information:
40 1 Adrian Georgescu
{{{
41 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_account
42 1 Adrian Georgescu
}}}
43 1 Adrian Georgescu
 1. Return the SIP aliases:
44 1 Adrian Georgescu
{{{
45 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_aliases
46 1 Adrian Georgescu
}}}
47 1 Adrian Georgescu
 1. Return the ENUM numbers:
48 1 Adrian Georgescu
{{{
49 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_enum
50 1 Adrian Georgescu
}}}
51 4 Adrian Georgescu
 1. Return the last incoming and outgoing calls:
52 4 Adrian Georgescu
{{{
53 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_calls
54 4 Adrian Georgescu
}}}
55 30 Adrian Georgescu
 1. Return the list of registered devices
56 30 Adrian Georgescu
{{{
57 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_devices
58 30 Adrian Georgescu
}}}
59 1 Adrian Georgescu
 1. Return the prepaid balance and active prepaid calls:
60 1 Adrian Georgescu
{{{
61 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_prepaid
62 1 Adrian Georgescu
}}}
63 1 Adrian Georgescu
 1. Return the history of prepaid balance:
64 1 Adrian Georgescu
{{{
65 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_balance_history
66 1 Adrian Georgescu
}}}
67 1 Adrian Georgescu
 1. Return the curent monthly usage:
68 1 Adrian Georgescu
{{{
69 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_monthly_usage
70 1 Adrian Georgescu
}}}
71 1 Adrian Georgescu
 1. Return the list of diversions:
72 1 Adrian Georgescu
{{{
73 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_diversions
74 1 Adrian Georgescu
}}}
75 1 Adrian Georgescu
 1. Return the list of accept rules:
76 1 Adrian Georgescu
{{{
77 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_accept
78 1 Adrian Georgescu
}}}
79 1 Adrian Georgescu
 1. Return the list of reject rules:
80 1 Adrian Georgescu
{{{
81 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_reject
82 1 Adrian Georgescu
}}}
83 1 Adrian Georgescu
 1. Return the voicemail settings:
84 1 Adrian Georgescu
{{{
85 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=get_voicemail
86 1 Adrian Georgescu
}}}
87 9 Adrian Georgescu
 1. Enabled Do Not Disturb
88 9 Adrian Georgescu
{{{
89 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_dnd_on
90 9 Adrian Georgescu
}}}
91 9 Adrian Georgescu
 1. Disable Do Not Disturb
92 9 Adrian Georgescu
{{{
93 32 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_dnd_off
94 9 Adrian Georgescu
}}}
95 17 Adrian Georgescu
 1. Enable Do Not Disturb for 60 minutes
96 9 Adrian Georgescu
{{{
97 33 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_dnd_on&duration=60
98 9 Adrian Georgescu
}}}
99 10 Adrian Georgescu
 1. Enabled privacy (hide Caller Id for outgoing calls)
100 10 Adrian Georgescu
{{{
101 33 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_privacy_on
102 10 Adrian Georgescu
}}}
103 10 Adrian Georgescu
 1. Disable privacy
104 10 Adrian Georgescu
{{{
105 33 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_privacy_off
106 10 Adrian Georgescu
}}}
107 11 Adrian Georgescu
 1. Add an alias to our own account 
108 11 Adrian Georgescu
{{{
109 29 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=add_alias&username=alice
110 11 Adrian Georgescu
}}}
111 16 Adrian Georgescu
 1. Set diversions
112 16 Adrian Georgescu
{{{
113 29 Adrian Georgescu
https://enrollment.sipthor.net/settings.phtml?action=set_diversions&FUNC=target&FBUS=target&...
114 16 Adrian Georgescu
}}}
115 16 Adrian Georgescu
{{{
116 16 Adrian Georgescu
FUNC = Forward unconditional all calls
117 16 Adrian Georgescu
FBUS = Forward on Busy
118 16 Adrian Georgescu
FNOL = Forward on Not Online
119 16 Adrian Georgescu
FNOA = Forward on No Answer
120 16 Adrian Georgescu
FUNV = Forward when Not Available based on Accept rules
121 25 Adrian Georgescu
122 27 Adrian Georgescu
Pre-defined keywords for diversion targets:
123 26 Adrian Georgescu
124 24 Adrian Georgescu
<voice-mailbox>
125 25 Adrian Georgescu
<mobile-number>
126 25 Adrian Georgescu
127 24 Adrian Georgescu
}}}