|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 */ |
|
16 #include "HtiMessagesH.h" |
|
17 #include "HtiPlugin.h" |
|
18 #include "HtiSoapHandlerInterface.h" |
|
19 |
|
20 //********************************************************************************** |
|
21 // CONSTANTS |
|
22 // |
|
23 //********************************************************************************** |
|
24 |
|
25 // commands |
|
26 const unsigned char CMD_ADD_SMS_TO_INDOX = 0x01; |
|
27 const unsigned char CMD_ADD_MMS_TO_INDOX = 0x02; |
|
28 const unsigned char CMD_ADD_EMAIL = 0x03; |
|
29 const unsigned char CMD_ADD_IR_MESSAGE = 0x04; |
|
30 const unsigned char CMD_ADD_BT_MESSAGE = 0x05; |
|
31 const unsigned char CMD_ADD_SMART_MESSAGE = 0x06; |
|
32 const unsigned char CMD_ADD_AUDIO_MESSAGE = 0x07; |
|
33 const unsigned char CMD_DELETE_MESSAGE = 0x10; |
|
34 const unsigned char CMD_DELETE_ALL_FROM_FOLDER = 0x11; |
|
35 const unsigned char CMD_CREATE_MAILBOX = 0x20; |
|
36 const unsigned char CMD_DELETE_MAILBOX = 0x21; |
|
37 const unsigned char CMD_CREATE_ACCESS_POINT = 0x30; |
|
38 const unsigned char CMD_DELETE_ACCESS_POINT = 0x31; |
|
39 const unsigned char CMD_CREATE_DESTINATION = 0x32; |
|
40 const unsigned char CMD_DELETE_DESTINATION = 0x33; |
|
41 const unsigned char CMD_ADD_TO_DESTINATION = 0x34; |
|
42 const unsigned char CMD_REMOVE_FROM_DESTINATION = 0x35; |
|
43 const unsigned char CMD_SET_DEFAULT_SMS_CENTER = 0x40; |
|
44 const unsigned char CMD_DELETE_SMS_CENTER = 0x41; |
|
45 const unsigned char CMD_SET_SMS_SETTINGS = 0x42; |
|
46 const unsigned char CMD_SET_MMS_SETTINGS = 0x45; |
|
47 |
|
48 |
|
49 //********************************************************************************** |
|
50 // SOAP FUNCTIONS |
|
51 // |
|
52 //********************************************************************************** |
|
53 |
|
54 //********************************************************************************** |
|
55 // ns1__addSMS |
|
56 //********************************************************************************** |
|
57 int ns1__addSMS(struct soap* soap, |
|
58 char *fromField, |
|
59 char *description, |
|
60 char *messageBody, |
|
61 bool isNewFlag, |
|
62 bool isUnreadFlag, |
|
63 enum ns1__folder folder, |
|
64 int &messageId) |
|
65 { |
|
66 HtiMsgHelper msg( soap, HTI_UID, CMD_ADD_SMS_TO_INDOX ); |
|
67 msg.AddStringWithLengthByteZero( fromField ); |
|
68 msg.AddStringWithLengthByteZero( description ); |
|
69 msg.AddStringWithLengthWordZero( messageBody ); |
|
70 msg.AddByte( isNewFlag ); |
|
71 msg.AddByte( isUnreadFlag ); |
|
72 msg.AddByte( folder ); |
|
73 if ( msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ) ) |
|
74 return SOAP_FAULT; |
|
75 |
|
76 if ( msg.CheckMsgExactLen( 5 ) ) |
|
77 return SOAP_FAULT; |
|
78 |
|
79 messageId = msg.GetInt( 1 ); |
|
80 |
|
81 return SOAP_OK; |
|
82 } |
|
83 |
|
84 //********************************************************************************** |
|
85 // ns1__addMMS |
|
86 //********************************************************************************** |
|
87 int ns1__addMMS(struct soap* soap, |
|
88 char *fromField, |
|
89 char *description, |
|
90 char *messageBody, |
|
91 char *attachmentPath, |
|
92 bool isNewFlag, |
|
93 bool isUnreadFlag, |
|
94 enum ns1__folder folder, |
|
95 int &messageId) |
|
96 { |
|
97 HtiMsgHelper msg( soap, HTI_UID, CMD_ADD_MMS_TO_INDOX ); |
|
98 msg.AddStringWithLengthByteZero( fromField ); |
|
99 msg.AddStringWithLengthByteZero( description ); |
|
100 msg.AddStringWithLengthWordZero( messageBody ); |
|
101 msg.AddStringWithLengthByteZero( attachmentPath ); |
|
102 msg.AddByte( isNewFlag ); |
|
103 msg.AddByte( isUnreadFlag ); |
|
104 msg.AddByte( folder ); |
|
105 if ( msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ) ) |
|
106 return SOAP_FAULT; |
|
107 |
|
108 if ( msg.CheckMsgExactLen( 5 ) ) |
|
109 return SOAP_FAULT; |
|
110 |
|
111 messageId = msg.GetInt( 1 ); |
|
112 |
|
113 return SOAP_OK; |
|
114 } |
|
115 |
|
116 //********************************************************************************** |
|
117 // ns1__addEMail |
|
118 //********************************************************************************** |
|
119 int ns1__addEMail(struct soap* soap, |
|
120 char *fromField, |
|
121 char *description, |
|
122 char *messageBody, |
|
123 char *attachmentPath, |
|
124 bool isNewFlag, |
|
125 bool isUnreadFlag, |
|
126 enum ns1__folder folder, |
|
127 int &messageId) |
|
128 { |
|
129 HtiMsgHelper msg( soap, HTI_UID, CMD_ADD_EMAIL ); |
|
130 msg.AddStringWithLengthByteZero( fromField ); |
|
131 msg.AddStringWithLengthByteZero( description ); |
|
132 msg.AddStringWithLengthWordZero( messageBody ); |
|
133 msg.AddStringWithLengthByteZero( attachmentPath ); |
|
134 msg.AddByte( isNewFlag ); |
|
135 msg.AddByte( isUnreadFlag ); |
|
136 msg.AddByte( folder ); |
|
137 if ( msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ) ) |
|
138 return SOAP_FAULT; |
|
139 |
|
140 if ( msg.CheckMsgExactLen( 5 ) ) |
|
141 return SOAP_FAULT; |
|
142 |
|
143 messageId = msg.GetInt( 1 ); |
|
144 |
|
145 return SOAP_OK; |
|
146 } |
|
147 |
|
148 //********************************************************************************** |
|
149 // ns1__addIRMessage |
|
150 //********************************************************************************** |
|
151 int ns1__addIRMessage(struct soap* soap, |
|
152 char *fromField, |
|
153 char *description, |
|
154 char *attachmentPath, |
|
155 bool isNewFlag, |
|
156 bool isUnreadFlag, |
|
157 enum ns1__folder folder, |
|
158 int &messageId) |
|
159 { |
|
160 HtiMsgHelper msg( soap, HTI_UID, CMD_ADD_IR_MESSAGE ); |
|
161 msg.AddStringWithLengthByteZero( fromField ); |
|
162 msg.AddStringWithLengthByteZero( description ); |
|
163 msg.AddStringWithLengthByteZero( attachmentPath ); |
|
164 msg.AddByte( isNewFlag ); |
|
165 msg.AddByte( isUnreadFlag ); |
|
166 msg.AddByte( folder ); |
|
167 if ( msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ) ) |
|
168 return SOAP_FAULT; |
|
169 |
|
170 if ( msg.CheckMsgExactLen( 5 ) ) |
|
171 return SOAP_FAULT; |
|
172 |
|
173 messageId = msg.GetInt( 1 ); |
|
174 |
|
175 return SOAP_OK; |
|
176 } |
|
177 |
|
178 //********************************************************************************** |
|
179 // ns1__addBTMessage |
|
180 //********************************************************************************** |
|
181 int ns1__addBTMessage(struct soap* soap, |
|
182 char *fromField, |
|
183 char *description, |
|
184 char *attachmentPath, |
|
185 bool isNewFlag, |
|
186 bool isUnreadFlag, |
|
187 enum ns1__folder folder, |
|
188 int &messageId) |
|
189 { |
|
190 HtiMsgHelper msg( soap, HTI_UID, CMD_ADD_BT_MESSAGE ); |
|
191 msg.AddStringWithLengthByteZero( fromField ); |
|
192 msg.AddStringWithLengthByteZero( description ); |
|
193 msg.AddStringWithLengthByteZero( attachmentPath ); |
|
194 msg.AddByte( isNewFlag ); |
|
195 msg.AddByte( isUnreadFlag ); |
|
196 msg.AddByte( folder ); |
|
197 if ( msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ) ) |
|
198 return SOAP_FAULT; |
|
199 |
|
200 if ( msg.CheckMsgExactLen( 5 ) ) |
|
201 return SOAP_FAULT; |
|
202 |
|
203 messageId = msg.GetInt( 1 ); |
|
204 |
|
205 return SOAP_OK; |
|
206 } |
|
207 |
|
208 //********************************************************************************** |
|
209 // ns1__addSmartMessage |
|
210 //********************************************************************************** |
|
211 int ns1__addSmartMessage(struct soap* soap, |
|
212 char *fromField, |
|
213 char *description, |
|
214 char *messageBody, |
|
215 bool isNewFlag, |
|
216 bool isUnreadFlag, |
|
217 enum ns1__folder folder, |
|
218 int BIOmessageType, |
|
219 int &messageId) |
|
220 { |
|
221 HtiMsgHelper msg( soap, HTI_UID, CMD_ADD_SMART_MESSAGE ); |
|
222 msg.AddStringWithLengthByteZero( fromField ); |
|
223 msg.AddStringWithLengthByteZero( description ); |
|
224 msg.AddStringWithLengthWordZero( messageBody ); |
|
225 msg.AddByte( isNewFlag ); |
|
226 msg.AddByte( isUnreadFlag ); |
|
227 msg.AddByte( folder ); |
|
228 msg.AddInt( BIOmessageType ); |
|
229 if ( msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ) ) |
|
230 return SOAP_FAULT; |
|
231 |
|
232 if ( msg.CheckMsgExactLen( 5 ) ) |
|
233 return SOAP_FAULT; |
|
234 |
|
235 messageId = msg.GetInt( 1 ); |
|
236 |
|
237 return SOAP_OK; |
|
238 } |
|
239 |
|
240 //********************************************************************************** |
|
241 // ns1__addAudioMessage |
|
242 //********************************************************************************** |
|
243 int ns1__addAudioMessage(struct soap* soap, |
|
244 char *fromField, |
|
245 char *description, |
|
246 char *attachmentPath, |
|
247 bool isNewFlag, |
|
248 bool isUnreadFlag, |
|
249 enum ns1__folder folder, |
|
250 int &messageId) |
|
251 { |
|
252 if ( check_mandatory_string_parameter( soap, attachmentPath, "attachmentPath" ) ) |
|
253 return SOAP_FAULT; |
|
254 |
|
255 HtiMsgHelper msg( soap, HTI_UID, CMD_ADD_AUDIO_MESSAGE ); |
|
256 msg.AddStringWithLengthByteZero( fromField ); |
|
257 msg.AddStringWithLengthByteZero( description ); |
|
258 msg.AddStringWithLengthByteZero( attachmentPath ); |
|
259 msg.AddByte( isNewFlag ); |
|
260 msg.AddByte( isUnreadFlag ); |
|
261 msg.AddByte( folder ); |
|
262 if ( msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ) ) |
|
263 return SOAP_FAULT; |
|
264 |
|
265 if ( msg.CheckMsgExactLen( 5 ) ) |
|
266 return SOAP_FAULT; |
|
267 |
|
268 messageId = msg.GetInt( 1 ); |
|
269 |
|
270 return SOAP_OK; |
|
271 } |
|
272 |
|
273 //********************************************************************************** |
|
274 // ns1__deleteMessage |
|
275 //********************************************************************************** |
|
276 int ns1__deleteMessage(struct soap* soap, |
|
277 int messageId, |
|
278 struct ns1__deleteMessageResponse *out) |
|
279 { |
|
280 HtiMsgHelper msg( soap, HTI_UID, CMD_DELETE_MESSAGE ); |
|
281 msg.AddInt( messageId ); |
|
282 return msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ); |
|
283 } |
|
284 |
|
285 //********************************************************************************** |
|
286 // ns1__deleteMessage |
|
287 //********************************************************************************** |
|
288 int ns1__deleteAllFromFolder(struct soap* soap, |
|
289 enum ns1__messageType type, |
|
290 enum ns1__folder folder, |
|
291 struct ns1__deleteAllFromFolderResponse *out) |
|
292 { |
|
293 HtiMsgHelper msg( soap, HTI_UID, CMD_DELETE_ALL_FROM_FOLDER ); |
|
294 msg.AddByte( folder ); |
|
295 msg.AddByte( type ); |
|
296 return msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ); |
|
297 } |
|
298 |
|
299 //********************************************************************************** |
|
300 // ns1__createAccessPoint |
|
301 //********************************************************************************** |
|
302 int ns1__createAccessPoint(struct soap* soap, |
|
303 enum ns1__bearerType bearer, |
|
304 char *apName, |
|
305 struct ArrayOfHtiAPSettingFields APSettings, |
|
306 int &entryId) |
|
307 { |
|
308 if ( check_mandatory_string_parameter( soap, apName, "apName" ) ) |
|
309 return SOAP_FAULT; |
|
310 |
|
311 HtiMsgHelper msg( soap, HTI_UID, CMD_CREATE_ACCESS_POINT ); |
|
312 msg.AddByte( bearer ); |
|
313 msg.AddStringWithLengthByte( apName ); |
|
314 msg.AddByte( (BYTE) APSettings.__size ); |
|
315 |
|
316 // Loop through setting fields |
|
317 for ( int i = 0; i < APSettings.__size; i++ ) |
|
318 { |
|
319 msg.AddByte( APSettings.__ptrHtiAPSettingField[i].fieldType ); |
|
320 |
|
321 // fieldData cannot be empty |
|
322 if ( check_mandatory_string_parameter( soap, |
|
323 APSettings.__ptrHtiAPSettingField[i].fieldData, |
|
324 "HtiAPSettingField.fieldData" ) ) |
|
325 return SOAP_FAULT; |
|
326 |
|
327 msg.AddStringWithLengthByte( APSettings.__ptrHtiAPSettingField[i].fieldData ); |
|
328 } |
|
329 |
|
330 if ( msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ) ) |
|
331 return SOAP_FAULT; |
|
332 |
|
333 if ( msg.CheckCommandCode( 0xFF ) || msg.CheckMsgExactLen( 5 ) ) |
|
334 return SOAP_FAULT; |
|
335 |
|
336 entryId = msg.GetInt( 1 ); |
|
337 |
|
338 return SOAP_OK; |
|
339 } |
|
340 |
|
341 //********************************************************************************** |
|
342 // ns1__deleteAccessPoint |
|
343 //********************************************************************************** |
|
344 int ns1__deleteAccessPoint(struct soap* soap, |
|
345 char *apName, |
|
346 struct ns1__deleteAccessPointResponse *out) |
|
347 { |
|
348 if ( check_mandatory_string_parameter( soap, apName, "apName" ) ) |
|
349 return SOAP_FAULT; |
|
350 |
|
351 HtiMsgHelper msg( soap, HTI_UID, CMD_DELETE_ACCESS_POINT ); |
|
352 msg.AddStringWithLengthByte( apName ); |
|
353 return msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ); |
|
354 } |
|
355 |
|
356 //********************************************************************************** |
|
357 // ns1__createMailbox |
|
358 //********************************************************************************** |
|
359 int ns1__createMailbox(struct soap* soap, |
|
360 enum ns1__mailboxType mailboxType, |
|
361 char *mailboxName, |
|
362 char *incomingServer, |
|
363 char *incomingAccessPoint, |
|
364 char *incomingUsername, |
|
365 char *incomingPassword, |
|
366 enum ns1__securitySetting incomingSecurity, |
|
367 unsigned short incomingPort, |
|
368 bool aPopSecureLogin, |
|
369 char *outgoingServer, |
|
370 char *outgoingAccessPoint, |
|
371 char *outgoingUsername, |
|
372 char *outgoingPassword, |
|
373 enum ns1__securitySetting outgoingSecurity, |
|
374 unsigned short outgoingPort, |
|
375 char *ownMailAddress, |
|
376 char *ownName, |
|
377 enum ns1__sendOption sendOption, |
|
378 enum ns1__copyToOwn copyToOwnAddress, |
|
379 char *signatureText, |
|
380 bool newMailIndicators, |
|
381 enum ns1__retrievedParts retrievedParts, |
|
382 unsigned short retrieveSizeLimit, |
|
383 unsigned short emailsToRetrieve, |
|
384 char *imap4FolderPath, |
|
385 enum ns1__automaticUpdate automaticUpdate, |
|
386 bool setAsDefault, |
|
387 struct ns1__createMailboxResponse *out) |
|
388 { |
|
389 // Check for mandatory stuff |
|
390 if ( check_mandatory_string_parameter( soap, mailboxName, "mailboxName" ) ) |
|
391 return SOAP_FAULT; |
|
392 |
|
393 if ( check_mandatory_string_parameter( soap, incomingServer, "incomingServer" ) ) |
|
394 return SOAP_FAULT; |
|
395 |
|
396 if ( check_mandatory_string_parameter( soap, outgoingServer, "outgoingServer" ) ) |
|
397 return SOAP_FAULT; |
|
398 |
|
399 if ( check_mandatory_string_parameter( soap, ownMailAddress, "ownMailAddress" ) ) |
|
400 return SOAP_FAULT; |
|
401 |
|
402 HtiMsgHelper msg( soap, HTI_UID, CMD_CREATE_MAILBOX ); |
|
403 msg.AddByte( mailboxType ); |
|
404 msg.AddStringWithLengthByte( mailboxName ); |
|
405 msg.AddStringWithLengthByte( incomingServer ); |
|
406 msg.AddStringWithLengthByteZero( incomingAccessPoint ); |
|
407 msg.AddStringWithLengthByteZero( incomingUsername ); |
|
408 msg.AddStringWithLengthByteZero( incomingPassword ); |
|
409 msg.AddByte( incomingSecurity ); |
|
410 msg.AddWord( incomingPort ); |
|
411 msg.AddByte( aPopSecureLogin ); |
|
412 msg.AddStringWithLengthByte( outgoingServer ); |
|
413 msg.AddStringWithLengthByteZero( outgoingAccessPoint ); |
|
414 msg.AddStringWithLengthByteZero( outgoingUsername ); |
|
415 msg.AddStringWithLengthByteZero( outgoingPassword ); |
|
416 msg.AddByte( outgoingSecurity ); |
|
417 msg.AddWord( outgoingPort ); |
|
418 msg.AddStringWithLengthByte( ownMailAddress ); |
|
419 msg.AddStringWithLengthByteZero( ownName ); |
|
420 msg.AddByte( sendOption ); |
|
421 msg.AddByte( copyToOwnAddress ); |
|
422 msg.AddStringWithLengthWordZero( signatureText ); |
|
423 msg.AddByte( newMailIndicators ); |
|
424 msg.AddByte( retrievedParts ); |
|
425 msg.AddWord( retrieveSizeLimit ); |
|
426 msg.AddWord( emailsToRetrieve ); |
|
427 msg.AddStringWithLengthByteZero( imap4FolderPath ); |
|
428 msg.AddByte( automaticUpdate ); |
|
429 msg.AddByte( setAsDefault ); |
|
430 return msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ); |
|
431 } |
|
432 |
|
433 //********************************************************************************** |
|
434 // ns1__deleteMailbox |
|
435 //********************************************************************************** |
|
436 int ns1__deleteMailbox(struct soap* soap, |
|
437 char *mailboxName, |
|
438 struct ns1__deleteMailboxResponse *out) |
|
439 { |
|
440 if ( check_mandatory_string_parameter( soap, mailboxName, "mailboxName" ) ) |
|
441 return SOAP_FAULT; |
|
442 |
|
443 HtiMsgHelper msg( soap, HTI_UID, CMD_DELETE_MAILBOX ); |
|
444 msg.AddStringWithLengthByte( mailboxName ); |
|
445 return msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ); |
|
446 } |
|
447 |
|
448 //********************************************************************************** |
|
449 // ns1__setDefaultSmsCenter |
|
450 //********************************************************************************** |
|
451 int ns1__setDefaultSmsCenter(struct soap* soap, |
|
452 char *smsCenterName, |
|
453 char *smsCenterNumber, |
|
454 struct ns1__setDefaultSmsCenterResponse *out) |
|
455 { |
|
456 if ( check_mandatory_string_parameter( soap, smsCenterName, "smsCenterName" ) ) |
|
457 return SOAP_FAULT; |
|
458 if ( check_mandatory_string_parameter( soap, smsCenterNumber, "smsCenterNumber" ) ) |
|
459 return SOAP_FAULT; |
|
460 |
|
461 HtiMsgHelper msg( soap, HTI_UID, CMD_SET_DEFAULT_SMS_CENTER ); |
|
462 msg.AddStringWithLengthByte( smsCenterName ); |
|
463 msg.AddStringWithLengthByte( smsCenterNumber ); |
|
464 return msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ); |
|
465 } |
|
466 |
|
467 //********************************************************************************** |
|
468 // ns1__deleteSmsCenter |
|
469 //********************************************************************************** |
|
470 int ns1__deleteSmsCenter(struct soap* soap, |
|
471 char *smsCenterName, |
|
472 struct ns1__deleteSmsCenterResponse *out) |
|
473 { |
|
474 if ( check_mandatory_string_parameter( soap, smsCenterName, "smsCenterName" ) ) |
|
475 return SOAP_FAULT; |
|
476 |
|
477 HtiMsgHelper msg( soap, HTI_UID, CMD_DELETE_SMS_CENTER ); |
|
478 msg.AddStringWithLengthByte( smsCenterName ); |
|
479 return msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ); |
|
480 } |
|
481 |
|
482 //********************************************************************************** |
|
483 // ns1__setSmsSettings |
|
484 //********************************************************************************** |
|
485 int ns1__setSmsSettings(struct soap* soap, |
|
486 enum ns1__smsCharacterSupport characterSupport, |
|
487 bool requestDeliveryReport, |
|
488 enum ns1__msgValidity validityPeriod, |
|
489 enum ns1__smsMessageConversion messageConversion, |
|
490 enum ns1__smsPreferredConnection preferredConnection, |
|
491 bool replyViaSameCenter, |
|
492 struct ns1__setSmsSettingsResponse *out) |
|
493 { |
|
494 HtiMsgHelper msg( soap, HTI_UID, CMD_SET_SMS_SETTINGS ); |
|
495 msg.AddByte( characterSupport ); |
|
496 msg.AddByte( requestDeliveryReport ); |
|
497 msg.AddByte( validityPeriod ); |
|
498 msg.AddByte( messageConversion ); |
|
499 msg.AddByte( preferredConnection ); |
|
500 msg.AddByte( replyViaSameCenter ); |
|
501 return msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ); |
|
502 } |
|
503 |
|
504 //********************************************************************************** |
|
505 // ns1__setMmsSettings |
|
506 //********************************************************************************** |
|
507 int ns1__setMmsSettings(struct soap* soap, |
|
508 char *accessPointName, |
|
509 enum ns1__mmsCreationMode creationMode, |
|
510 enum ns1__mmsImageSize imageSize, |
|
511 enum ns1__mmsReception reception, |
|
512 bool receiveAnonymous, |
|
513 bool receiveAdvertisements, |
|
514 bool requestDeliveryReports, |
|
515 bool sendDeliveryReports, |
|
516 enum ns1__msgValidity validityPeriod, |
|
517 struct ns1__setMmsSettingsResponse *out) |
|
518 { |
|
519 if ( check_mandatory_string_parameter( soap, accessPointName, "accessPointName" ) ) |
|
520 return SOAP_FAULT; |
|
521 |
|
522 HtiMsgHelper msg( soap, HTI_UID, CMD_SET_MMS_SETTINGS ); |
|
523 msg.AddStringWithLengthByte( accessPointName ); |
|
524 msg.AddByte( creationMode ); |
|
525 msg.AddByte( imageSize ); |
|
526 msg.AddByte( reception ); |
|
527 msg.AddByte( receiveAnonymous ); |
|
528 msg.AddByte( receiveAdvertisements ); |
|
529 msg.AddByte( requestDeliveryReports ); |
|
530 msg.AddByte( sendDeliveryReports ); |
|
531 msg.AddByte( validityPeriod ); |
|
532 return msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ); |
|
533 } |
|
534 |
|
535 //********************************************************************************** |
|
536 // ns1__createDestination |
|
537 //********************************************************************************** |
|
538 int ns1__createDestination(struct soap* soap, |
|
539 char *destinationName, |
|
540 struct ns1__createDestinationResponse *out) |
|
541 { |
|
542 if ( check_mandatory_string_parameter( soap, destinationName, "destinationName" ) ) |
|
543 return SOAP_FAULT; |
|
544 |
|
545 HtiMsgHelper msg( soap, HTI_UID, CMD_CREATE_DESTINATION ); |
|
546 msg.AddStringWithLengthByte( destinationName ); |
|
547 return msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ); |
|
548 } |
|
549 |
|
550 //********************************************************************************** |
|
551 // ns1__deleteDestination |
|
552 //********************************************************************************** |
|
553 int ns1__deleteDestination(struct soap* soap, |
|
554 char *destinationName, |
|
555 struct ns1__deleteDestinationResponse *out) |
|
556 { |
|
557 if ( check_mandatory_string_parameter( soap, destinationName, "destinationName" ) ) |
|
558 return SOAP_FAULT; |
|
559 |
|
560 HtiMsgHelper msg( soap, HTI_UID, CMD_DELETE_DESTINATION ); |
|
561 msg.AddStringWithLengthByte( destinationName ); |
|
562 return msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ); |
|
563 } |
|
564 |
|
565 //********************************************************************************** |
|
566 // ns1__addToDestination |
|
567 //********************************************************************************** |
|
568 int ns1__addToDestination(struct soap* soap, |
|
569 char *accessPointName, |
|
570 char *destinationName, |
|
571 struct ns1__addToDestinationResponse *out) |
|
572 { |
|
573 if ( check_mandatory_string_parameter( soap, accessPointName, "accessPointName" ) ) |
|
574 return SOAP_FAULT; |
|
575 |
|
576 if ( check_mandatory_string_parameter( soap, destinationName, "destinationName" ) ) |
|
577 return SOAP_FAULT; |
|
578 |
|
579 HtiMsgHelper msg( soap, HTI_UID, CMD_ADD_TO_DESTINATION ); |
|
580 msg.AddStringWithLengthByte( accessPointName ); |
|
581 msg.AddStringWithLengthByte( destinationName ); |
|
582 return msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ); |
|
583 } |
|
584 |
|
585 //********************************************************************************** |
|
586 // ns1__removeFromDestination |
|
587 //********************************************************************************** |
|
588 int ns1__removeFromDestination(struct soap* soap, |
|
589 char *accessPointName, |
|
590 char *destinationName, |
|
591 struct ns1__removeFromDestinationResponse *out) |
|
592 { |
|
593 if ( check_mandatory_string_parameter( soap, accessPointName, "accessPointName" ) ) |
|
594 return SOAP_FAULT; |
|
595 |
|
596 if ( check_mandatory_string_parameter( soap, destinationName, "destinationName" ) ) |
|
597 return SOAP_FAULT; |
|
598 |
|
599 HtiMsgHelper msg( soap, HTI_UID, CMD_REMOVE_FROM_DESTINATION ); |
|
600 msg.AddStringWithLengthByte( accessPointName ); |
|
601 msg.AddStringWithLengthByte( destinationName ); |
|
602 return msg.SendReceiveMsg( HTIMSG_TIMEOUT_10_SECONDS ); |
|
603 } |