SkypeR 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README +20 -0
- data/bin/iskype.rb +29 -62
- data/bin/iskype.rb.back +170 -0
- data/lib/skyper.rb +2 -1
- data/lib/skyper/command.rb +52 -27
- data/lib/skyper/exception.rb +14 -0
- data/lib/skyper/object.rb +454 -8
- data/lib/skyper/parser.rb +13 -4
- data/lib/skyper/response.rb +44 -18
- data/lib/skyper/service.rb +44 -16
- data/lib/skyper/service.rb.back +127 -0
- data/lib/skyper/service.rb.org +181 -0
- data/rails/init.rb +1 -0
- data/tests/test_parser.rb +22 -13
- metadata +17 -9
data/lib/skyper/object.rb
CHANGED
@@ -11,10 +11,93 @@ end
|
|
11
11
|
|
12
12
|
module SkypeR
|
13
13
|
module Object
|
14
|
-
|
14
|
+
|
15
|
+
class Base
|
16
|
+
def update_attributes(attributes)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
=begin
|
20
|
+
USER object
|
21
|
+
|
22
|
+
NB! When you retrieve USER object records with SEARCH USERS command, the user profile data is guaranteed to be accessible with GET USER <user_id> <property_name> commands only until another SEARCH command is executed. The reason for this is that big SEARCH commands can and often trigger Skype's internal garbage collection routine that can clear out the data retreived by previous searches.
|
23
|
+
|
24
|
+
The user object has the following properties:
|
25
|
+
|
26
|
+
* HANDLE - username, for example: USER pamela HANDLE pamela .
|
27
|
+
* FULLNAME - user's full name, for example: USER pamela FULLNAME Jane Doe .
|
28
|
+
* BIRTHDAY - user's birth date in YYYYMMDD format, for example: USER bitman BIRTHDAY 19780329 .
|
29
|
+
* SEX - example: USER pamela SEX UNKNOWN . Values:
|
30
|
+
o UNKNOWN - user has not specified sex in personal profile.
|
31
|
+
o MALE
|
32
|
+
o FEMALE
|
33
|
+
* LANGUAGE - name of language, for example: USER mike LANGUAGE English . In protocol 4 with the ISO 639 prefix, example: USER mike LANGUAGE en English .
|
34
|
+
* COUNTRY - name of country, for example: USER mike COUNTRY Estonia . In protocol 4 with the ISO 3166 prefix, example: USER mike COUNTRY ee Estonia .
|
35
|
+
* PROVINCE - example: USER mike PROVINCE Harjumaa .
|
36
|
+
* CITY - example: USER mike CITY Tallinn .
|
37
|
+
* PHONE_HOME - example: USER mike PHONE_HOME 3721111111 .
|
38
|
+
* PHONE_OFFICE - example: USER mike PHONE_OFFICE 3721111111 .
|
39
|
+
* PHONE_MOBILE - example: USER mike PHONE_MOBILE 3721111111 .
|
40
|
+
* HOMEPAGE - example: USER mike HOMEPAGE http://www.joltid.com .
|
41
|
+
* ABOUT - example: USER mike ABOUT I am a nice person .
|
42
|
+
* HASCALLEQUIPMENT - always returns TRUE . Example: USER pamela HASCALLEQUIPMENT TRUE .
|
43
|
+
* IS_VIDEO_CAPABLE - possible values: True or False
|
44
|
+
* IS_VOICEMAIL_CAPABLE - possible values: True or False
|
45
|
+
* BUDDYSTATUS - example: USER pamela BUDDYSTATUS 2 . Possible BUDDYSTATUS values:
|
46
|
+
o 0 - never been in contact list.
|
47
|
+
o 1 - deleted from contact list. (read-write)
|
48
|
+
o 2 - pending authorisation. (read-write)
|
49
|
+
o 3 - added to contact list.
|
50
|
+
* ISAUTHORIZED - (read-write) is user authorized by current user? Example: USER pamela ISAUTHORIZED TRUE . Values:
|
51
|
+
o TRUE
|
52
|
+
o FALSE
|
53
|
+
* ISBLOCKED - (read-write) is user blocked by current user? Example: USER spammer ISBLOCKED TRUE . Values:
|
54
|
+
o TRUE
|
55
|
+
o FALSE
|
56
|
+
* ONLINESTATUS - user online status, for example: USER mike ONLINESTATUS ONLINE . Possible values:
|
57
|
+
o UNKNOWN - unknown user.
|
58
|
+
o OFFLINE - user is offline (not connected). Will also be returned if current user is not authorized by other user to see his/her online status.
|
59
|
+
o ONLINE - user is online.
|
60
|
+
o AWAY - user is away (has been inactive for certain period).
|
61
|
+
o NA - user is not available.
|
62
|
+
o DND - user is in "Do not disturb" mode.
|
63
|
+
* SkypeOut - user is in the SkypeOut contact list.
|
64
|
+
* SKYPEME (Protocol 2)
|
65
|
+
* LASTONLINETIMESTAMP - UNIX timestamp, available only for offline user. Example USER mike LASTONLINETIMESTAMP 1078959579 .
|
66
|
+
* CAN_LEAVE_VM - is it possible to send voicemail to user? Example: USER test CAN_LEAVE_VM TRUE . Possible values:
|
67
|
+
o TRUE
|
68
|
+
o FALSE
|
69
|
+
* SPEEDDIAL - (read-write) speeddial code assigned to user.
|
70
|
+
* RECEIVEDAUTHREQUEST - text message for authorization request; available only when user asks for authorization.
|
71
|
+
* MOOD_TEXT - mood text for user (mood text is only visible to authorised users; visible in Skype for Windows 2.0).
|
72
|
+
* RICH_MOOD_TEXT - advanced version of user's mood message. See SET PROFILE RICH_MOOD_TEXT command for more information. Introduced in API version 3.0
|
73
|
+
* ALIASES <text> - list of assigned aliases (aliases are only visible as a result of a direct match for alias search).
|
74
|
+
* TIMEZONE <offset> - time offset from GMT in minutes; visible in Skype for Windows 2.0.
|
75
|
+
* IS_CF_ACTIVE - whether the user has Call Forwarding activated or not. Possible values:
|
76
|
+
o TRUE
|
77
|
+
o FALSE
|
78
|
+
* NROF_AUTHED_BUDDIES - Stores the number of authorized contacts in the contact list.
|
79
|
+
|
80
|
+
Most user properties are read-only. The following properties are read-write and can be modified with the SET command:
|
81
|
+
|
82
|
+
* BUDDYSTATUS
|
83
|
+
o 1 - delete from buddylist
|
84
|
+
o 2 - add user into contactlist and ask for authorization: SET USER echo123 BUDDYSTATUS 2 Please authorize me
|
85
|
+
* ISBLOCKED
|
86
|
+
o TRUE - block user
|
87
|
+
o FALSE - unblock user
|
88
|
+
* ISAUTHORIZED
|
89
|
+
o TRUE - authorize user
|
90
|
+
o FALSE - dismiss authorization for user
|
91
|
+
* SPEEDDIAL - speeddial code assigned to user
|
92
|
+
* DISPLAYNAME - By default this property is empty. If a value is assigned to this property with SET <skypename> DISPLAYNAME <value> then that value will be displayed in Skype UI instead of user's FULLNAME.
|
93
|
+
|
94
|
+
=end
|
95
|
+
|
96
|
+
class User < Base
|
15
97
|
attr_accessor :handle, :fullname, :birthday, :sex, :language, :country, :buddystatus, :isauthorized, :isblocked, :onlinestatus, :lastonlinetimestamp, :can_leave_vm
|
16
98
|
def initialize(args={})
|
17
99
|
@handle = args[:handle] if args[:handle]
|
100
|
+
args[:property]
|
18
101
|
@fullname = args[:fullname] if args[:fullname]
|
19
102
|
@birthday = args[:birthday] if args[:birthday]
|
20
103
|
@sex = args[:sex] if args[:sex]
|
@@ -27,9 +110,45 @@ module SkypeR
|
|
27
110
|
@lastonlinetimestamp = args[:lastonlinetimestamp] if args[:lastonlinetimestamp]
|
28
111
|
@can_leave_vm = args[:can_leave_vm] if args[:can_leave_vm]
|
29
112
|
end
|
113
|
+
|
114
|
+
def execute(statement)
|
115
|
+
application = SkypeR::Service::Application.new('test', 'log/iskype.log')
|
116
|
+
command = SkypeR::Service::CommandMessage.new(statement)
|
117
|
+
application.invoke(command)
|
118
|
+
end
|
30
119
|
end
|
31
120
|
|
32
|
-
|
121
|
+
=begin
|
122
|
+
PROFILE object
|
123
|
+
|
124
|
+
Use the GET PROFILE command to retrieve profile information. The PROFILE object has the following properties:
|
125
|
+
|
126
|
+
* PSTN_BALANCE - ( read only ) SkypeOut balance value. Note that the precision of profile balance value is currently fixed at 2 decimal places, regardless of currency or any other settings.
|
127
|
+
* PSTN_BALANCE_CURRENCY - ( read only ) SkypeOut currency value
|
128
|
+
* FULLNAME - text
|
129
|
+
* BIRTHDAY - yyyymmdd, 0 is returned if not set; no partial birthday allowed
|
130
|
+
* SEX - MALE | FEMALE | UNKNOWN
|
131
|
+
* LANGUAGES - [lang[ lang]*] -- lang is a two letter ISO code (en, de, et)
|
132
|
+
* COUNTRY - iso2 name, a two letter ISO code; name - country name
|
133
|
+
* IPCOUNTRY - GeoIP location, country code in two letter ISO format
|
134
|
+
* PROVINCE - text
|
135
|
+
* CITY - text
|
136
|
+
* PHONE_HOME - text
|
137
|
+
* PHONE_OFFICE - text
|
138
|
+
* PHONE_MOBILE - text
|
139
|
+
* HOMEPAGE - text
|
140
|
+
* ABOUT - text
|
141
|
+
* MOOD_TEXT - user's mood message (the plain text version).
|
142
|
+
* RICH_MOOD_TEXT - advanced version of user's mood message. See SET PROFILE RICH_MOOD_TEXT command for more information. Introduced in API version 3.0
|
143
|
+
* TIMEZONE - Offset is given in minutes from GMT.
|
144
|
+
* CALL_APPLY_CF - To enable/disable call forwarding - See Call forwarding
|
145
|
+
* CALL_NOANSWER_TIMEOUT - Time out on call - See Call forwarding
|
146
|
+
* CALL_FORWARD_RULES - See Call forwarding
|
147
|
+
* CALL_SEND_TO_VM - To enable/disable voicemail for forwarded calls - See Call forwarding
|
148
|
+
* SMS_VALIDATED_NUMBERS - A read-only property that contains a comma-separated list of phone numbers the user has registered for usage in reply-to field of SMS messages. See Setting mobile phone number on reply-to field in outgoing SMS messages section for further information.
|
149
|
+
=end
|
150
|
+
|
151
|
+
class Profile < Base
|
33
152
|
attr_accessor :pstn_balance, :fullname, :birthday, :sex, :languages, :timezone
|
34
153
|
def initialize(args={})
|
35
154
|
@pstn_balance = args[:pstn_balance] if args[:pstn_balance]
|
@@ -41,7 +160,105 @@ module SkypeR
|
|
41
160
|
end
|
42
161
|
end
|
43
162
|
|
44
|
-
|
163
|
+
=begin
|
164
|
+
CALL object
|
165
|
+
|
166
|
+
The CALL object has the following properties:
|
167
|
+
|
168
|
+
* TIMESTAMP - time when call was placed (UNIX timestamp), for example CALL 17 TIMESTAMP 1078958218
|
169
|
+
* PARTNER_HANDLE - for example CALL 17 PARTNER_HANDLE mike
|
170
|
+
* PARTNER_DISPNAME - for example CALL 17 PARTNER_DISPNAME Mike Mann
|
171
|
+
* TARGET_IDENTITY - This property is set when you a) have a SkypeIn number and b) receive an incoming PSTN call. The value of call's target identity property is then set to your own SkypeIn number. This property is not set if the incoming call is P2P. This property was introduced in API version 3.1
|
172
|
+
* CONF_ID - if the CONF_ID>0 the call is a conference call, for example: CALL 17 CONF_ID 0
|
173
|
+
* TYPE - call type, for example: CALL 17 TYPE OUTGOING_PSTN . Possible values:
|
174
|
+
o INCOMING_PSTN - incoming call from PSTN
|
175
|
+
o OUTGOING_PSTN - outgoing call to PSTN
|
176
|
+
o INCOMING_P2P - incoming call from P2P
|
177
|
+
o OUTGOING_P2P - outgoing call to P2P
|
178
|
+
* STATUS - call status, for example: CALL 17 STATUS FAILED . Possible values:
|
179
|
+
o UNPLACED - call was never placed
|
180
|
+
o ROUTING - call is currently being routed
|
181
|
+
o EARLYMEDIA - with pstn it is possible that before a call is established, early media is played. For example it can be a calling tone or a waiting message such as all operators are busy.
|
182
|
+
o FAILED - call failed - try to get a FAILUREREASON for more information.
|
183
|
+
o RINGING - currently ringing
|
184
|
+
o INPROGRESS - call is in progress
|
185
|
+
o ONHOLD - call is placed on hold
|
186
|
+
o FINISHED - call is finished
|
187
|
+
o MISSED - call was missed
|
188
|
+
o REFUSED - call was refused
|
189
|
+
o BUSY - destination was busy
|
190
|
+
o CANCELLED (Protocol 2)
|
191
|
+
o TRANSFERRING - Refer to ALTER CALL TRANSFER command. Added in protocol 7 (API version 3.0)
|
192
|
+
o TRANSFERRED - Refer to ALTER CALL TRANSFER command. Added in protocol 7 (API version 3.0)
|
193
|
+
o VM_BUFFERING_GREETING - voicemail greeting is being downloaded
|
194
|
+
o VM_PLAYING_GREETING - voicemail greeting is being played
|
195
|
+
o VM_RECORDING - voicemail is being recorded
|
196
|
+
o VM_UPLOADING - voicemail recording is finished and uploaded into server
|
197
|
+
o VM_SENT - voicemail has successfully been sent
|
198
|
+
o VM_CANCELLED - leaving voicemail has been cancelled
|
199
|
+
o VM_FAILED - leaving voicemail failed; check FAILUREREASON
|
200
|
+
o WAITING_REDIAL_COMMAND - This status is set when your outgoing call to PSTN gets rejected by remote party. This state was added in version 3.5 (protocol 8).
|
201
|
+
o REDIAL_PENDING - This status is set when you press redial button on the Call Phones tab of the Skype interface. This state was added in version 3.5 (protocol 8).
|
202
|
+
* VIDEO_STATUS - possible values:
|
203
|
+
o VIDEO_NONE
|
204
|
+
o VIDEO_SEND_ENABLED
|
205
|
+
o VIDEO_RECV_ENABLED
|
206
|
+
o VIDEO_BOTH_ENABLED
|
207
|
+
* VIDEO_SEND_STATUS and VIDEO_RECEIVE_STATUS - possible values:
|
208
|
+
o NOT_AVAILABLE - the client does not have video capability because video is disabled or a webcam is unplugged).
|
209
|
+
o AVAILABLE - the client is video-capable but the video is not running (can occur during a manual send).
|
210
|
+
o STARTING - the video is sending but is not yet running at full speed.
|
211
|
+
o REJECTED - the receiver rejects the video feed (can occur during a manual receive).
|
212
|
+
o RUNNING - the video is actively running.
|
213
|
+
o STOPPING - the active video is in the process of stopping but has not halted yet.
|
214
|
+
o PAUSED - the video call is placed on hold.
|
215
|
+
* FAILUREREASON - example: CALL 17 FAILUREREASON 1 (numeric).
|
216
|
+
* SUBJECT - not used.
|
217
|
+
* PSTN_NUMBER - example: CALL 17 PSTN_NUMBER 372123123 .
|
218
|
+
* DURATION - example: CALL 17 DURATION 0 .
|
219
|
+
* PSTN_STATUS - error string from gateway, in the case of a PSTN call, for example: CALL 26 PSTN_STATUS 6500 PSTN connection creation timeout .
|
220
|
+
* CONF_PARTICIPANTS_COUNT - number of non-hosts in the case of a conference call. Possible values are:
|
221
|
+
o 0 - call is not a conference. For the host, CONF_PARTICIPANTS_COUNT is always 0.
|
222
|
+
o 1 - call is a former conference.
|
223
|
+
o 2, 3, 4 - call is a conference. Note that from 2.5 and upwards, Skype API manages conference participation in a slightly different manner. In newer versions, after the call is finished, the CONF_PARTICIPANTS_COUNT reports highest number of participants the call had at any given time.
|
224
|
+
* CONF_PARTICIPANT n - the username of the nth participant in a conference call, the call type and status and the displayname of participants who are not the host. For example: CALL 59 CONF_PARTICIPANT 1 echo123 INCOMING_P2P INPROGRESS Echo Test Service .
|
225
|
+
* VM_DURATION
|
226
|
+
* VM_ALLOWED_DURATION - maximum duration in seconds allowed to leave voicemail
|
227
|
+
* RATE – expressed as cost per minute (added in protocol 6).
|
228
|
+
* RATE_CURRENCY - EUR|USD.. This property gets populated from currency selected in Skype account details - PSTN_BALANCE_CURRENCY property of the PROFILE object. However, the value of PSTN_BALANCE_CURRENCY can change in time (added in protocol 6).
|
229
|
+
* RATE_PRECISION – the number of times to divide RATE by 10 to get the full currency unit. For example, a RATE of 1234 with RATE_PRECISION of 2 amounts to 12.34 (added in protocol 6).
|
230
|
+
* INPUT - New in API version 2.6 Refer to Voice Streams section for more information. Can have following values:
|
231
|
+
o SOUNDCARD="default" - default is currently the only acceptable value.
|
232
|
+
o PORT="port_no" - the ID of the audio port (1..65535)
|
233
|
+
o FILE="filename.wav" - the path and name of the audio file.
|
234
|
+
* OUTPUT - can have all the same values as INPUT property. Refer to Voice Streams section for more information. New in API version 2.6
|
235
|
+
* CAPTURE_MIC - can have all the same values as INPUT and OUTPUT properties. Refer to Voice Streams section for more information. New in API version 2.6
|
236
|
+
* VAA_INPUT_STATUS - true|false, indicates if voice input is enabled. New in API version 2.6
|
237
|
+
* FORWARDED_BY - Contains identity of the user who forwarded a call. If the user who forwarded the call could not be identified then this property will be set to "?". New in API version 2.6
|
238
|
+
* TRANSFER_ACTIVE - Refer to ALTER CALL TRANSFER command. Added in protocol 7 (API version 3.0)
|
239
|
+
* TRANSFER_STATUS - Refer to ALTER CALL TRANSFER command. Added in protocol 7 (API version 3.0)
|
240
|
+
* TRANSFERRED_BY - Refer to ALTER CALL TRANSFER command. Added in protocol 7 (API version 3.0)
|
241
|
+
* TRANSFERRED_TO - Refer to ALTER CALL TRANSFER command. Added in protocol 7 (API version 3.0)
|
242
|
+
|
243
|
+
Notes
|
244
|
+
|
245
|
+
* Status values for voicemails ( VM_xxx ) and VM_DURATION/VM_ALLOWED_DURATION apply to calls which are forwarded into voicemail. This feature was introduced in protocol 5.
|
246
|
+
|
247
|
+
Most call properties are read-only. The following properties are read-write and can be modified with the SET command:
|
248
|
+
|
249
|
+
* STATUS - for call control. Possible values:
|
250
|
+
o ONHOLD - hold call
|
251
|
+
o INPROGRESS - answer or resume call
|
252
|
+
o FINISHED - hang up call
|
253
|
+
* SEEN - sets call as seen, so that a missed call is seen and can be removed from the missed calls list.
|
254
|
+
* DTMF - sends VALUE as DTMF. Permitted symbols in VALUE are: {0..9,#,*}.
|
255
|
+
* JOIN_CONFERENCE - joins call with another call into conference. VALUE is the ID of another call.
|
256
|
+
* START_VIDEO_SEND - starts sending video on a call.
|
257
|
+
* STOP_VIDEO_SEND - stops sending video on a call.
|
258
|
+
* START_VIDEO_RECEIVE - starts receiving video on a call.
|
259
|
+
* STOP_VIDEO_RECEIVE - stops receiving video on a call.
|
260
|
+
=end
|
261
|
+
class Call < Base
|
45
262
|
attr_accessor :timestamp, :partner_handle, :partner_dispname, :target_identity, :conf_id, :type, :status, :video_status, :video_send_status, :failurereason, :subject, :pstn_number, :duration, :pstn_status, :conf_participants_count, :conf_participant, :vm_duration, :vm_allowed_duration, :rate, :rate_currency, :rate_precision, :input, :output, :capture_mic, :vaa_input_status, :forwarded_by, :transfer_active, :transfer_status, :transferred_by, :transferred_to
|
46
263
|
|
47
264
|
PROPERTIES = %w{TIMESTAMP PARTNER_HANDLE PARTNER_DISPNAME TARGET_IDENTITY CONF_ID TYPE STATUS VIDEO_STATUS VIDEO_SEND_STATUS FAILUREREASON SUBJECT PSTN_NUMBER DURATION PSTN_STATUS CONF_PARTICIPANTS_COUNT CONF_PARTICIPANT VM_DURATION VM_ALLOWED_DURATION RATE RATE_CURRENCY RATE_PRECISION INPUT OUTPUT CAPTURE_MIC VAA_INPUT_STATUS FORWARDED_BY TRANSFER_ACTIVE TRANSFER_STATUS TRANSFERRED_BY TRANSFERRED_TO}
|
@@ -49,30 +266,259 @@ module SkypeR
|
|
49
266
|
end
|
50
267
|
end
|
51
268
|
|
52
|
-
|
269
|
+
=begin
|
270
|
+
CHAT object
|
271
|
+
|
272
|
+
Version
|
273
|
+
|
274
|
+
* Protocol 3 (updated in protocol 7)
|
275
|
+
|
276
|
+
Properties
|
277
|
+
|
278
|
+
* NAME - chat ID, for example CHAT #test_l/$6a072ce5537c4044 NAME #test_l/$6a072ce5537c4044
|
279
|
+
* TIMESTAMP - time when chat was created, for example CHAT #test_l/$6a072ce5537c4044 TIMESTAMP 1078958218
|
280
|
+
* ADDER - user who added the current user to chat, for example CHAT 1078958218 ADDER k6rberebane
|
281
|
+
* STATUS - chat status, for example CHAT #test_l/$6a072ce5537c4044 STATUS MULTI_SUBSCRIBED . Possible values:
|
282
|
+
o LEGACY_DIALOG - old style IM
|
283
|
+
o DIALOG - 1:1 chat.
|
284
|
+
o MULTI_SUBSCRIBED - participant in chat
|
285
|
+
o UNSUBSCRIBED - left chat
|
286
|
+
* POSTERS - members who have posted messages, for example CHAT #test_l/$6a072ce5537c4044 POSTERS k6rberebane test_3
|
287
|
+
* MEMBERS - all users who have been there, for example CHAT #test_l/$6a072ce5537c4044 MEMBERS k6rberebane test test_2 test_3
|
288
|
+
* TOPIC - chat topic. Example: CHAT #test_l/$6a072ce5537c4044 TOPIC API testimine
|
289
|
+
* TOPICXML - set when a chat topic contains XML formatting elements (topic was changed with ALTER CHAT SETTOPICXML command) This property works in parallel with TOPIC property - when TOPICXML is set, the value is stripped of XML tags and updated in TOPIC.
|
290
|
+
* CHATMESSAGES - all messages IDs in this chat, for example CHAT #test_l/$6a072ce5537c4044 CHATMESSAGES 34, 35, 36, 38, 39
|
291
|
+
* ACTIVEMEMBERS - members who have stayed in chat, for example CHAT #test_l/$6a072ce5537c4044 ACTIVEMEMBERS k6rberebane test_2 test_3
|
292
|
+
* FRIENDLYNAME - name shown in chat window title, for example CHAT #test_l/$6a072ce5537c4044 FRIENDLYNAME Test Test XX | tere ise ka
|
293
|
+
* CHATMESSAGES - list of chatmessage identifiers
|
294
|
+
* RECENTCHATMESSAGES - list of missed/recent chatmessage identifiers
|
295
|
+
* BOOKMARKED - TRUE|FALSE (added in protocol version 6 / Skype API version 2.5)
|
296
|
+
|
297
|
+
Following properties were added to CHAT object in protocol 7 (API version 3.0):
|
298
|
+
|
299
|
+
* MEMBEROBJECTS - contains the list of CHATMEMBER object IDs. Refer to
|
300
|
+
o CHATMEMBER object for list of properties
|
301
|
+
o GET CHATMEMBER command on how to access those properties.
|
302
|
+
o GET CHAT MEMBEROBJECTS command on how to get a list of chatmember object IDs for a given chat.
|
303
|
+
* PASSWORDHINT - contains password hint text for the chat object. Refer to ALTER CHAT SETPASSWORD command on how to set chat passwords.
|
304
|
+
* GUIDELINES - contains chat guidelines text. Refer to ALTER CHAT SETGUIDELINES command on how to set chat guidelines.
|
305
|
+
* OPTIONS - bitmap of chat options. Refer to ALTER CHAT SETOPTIONS command for more information.
|
306
|
+
* DESCRIPTION - currently used only for hidden synchronization channels for managing shared groups.
|
307
|
+
* DIALOG_PARTNER - the handle of the dialog partner for dialog type chats (chats with two participants).
|
308
|
+
* ACTIVITY_TIMESTAMP - the UNIX timestamp of last activity.
|
309
|
+
* TYPE - chat type with following possible values:
|
310
|
+
o LEGACY_DIALOG - no longer supported.
|
311
|
+
o DIALOG - a chat with only two participants.
|
312
|
+
o MULTICHAT - a chat with more than two participants.
|
313
|
+
o SHAREDGROUP - a chat used for synchronization of shared contact groups.
|
314
|
+
o LEGACY_UNSUBSCRIBED - no longer supported.
|
315
|
+
* MYSTATUS - user's current status in chat. Possible values are:
|
316
|
+
o CONNECTING - status set when the system is trying to connect to the chat.
|
317
|
+
o WAITING_REMOTE_ACCEPT - set when a new user joins a public chat. When the chat has "participants need authorization to read messages" option, the MYSTATUS property of a new applicant will remain in this status until he gets accepted or rejected by a chat administrator. Otherwise user's MYSTATUS will automatically change to either LISTENER or USER, depending on public chat options.
|
318
|
+
o ACCEPT_REQUIRED - this status is used for shared contact groups functionality.
|
319
|
+
o PASSWORD_REQUIRED - status set when the system is waiting for user to supply the chat password.
|
320
|
+
o SUBSCRIBED - set when user joins the chat.
|
321
|
+
o UNSUBSCRIBED - set when user leaves the chat or chat ends.
|
322
|
+
o CHAT_DISBANDED - status set when the chat is disbanded.
|
323
|
+
o QUEUED_BECAUSE_CHAT_IS_FULL - currently the maximum number of people in the same chat is 100.
|
324
|
+
o APPLICATION_DENIED - set when public chat administrator has rejected user from joining.
|
325
|
+
o KICKED - status set when the user has been kicked from the chat. Note that it is possible for the user to re-join the chat after being kicked.
|
326
|
+
o BANNED - status set when the user has been banned from the chat.
|
327
|
+
o RETRY_CONNECTING - status set when connect to chat failed and system retries to establish connection.
|
328
|
+
* MYROLE - user's privilege level in chat Refer to CHAT ROLES section for more information.
|
329
|
+
* BLOB - for public chats, this property contains encoded list of chat join-points. Contents of this field is used in public chat URLs.
|
330
|
+
* APPLICANTS - this property contains list of skypenames of people who have applied to join the chat but have not yet been accepted by a public chat administrator. Users only become applicants when the chat has JOINERS_BECOME_APPLICANTS option. Refer to ALTER CHAT SETOPTIONS command for more information.
|
331
|
+
|
332
|
+
=end
|
333
|
+
class Chat < Base
|
334
|
+
attr_accessor :name, :members, :timestamp, :status
|
335
|
+
|
53
336
|
def initialize(args={})
|
54
337
|
@name = args[:name] if args[:name]
|
338
|
+
@members = args[:members] if args[:members]
|
55
339
|
@timestamp = args[:timestamp] if args[:timestamp]
|
56
340
|
@status = args[:status] if args[:status]
|
57
341
|
end
|
342
|
+
|
58
343
|
end
|
59
344
|
|
60
|
-
|
345
|
+
=begin
|
346
|
+
CHATMESSAGE object
|
347
|
+
|
348
|
+
Version
|
349
|
+
|
350
|
+
* Protocol 3. Supersedes the MESSAGE object. Updated in protocol 7. Note that when your application connects to Skype, "PROTOCOL 7" command must be sent to Skype before your client can recognize new message types added in protocol 7. Connecting with default protocol (protocol 1) will cause new message types being reported as UNKNOWN.
|
351
|
+
|
352
|
+
Properties
|
353
|
+
|
354
|
+
* TIMESTAMP - time when message was sent (UNIX timestamp), for example MESSAGE 21 TIMESTAMP 1078958218
|
355
|
+
* PARTNER_HANDLE - NB! This property is deprecated since API version 3.0 and replaced with FROM_HANDLE.
|
356
|
+
* PARTNER_DISPNAME - NB! This property is deprecated since API version 3.0 and replaced with FROM_DISPNAME.
|
357
|
+
* FROM_HANDLE - skypename of the originator of the chatmessage.
|
358
|
+
* FROM_DISPNAME - displayed name of the originator of the chatmessage.
|
359
|
+
* TYPE - message type, for example MESSAGE 21 TYPE TEXT . Possible values:
|
360
|
+
o SETTOPIC - change of chat topic
|
361
|
+
o SAID - IM
|
362
|
+
o ADDEDMEMBERS - invited someone to chat
|
363
|
+
o SAWMEMBERS - chat participant has seen other members
|
364
|
+
o CREATEDCHATWITH - chat to multiple people is created
|
365
|
+
o LEFT - someone left chat; can also be a notification if somebody cannot be added to chat
|
366
|
+
o POSTEDCONTACTS - system message that is sent or received when one user sends contacts to another. Added in protocol 7.
|
367
|
+
o GAP_IN_CHAT - messages of this type are generated locally, during synchronization, when a user enters a chat and it becomes apparent that it is impossible to update user's chat history completely. Chat history is kept only up to maximum of 400 messages or 2 weeks. When a user has been offline past that limit, GAP_IN_CHAT notification is generated. Added in protocol 7.
|
368
|
+
o SETROLE - system messages that are sent when a chat member gets promoted or demoted. Refer to ALTER CHATMEMBER SETROLETO command for more info on how to change chat member roles. Added in protocol 7.
|
369
|
+
o KICKED - system messages that are sent when a chat member gets kicked. Refer to ALTER CHAT KICK command for more information. Added in protocol 7.
|
370
|
+
o KICKBANNED - system messages that are sent when a chat member gets banned. Refer to ALTER CHAT KICKBAN command for more information. Added in protocol 7.
|
371
|
+
o SETOPTIONS - system messages that are sent when chat options are changed. Refer to ALTER CHAT SETOPTIONS command for more information. Added in protocol 7.
|
372
|
+
o SETPICTURE - system messages that are sent when a chat member has changed the public chat topic picture. Added in protocol 7.
|
373
|
+
o SETGUIDELINES - system messages that are sent when chat guidelines are changed. Refer to ALTER CHAT SETGUIDELINES command for more information. Added in protocol 7.
|
374
|
+
o JOINEDASAPPLICANT - notification message that gets sent in a public chat with JOINERS_BECOME_APPLICANTS options, when a new user joins the chat. See ALTER CHAT SETOPTIONS command for more information on chat options. Added in protocol 7.
|
375
|
+
o UNKNOWN - unknown message type, possibly due to connecting to Skype with older protocol.
|
376
|
+
* STATUS - message status, for example MESSAGE 21 STATUS QUEUED . Possible values:
|
377
|
+
o SENDING - message is being sent
|
378
|
+
o SENT - message was sent
|
379
|
+
o RECEIVED - message has been received
|
380
|
+
o READ - message has been read
|
381
|
+
* LEAVEREASON - used with LEFT type message, for example CHATMESSAGE 21 LEAVEREASON UNSUBSCRIBE . Possible values:
|
382
|
+
o USER_NOT_FOUND - user was not found
|
383
|
+
o USER_INCAPABLE - user has an older Skype version and cannot join multichat
|
384
|
+
o ADDER_MUST_BE_FRIEND - recipient accepts messages from contacts only and sender is not in his/her contact list
|
385
|
+
o ADDED_MUST_BE_AUTHORIZED - recipient accepts messages from authorized users only and sender is not authorized
|
386
|
+
o UNSUBSCRIBE - participant left chat
|
387
|
+
* CHATNAME - chat that includes the message, for example #test_3/$b17eb511457e9d20
|
388
|
+
* USERS - people added to chat
|
389
|
+
* IS_EDITABLE - TRUE|FALSE Refer to SET CHATMESSAGE BODY command for more information on how to edit chat message text (BODY) and on what conditions is such editing permitted. This property was introduced in API version 3.0
|
390
|
+
* EDITED_BY - identity of the last user who edited the message. New in API version 3.0
|
391
|
+
* EDITED_TIMESTAMP - UNIX timestamp of the last edit. New in API version 3.0
|
392
|
+
* OPTIONS - numeric field that contains chat options bitmap in system messages that get sent out when a change is made to chat options (messages where TYPE is SETOPTIONS). In normal messages the value of this field is 0. Refer to ALTER CHAT SETOPTIONS command for more information.
|
393
|
+
* ROLE - used in system messages that get sent when a public chat administrator has promoted or demoted a chat member. The TYPE property of such messages is set to SETROLE. In these messages the value of this field is set to the new assigned role of the promoted or demoted chat member. In normal messages the value of this property is set to UNKNOWN. Refer to CHAT ROLES section for a list of different chat roles and ALTER CHATMEMBER SETROLETO command for how chat roles can be changed. New in API version 3.0
|
394
|
+
|
395
|
+
Most chatmessage properties are read-only. The following property is read-write and can be modified with the SET command:
|
396
|
+
|
397
|
+
* SEEN - mark missed chatmessage as seen and removes chat from missed events.
|
398
|
+
* BODY - message text. Note that this property was read-only prior to API version 3.0
|
399
|
+
=end
|
400
|
+
class ChatMessage < Base
|
61
401
|
def initialize(args={})
|
62
402
|
@timestamp = args[:timestamp] if args[:timestamp]
|
63
|
-
@
|
403
|
+
@from_handle = args[:from_handle] if args[:from_handle]
|
404
|
+
@status = args[:from_handle] if args[:status] # SENDING | SENT | RECEIVED | READ
|
405
|
+
@body = args[:from_handle] if args[:body]
|
406
|
+
raise "deprecated" if args[:partner_handle]
|
64
407
|
end
|
65
408
|
end
|
66
409
|
|
67
|
-
|
410
|
+
=begin
|
411
|
+
APPLICATION object
|
412
|
+
|
413
|
+
Properties
|
414
|
+
|
415
|
+
* CONNECTABLE - query connectable users. NB! From API version 3.0, this property enters the deprecation process.
|
416
|
+
|
417
|
+
-> GET APPLICATION appname CONNECTABLE
|
418
|
+
<- APPLICATION appname CONNECTABLE [username[ username]*]
|
419
|
+
|
420
|
+
* CONNECTING - query on-going connection process after the connection is established. Username is removed from CONNECTING list.
|
421
|
+
|
422
|
+
-> GET APPLICATION appname CONNECTING
|
423
|
+
<- APPLICATION appname CONNECTING [username[ username]*]
|
424
|
+
|
425
|
+
* STREAMS - query open streams (connections)
|
426
|
+
|
427
|
+
-> GET APPLICATION appname STREAMS
|
428
|
+
<- APPLICATION appname STREAMS [username:id[ username:id]*]
|
429
|
+
|
430
|
+
* SENDING - query if currently sending any data. After the data is sent, the stream name is removed from the SENDING list
|
431
|
+
|
432
|
+
-> GET APPLICATION appname RECIEVED
|
433
|
+
<- APPLICATION appname SENDING [username:id=bytes [username:id bytes]*]
|
434
|
+
|
435
|
+
* Note: In Skype 1.4x, the number of bytes reported by the SENDING notification following an APPLICATION WRITE is 2 bytes longer than that which was written.
|
436
|
+
|
437
|
+
-> alter application exe write testtest20:1 w
|
438
|
+
<- ALTER APPLICATION exe WRITE testtest20:1
|
439
|
+
<- APPLICATION exe SENDING testtest20:1 3
|
440
|
+
-> alter application exe write testtest20:1 1234567890
|
441
|
+
<- ALTER APPLICATION exe WRITE testtest20:1
|
442
|
+
<- APPLICATION exe SENDING testtest20:1 12
|
443
|
+
|
444
|
+
* RECEIVED - query if there is data waiting in received buffer. After the data is read from the stream, the stream name is removed from the RECEIVED list.
|
445
|
+
|
446
|
+
-> GET APPLICATION appname RECEIVED
|
447
|
+
<- APPLICATION appname SENDING [username:id=bytes [username:id bytes]*]
|
448
|
+
|
449
|
+
* incoming datagram notification
|
450
|
+
|
451
|
+
<- APPLICATION appname DATAGRAM user:id text
|
452
|
+
|
453
|
+
Version
|
454
|
+
|
455
|
+
* Protocol 5
|
456
|
+
* Skype for Windows 1.4
|
457
|
+
=end
|
458
|
+
|
459
|
+
class Application < Base
|
68
460
|
def initialize(args={})
|
69
461
|
@connectable = args[:connectable] if args[:connectable]
|
70
462
|
@streams = args[:streams] if args[:streams]
|
71
463
|
@sending = args[:sending] if args[:sending]
|
72
464
|
end
|
73
465
|
end
|
466
|
+
=begin
|
467
|
+
VOICEMAIL object
|
468
|
+
|
469
|
+
Version
|
470
|
+
|
471
|
+
* Protocol 5
|
472
|
+
|
473
|
+
Properties
|
474
|
+
|
475
|
+
* TYPE - type of voicemail object
|
476
|
+
o INCOMING - voicemail received from partner
|
477
|
+
o OUTGOING - voicemail sent to partner
|
478
|
+
o DEFAULT_GREETING - Skype default greeting from partner
|
479
|
+
o CUSTOM_GREETING - partner's recorded custom greeting
|
480
|
+
o UNKNOWN
|
481
|
+
* PARTNER_HANDLE - username for voicemail sender (for incoming) or recipient (for outgoing)
|
482
|
+
* PARTNER_DISPNAME - user displayname for partner
|
483
|
+
* STATUS - current status of voicemail object
|
484
|
+
o NOTDOWNLOADED - voicemail is stored on server (has not been downloaded yet)
|
485
|
+
o DOWNLOADING - downloading from server to local machine
|
486
|
+
o UNPLAYED - voicemail has been downloaded but not played back yet
|
487
|
+
o BUFFERING - buffering for playback
|
488
|
+
o PLAYING - currently played back
|
489
|
+
o PLAYED - voicemail has been played back
|
490
|
+
o BLANK - intermediate status when new object is created but recording has not begun
|
491
|
+
o RECORDING - voicemail currently being recorded
|
492
|
+
o RECORDED - voicemail recorded but not yet uploaded to the server
|
493
|
+
o UPLOADING - voicemail object is currently being uploaded to server
|
494
|
+
o UPLOADED - upload to server finished but not yet deleted; object is also locally stored
|
495
|
+
o DELETING - pending delete
|
496
|
+
o FAILED - downloading voicemail/greeting failed
|
497
|
+
o UNKNOWN
|
498
|
+
* FAILUREREASON possible values
|
499
|
+
o MISC_ERROR
|
500
|
+
o CONNECT_ERROR
|
501
|
+
o NO_VOICEMAIL_PRIVILEGE
|
502
|
+
o NO_SUCH_VOICEMAIL
|
503
|
+
o FILE_READ_ERROR
|
504
|
+
o FILE_WRITE_ERROR
|
505
|
+
o RECORDING_ERROR
|
506
|
+
o PLAYBACK_ERROR
|
507
|
+
o UNKNOWN
|
508
|
+
* SUBJECT - not used
|
509
|
+
* TIMESTAMP
|
510
|
+
* DURATION - actual voicemail duration in seconds
|
511
|
+
* ALLOWED_DURATION - maximum voicemail duration in seconds allowed to leave to partner
|
512
|
+
* INPUT - New in API version 3.5.0.202 Can have following values:
|
513
|
+
o SOUNDCARD="default" - default is currently the only acceptable value.
|
514
|
+
o PORT="port_no" - the ID of the audio port (1..65535)
|
515
|
+
o FILE="filename.wav" - the path and name of the audio file.
|
516
|
+
* OUTPUT - can have all the same values as INPUT property. New in API version 3.5.0.202
|
517
|
+
* CAPTURE_MIC - can have all the same values as INPUT and OUTPUT properties. New in API version 3.5.0.202
|
518
|
+
|
519
|
+
=end
|
74
520
|
|
75
|
-
class VoiceMail
|
521
|
+
class VoiceMail < Base
|
76
522
|
end
|
77
523
|
|
78
524
|
end
|