Wiki source code of Status TCP Interface

Last modified by michaely on 2021/09/10 22:35

Show last authors
1 = Description =
2
3 The iSymphony Status Interface allows users to query, set, and receive notices on extension user statuses, notes, and return times.
4
5 = Connecting =
6
7 To connect to the Status Interface simply make a TCP socket connection to port 50002 from an application or telnet.
8 The port can be configured in /opt/isymphony/server/config/extensions.xml by modifying the <StatusPort> tag.
9 Note that a port modification will not take effect until the iSymphony server process has been restarted.
10 The change will not take effect on application level reloads. All connections to the status interface will
11 remain open until the connection is closed by the connected client or the iSymphony server process has been stopped.
12 In versions 2.1.0 and lower connections can only be made from the machine that is running the iSymphony server process. The status port is bound to localhost for security.
13
14 = Special Identifiers =
15
16 Several special identifiers are sent and received by the Status Interface. It is crucial that these
17 identifiers are understood in order to work with the interface properly.
18
19 -Delimiter
20 Many strings that the Status Interface deals with(i.e. location, tenant, extension, and status names)can
21 contain and number of allowable Unicode characters, so the interface utilizes an uncommon delimiter "@#" to separate
22 attributes in commands and events. It is crucial that you do not utilize this delimiter in any location
23 name, tenant name, extension number, status name or note if you are using the Status Interface.
24
25 -New Line
26 Extension status notes can contain new lines. Since the Status Interface uses new lines to determine
27 the end of a command or the end of an event you must utilize the identifier "#masknl#" to include new
28 lines in the set_extension_note command if you would like newlines to be included in the note.
29 Any event or command reply will contain this identifier as well if reporting on a note that contains new lines.
30
31 = Errors =
32
33 Any command can throw an error. If an error occurs when running a command an error message will be
34 returned with a prefix of "Error:" instead of the normal return value and will be followed by a string
35 specifying the details of the error that was thrown.
36
37 = Commands =
38
39 Commands are used to query or set statuses, notes, and return times
40
41 get_extension_state~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
42 Description: Queries all extension statuses, notes, and return times for all extensions in the system. Note extensions with no return time set will have a value of "0" for <return time>.
43 Usage: get_extension_state
44 Returns: a list of all current set statuses, notes and return times for all extensions in the system grouped by location and tenant.
45 Return Structure:
46
47 State Report Started
48 Location@#<location name>
49 Tenant@#<tenant name>
50 Extension@#<extension number>@#<status name>@#<note>@#<return time>
51 Extension@#<extension number>@#<status name>@#<note>@#<return time>
52 Tenant@#<tenant name>
53 Extension@#<extension number>@#<status name>@#<note>@#<return time>
54 Location@#<location name>
55 Tenant@#<tenant name>
56 Extension@#<extension number>@#<status name>@#<note>@#<return time>
57 Extension@#<extension number>@#<status name>@#<note>@#<return time>
58 Extension@#<extension number>@#<status name>@#<note>@#<return time>
59 Extension@#<extension number>@#<status name>@#<note>@#<return time>
60 State Report Finished
61
62 <location name> = name of location currently reporting on.
63 <tenant name> = name of tenant currently reporting on in current location.
64 <extension number> = extension number currently reporting on in current tenant.
65 <status name> = name of currently set status.
66 <note> = note currently set.
67 <return time> = return time currently set. Represented as a Unix time stamp in number of seconds since the Unix epoch.
68 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
69
70 get_statuses~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
71 Description: Queries all configured statuses in the system.
72 Usage: get_statuses
73 Returns: a list of all configured user statuses in the system grouped by location and tenant.
74 Return Structure:
75
76 Status Report Started
77 Location@#<location name>
78 Tenant@#<tenant name>
79 Status@#<status name>
80 Status@#<status name>
81 Tenant@#<tenant name>
82 Status@<status name>
83 Location@#<location name>
84 Tenant@#<tenant name>
85 Status@<status name>
86 Status@<status name>
87 Status@<status name>
88 Status Report Finished
89
90 <location name> = name of location currently reporting on
91 <tenant name> = name of tenant currently reporting on in current location.
92 <status name> = name of status in current tenant.
93 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
94
95 get_extension_status~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
96 Description: Queries the status of a given extension.
97 Usage: get_extension_status@#<location name>@#<tenant name>@#<extension number>
98 Returns: The currently set status for the specified extension.
99 Return Structure: ExtensionStatus@#<status name>
100 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
101
102 get_extension_note~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
103 Description: Queries the note of a given extension.
104 Usage: get_extension_note@#<location name>@#<tenant name>@#<extension number>
105 Returns: The currently set note for the specified extension.
106 Return Structure: ExtensionNote@#<note>
107 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
108
109 get_extension_return_time~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
110 Description: Queries the return time of a given extension. Note extensions with no return time set will have a value of "0" for <return time>.
111 Usage: get_extension_return_time@#<location name>@#<tenant name>@#<extension number>
112 Returns: The currently set return time for the specified extension. Represented as a Unix time stamp in number of seconds since the Unix epoch.
113 Return Structure: ExtensionReturnTime@#<return time>
114 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
115
116 set_extension_status~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
117 Description: Sets the status of a given extension.
118 Usage: set_extension_status@#<location name>@#<tenant name>@#<extension number>@#<status name>
119 Returns: new line
120 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
121
122 set_extension_note~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
123 Description: Sets the note of a given extension.
124 Usage: set_extension_note@#<location name>@#<tenant name>@#<extension number>@#<note>
125 Returns: new line
126 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
127
128 set_extension_return_time~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
129 Description: Sets the return time of a given extension. <return time> is represented as a Unix time stamp in number of seconds since the Unix epoch. To have no return time set specify "0" as <return time>.
130 Usage: set_extension_return_time@#<location name>@#<tenant name>@#<extension number>@#<return time>
131 Returns: new line
132 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
133
134 exit~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
135 Description: Closes the Status Interface connection.
136 Usage: exit
137 Returns: nothing
138 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
139
140 Events:
141 Events specify notifications of changes made to an extension's status, note, and return time as well as additions, removals, and name modifications of locations, tenants, extensions, and statuses so that users can keep the client side model current.
142
143 ExtensionStatusUpdatedEvent~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
144 Description: Notification of an extension's status changing.
145 Structure: ExtensionStatusUpdatedEvent@#<location name>@#<tenant name>@#<extension number>@#<status name>
146 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
147
148 ExtensionNoteUpdatedEvent~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
149 Description: Notification of an extension's note changing.
150 Structure: ExtensionNoteUpdatedEvent@#<location name>@#<tenant name>@#<extension number>@#<note>
151 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
152
153 ExtensionReturnTimeUpdatedEvent~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
154 Description: Notification of an extension's return time changing. Represented as a Unix time stamp in number of seconds since the Unix epoch.
155 Structure: ExtensionReturnTimeUpdatedEvent@#<location name>@#<tenant name>@#<extension number>@#<return time>
156 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
157
158 StatusAddedEvent~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
159 Description: Notification of a new status being added to the system.
160 Structure: StatusAddedEvent@#<location name>@#<tenant name>@#<status name>
161 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
162
163 StatusRemovedEvent~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
164 Description: Notification of a status being removed from the system.
165 Structure: StatusRemovedEvent@#<location name>@#<tenant name>@#<status name>
166 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
167
168 StatusRenameEvent~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
169 Description: Notification of a status being renamed.
170 Structure: StatusRenameEvent@#<location name>@#<tenant name>@#<old status name>@#<new status name>
171 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
172
173 LocationAddedEvent~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
174 Description: Notification of a new location being added to the system.
175 Structure: LocationAddedEvent@#<location name>
176 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
177
178 LocationRemovedEvent~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
179 Description: Notification of a location being removed from the system.
180 Structure: LocationRemovedEvent@#<location name>
181 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
182
183 LocationRenamedEvent~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
184 Description: Notification of a location being renamed.
185 Structure: LocationRenamedEvent@#<old location name>@#<new location name>
186 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
187
188 TenantAddedEvent~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
189 Description: Notification of a new tenant being added to the system.
190 Structure: TenantAddedEvent@#<location name>@#<tenant name>
191 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
192
193 TenantRemovedEvent~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
194 Description: Notification of a tenant being removed from the system.
195 Structure: TenantRemovedEvent@#<location name>@#<tenant name>
196 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
197
198 TenantRenamedEvent~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
199 Description: Notification of a tenant being renamed.
200 Structure: TenantRenamedEvent@#<location name>@#<old tenant name>@#<new tenant name>
201 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
202
203 ExtensionAddedEvent~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
204 Description: Notification of a new extension being added to the system. Note that a new extension will not fire any status events except for this one. Extensions added to the system will default to "Available" status, a blank note, and "0" for return time.
205 Structure: ExtensionAddedEvent@#<location name>@#<tenant name>@#<extension name>
206 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
207
208 ExtensionRemovedEvent~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
209 Description: Notification of a extension being removed from the system.
210 Structure: ExtensionRemovedEvent@#<location name>@#<tenant name>@#<extension name>
211 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
212
213 ExtensionRenamedEvent~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
214 Description: Notification of a extension being re-numbered.
215 Structure: ExtensionRenamedEvent@#<location name>@#<tenant name>@#<old extension number>@#<new extension number>
216 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--
iSymphony