sync-agent: Change the system-info api to 2.3 public api
[platform/core/system/sync-agent.git] / src / fw-plugins / common-public / slp-sysnoti-wap-push / src / plugin_interface.c
1 /*
2  * sync-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #include <glib.h>
19 #include <stdlib.h>
20 #include <string.h>
21 #include <glib-object.h>
22 #include <glib/gprintf.h>
23 #include <time.h>
24 #include <vconf-keys.h>
25 #include <vconf.h>
26
27 #include <msg.h>
28 #include <msg_storage.h>
29 #include <msg_transport.h>
30
31 #include "plugin_slp_sysnoti_wap_push.h"
32 #include "plugin/platform_monitor_interface.h"
33
34 /* for data logging */
35 #include "fsapi/operation.h"
36
37 /* for log */
38 #include "utility/sync_util.h"
39
40 #include <tzplatform_config.h>
41
42 #ifndef EXPORT_API
43 #define EXPORT_API __attribute__ ((visibility("default")))
44 #endif
45
46 #ifndef SYNC_AGENT_LOG
47 #undef LOG_TAG
48 #define LOG_TAG "PLUGIN_PM_SYSNOTI_WAP_PUSH"
49 #endif
50
51 #define CP_HEADER_DATA_PATH tzplatform_mkpath(TZ_SYS_DATA,"header_log.wbxml")
52 #define CP_BODY_DATA_PATH tzplatform_mkpath(TZ_SYS_DATA,"body_log.wbxml")
53
54 static msg_handle_t msg_handle = NULL;
55
56 static int (*registered_wap_push_incoming_cb) (int data_id, void *user_data);
57 static int (*registered_wap_push_operation_cb) (int data_id, void *user_data);
58
59 static int _start_wap_push();
60 static int _end_wap_push();
61 static int _add_message(void *add_data, int *added_data_id);
62 static int _remove_message(int remove_data_id);
63
64 static int __register_msg_callback();
65 static void __check_msg_server_cb(keynode_t * node, void *data);
66 static void ___incomming_syncml_msg_cb(msg_handle_t msg_handle, msg_syncml_message_type_t msg_type, const char *push_body, int push_body_len, const char *wsp_header, int wsp_header_len, void *user_param);
67 void ___operation_syncml_msg_cb(msg_handle_t handle, int msg_id, int ext_id, void *user_param);
68
69 EXPORT_API void sync_agent_plugin_init_service_noti(void *data)
70 {
71         _EXTERN_FUNC_ENTER;
72
73         int res = 0;
74
75         res = _start_wap_push();
76
77         if (res != 1) {
78                 _DEBUG_ERROR("_start_wap_push() failed !!");
79         } else {
80                 _DEBUG_INFO("_start_wap_push() success !!");
81         }
82
83         if (data != NULL) {
84                 if (((sync_agent_pm_register_data_s *) data)->pkg_name != NULL)
85                         free(((sync_agent_pm_register_data_s *) data)->pkg_name);
86
87                 if (((sync_agent_pm_register_data_s *) data)->additional_data != NULL)
88                         free(((sync_agent_pm_register_data_s *) data)->additional_data);
89
90                 free(data);
91
92                 _DEBUG_INFO("free sync_agent_pm_register_data_s !!");
93         }
94
95         _EXTERN_FUNC_EXIT;
96 }
97
98 EXPORT_API sync_agent_pm_return_e sync_agent_plugin_unregister_service_noti(void)
99 {
100         _EXTERN_FUNC_ENTER;
101
102         sync_agent_pm_return_e ret = SYNC_AGENT_PM_SUCCESS;
103
104         int res = 0;
105
106         res = _end_wap_push();
107
108         if (res != 1) {
109                 _DEBUG_ERROR("_end_wap_push() failed !!");
110                 return res;
111         } else {
112                 _DEBUG_INFO("_end_wap_push() success !!");
113         }
114
115         _EXTERN_FUNC_EXIT;
116
117         return ret;
118 }
119
120 EXPORT_API sync_agent_pm_return_e sync_agent_plugin_add_service_data(void *add_data, int *added_data_id)
121 {
122         _EXTERN_FUNC_ENTER;
123
124         retvm_if(add_data == NULL, SYNC_AGENT_PM_FAIL, "add_data is NULL. FAIL !!!");
125
126         sync_agent_pm_return_e ret = SYNC_AGENT_PM_SUCCESS;
127
128         int res = 0;
129
130         res = _add_message(add_data, added_data_id);
131
132         if (res != 1) {
133                 _DEBUG_ERROR("_add_message() failed !!");
134                 return SYNC_AGENT_PM_FAIL;
135         } else {
136                 _DEBUG_INFO("_add_message() success !!");
137         }
138
139         _EXTERN_FUNC_EXIT;
140
141         return ret;
142 }
143
144 EXPORT_API sync_agent_pm_return_e sync_agent_plugin_remove_service_data(int remove_data_id)
145 {
146         _EXTERN_FUNC_ENTER;
147
148         sync_agent_pm_return_e ret = SYNC_AGENT_PM_SUCCESS;
149
150         int res = 0;
151
152         res = _remove_message(remove_data_id);
153
154         if (res != 1) {
155                 _DEBUG_ERROR("_remove_message() failed !!");
156                 return res;
157         } else {
158                 _DEBUG_INFO("_remove_message() success !!");
159         }
160
161         _EXTERN_FUNC_EXIT;
162
163         return ret;
164 }
165
166 EXPORT_API sync_agent_pm_return_e sync_agent_plugin_get_service_data(int get_data_id, void **service_data)
167 {
168         _EXTERN_FUNC_ENTER;
169
170         sync_agent_pm_return_e ret = SYNC_AGENT_PM_SUCCESS;
171
172         _DEBUG_INFO("not support this feature !!");
173
174         _EXTERN_FUNC_EXIT;
175
176         return ret;
177 }
178
179 EXPORT_API void sync_agent_plugin_set_user_callback(int callback_counts, va_list list)
180 {
181         _EXTERN_FUNC_ENTER;
182
183         int i = 0;
184
185         _DEBUG_INFO("callback_counts : %d", callback_counts);
186         for (; i < callback_counts; i++) {
187                 switch (i) {
188                 case 0:
189                         registered_wap_push_incoming_cb = va_arg(list, sync_agent_user_callback_cb_plugin);
190                         _DEBUG_INFO("set user callback ( for WAP Push Incoming ) !!");
191                         break;
192                 case 1:
193                         registered_wap_push_operation_cb = va_arg(list, sync_agent_user_callback_cb_plugin);
194                         _DEBUG_INFO("set user callback ( for WAP Push Operation End ) !!");
195                         break;
196                 default:
197                         break;
198                 }
199         }
200
201         _EXTERN_FUNC_EXIT;
202 }
203
204 static int _start_wap_push()
205 {
206         _INNER_FUNC_ENTER;
207
208         int res = 1;
209         int msg_key = 0;
210
211         msg_error_t err = MSG_SUCCESS;
212
213         if (vconf_get_bool(VCONFKEY_MSG_SERVER_READY, &msg_key) == 0) {
214                 if (msg_key == 1) {
215                         _DEBUG_TRACE("msg server is ready !!");
216
217                         err = msg_open_msg_handle(&msg_handle);
218                         if (err != MSG_SUCCESS) {
219                                 _DEBUG_ERROR("msg_open_msg_handle() failed ( err_code : %d ) !!", err);
220                                 res = -1;
221                                 goto return_part;
222                         } else {
223                                 _DEBUG_TRACE("msg_open_msg_handle() success !!");
224
225                                 res = __register_msg_callback();
226                                 if (res != 1) {
227                                         _DEBUG_ERROR("register_syncml_msg_callback() failed ( err_code : %d ) !!", res);
228
229                                         err = msg_close_msg_handle(&msg_handle);
230                                         if (err != MSG_SUCCESS) {
231                                                 _DEBUG_ERROR("msg_close_msg_handle() failed ( err_code : %d ) !!", err);
232                                                 res = -1;
233                                                 goto return_part;
234                                         } else {
235                                                 _DEBUG_TRACE("msg_close_msg_handle() success !!");
236                                                 msg_handle = NULL;
237                                                 res = -1;
238                                                 goto return_part;
239                                         }
240                                 } else {
241                                         _DEBUG_TRACE("register_syncml_msg_callback() success !!");
242                                 }
243                         }
244                 } else {
245                         _DEBUG_ERROR("msg server is not ready !!");
246
247                         if (vconf_notify_key_changed((char *)VCONFKEY_MSG_SERVER_READY, __check_msg_server_cb, NULL) != 0) {
248                                 _DEBUG_ERROR("vconf_notify_key_changed( VCONFKEY_MSG_SERVER_READY ) failed !!");
249                                 res = -1;
250                                 goto return_part;
251                         } else {
252                                 _DEBUG_TRACE("vconf_notify_key_changed() success !!");
253                         }
254                 }
255         } else {
256                 _DEBUG_ERROR("vconf_get_bool ( VCONFKEY_MSG_SERVER_READY ) failed !!");
257                 res = -1;
258                 goto return_part;
259         }
260
261  return_part:
262
263         _INNER_FUNC_EXIT;
264
265         return res;
266 }
267
268 static int _end_wap_push()
269 {
270         _INNER_FUNC_ENTER;
271
272         int res = 1;
273         msg_error_t err = MSG_SUCCESS;
274
275         err = msg_close_msg_handle(&msg_handle);
276         if (err != MSG_SUCCESS) {
277                 _DEBUG_ERROR("msg_close_msg_handle() failed ( err_code : %d ) !!", err);
278                 res = -1;
279                 goto return_part;
280         } else {
281                 _DEBUG_TRACE("msg_close_msg_handle() success !!");
282                 msg_handle = NULL;
283         }
284
285  return_part:
286
287         _INNER_FUNC_EXIT;
288
289         return res;
290 }
291
292 static int _add_message(void *add_data, int *added_data_id)
293 {
294         _INNER_FUNC_ENTER;
295
296         retvm_if(add_data == NULL, 0, "add_data is NULL. FAIL !!!");
297
298         int res = 1;
299         msg_error_t err = MSG_SUCCESS;
300
301         msg_struct_t syncml_msg = msg_create_struct(MSG_STRUCT_SYNCML_INFO);
302         pmci_san_message_s *add_msg = (pmci_san_message_s *) add_data;
303
304         *added_data_id = add_msg->ext_id;
305         msg_set_int_value(syncml_msg, MSG_SYNCML_INFO_EXTID_INT, add_msg->ext_id);
306         msg_set_int_value(syncml_msg, MSG_SYNCML_INFO_PINCODE_INT, add_msg->pin_code);
307
308         msg_struct_t msg = NULL;
309         msg_get_struct_handle(syncml_msg, MSG_SYNCML_INFO_MESSAGE_HND, &msg);
310         msg_set_int_value(msg, MSG_MESSAGE_FOLDER_ID_INT, MSG_INBOX_ID);
311         msg_set_int_value(msg, MSG_MESSAGE_TYPE_INT, MSG_TYPE_SMS_SYNCML);
312         msg_set_int_value(msg, MSG_MESSAGE_NETWORK_STATUS_INT, MSG_NETWORK_RECEIVED);
313         msg_set_int_value(msg, MSG_MESSAGE_DIRECTION_INT, MSG_DIRECTION_TYPE_MT);
314
315         msg_struct_list_s *addr_list = NULL;
316         msg_get_list_handle(msg, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
317         addr_list->nCount = 1;
318
319         msg_struct_t addr_info = NULL;
320         addr_info = addr_list->msg_struct_info[0];
321         msg_set_int_value(addr_info, MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT, MSG_RECIPIENTS_TYPE_TO);
322         char addr_value[MAX_ADDRESS_VAL_LEN] = "+1004";
323         msg_set_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, addr_value, MAX_ADDRESS_VAL_LEN);
324
325         time_t t = time(NULL);
326         time_t utfTime = time(&t);
327         msg_set_int_value(msg, MSG_MESSAGE_DISPLAY_TIME_INT, utfTime);
328
329         msg_set_str_value(msg, MSG_MESSAGE_SMS_DATA_STR, add_msg->msg_data, strlen(add_msg->msg_data));
330
331         err = msg_add_syncml_message(msg_handle, syncml_msg);
332         if (err != MSG_SUCCESS) {
333                 _DEBUG_ERROR("msg_add_syncml_message() failed ( err_code : %d ) !!", err);
334                 res = -1;
335                 goto return_part;
336         } else {
337                 _DEBUG_TRACE("msg_add_syncml_message() success !!");
338         }
339
340  return_part:
341         msg_release_struct(&syncml_msg);
342
343         _INNER_FUNC_EXIT;
344
345         return res;
346 }
347
348 static int _remove_message(int remove_data_id)
349 {
350         _INNER_FUNC_ENTER;
351
352         int res = 1;
353         msg_error_t err = MSG_SUCCESS;
354
355         if (msg_handle == NULL) {
356                 _DEBUG_ERROR("msg_handle is NULL !!");
357                 res = -1;
358                 goto return_part;
359         }
360
361         err = msg_delete_message(msg_handle, remove_data_id);
362         if (err != MSG_SUCCESS) {
363                 _DEBUG_ERROR("msg_delete_message() fail !!");
364                 res = -1;
365         } else {
366                 _DEBUG_INFO("msg_delete_message() success !!");
367         }
368
369  return_part:
370
371         _INNER_FUNC_EXIT;
372
373         return res;
374 }
375
376 static int __register_msg_callback()
377 {
378         _INNER_FUNC_ENTER;
379
380         int res = 1;
381         msg_error_t err = MSG_SUCCESS;
382
383         if (msg_handle == NULL) {
384                 _DEBUG_ERROR("msg_handle is NULL !!");
385                 res = -1;
386                 goto return_part;
387         }
388 //    err = msg_reg_syncml_message_callback(msg_handle, &___incomming_syncml_msg_cb, NULL);
389         err = msg_reg_syncml_message_callback(msg_handle, ___incomming_syncml_msg_cb, NULL);
390         if (err != MSG_SUCCESS) {
391                 _DEBUG_ERROR("Register SyncML Incoming Callback fail [%d] !!", err);
392                 res = -1;
393                 goto return_part;
394         } else {
395                 _DEBUG_VERBOSE("Register SyncML Incoming Callback success !!");
396         }
397
398 //      err = msg_reg_syncml_message_operation_callback(msg_handle, &___operation_syncml_msg_cb, NULL);
399         err = msg_reg_syncml_message_operation_callback(msg_handle, ___operation_syncml_msg_cb, NULL);
400         if (err != MSG_SUCCESS) {
401                 _DEBUG_ERROR("Register SyncML Operation Callback fail [%d] !!", err);
402                 res = -1;
403                 goto return_part;
404         } else {
405                 _DEBUG_VERBOSE("Register SyncML Operation Callback success !!");
406         }
407
408  return_part:
409
410         _INNER_FUNC_EXIT;
411
412         return res;
413 }
414
415 static void __check_msg_server_cb(keynode_t * node, void *data)
416 {
417         _INNER_FUNC_ENTER;
418
419         int res = 1;
420         int msg_key = 0;
421         msg_error_t err = MSG_SUCCESS;
422
423         if (vconf_get_bool(VCONFKEY_MSG_SERVER_READY, &msg_key) == 0) {
424                 if (msg_key == 1) {
425                         _DEBUG_VERBOSE("msg server is ready !!");
426
427                         if (msg_handle == NULL) {
428                                 err = msg_open_msg_handle(&msg_handle);
429                                 if (err != MSG_SUCCESS) {
430                                         _DEBUG_ERROR("msg_open_msg_handle() fail [%d] !!", err);
431                                         goto return_part;
432                                 } else {
433                                         _DEBUG_VERBOSE("msg_open_msg_handle() success !!");
434
435                                         res = __register_msg_callback();
436                                         if (res != 1) {
437                                                 _DEBUG_ERROR("register_syncml_msg_callback() fail !!");
438                                                 goto return_part;
439                                         } else {
440                                                 _DEBUG_VERBOSE("register_syncml_msg_callback() success !!");
441                                         }
442                                 }
443                         } else {
444                                 _DEBUG_VERBOSE("callback is already registered !!");
445                         }
446                 } else {
447                         _DEBUG_VERBOSE("msg server is not ready !!");
448                 }
449         } else {
450                 _DEBUG_ERROR("vconf_get_bool ( VCONFKEY_MSG_SERVER_READY ) fail !!");
451                 goto return_part;
452         }
453
454  return_part:
455
456         _INNER_FUNC_EXIT;
457
458         return;
459 }
460
461 static void ___incomming_syncml_msg_cb(msg_handle_t msg_handle, msg_syncml_message_type_t msg_type, const char *push_body, int push_body_len, const char *wsp_header, int wsp_header_len, void *user_param)
462 {
463         _INNER_FUNC_ENTER;
464
465         pmci_san_incoming_s *san_incoming = (pmci_san_incoming_s *) calloc(1, sizeof(pmci_san_incoming_s));
466         if (san_incoming == NULL) {
467                 _DEBUG_ERROR("pmci_san_incomming_t calloc error !!");
468                 /* todo : exception handling */
469                 return;
470         }
471         _DEBUG_VERBOSE("push body : %s,   push body len : %d", push_body, push_body_len);
472         _DEBUG_VERBOSE("wsp header : %s,   wsp header len : %d", wsp_header, wsp_header_len);
473
474         /* FIXME : for recoding log data - Start */
475         _DEBUG_VERBOSE("logging wsp_header >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
476
477         int file_ret = sync_agent_write_whole_file(CP_HEADER_DATA_PATH, wsp_header, wsp_header_len, 1);
478         if (file_ret != 1) {
479                 _DEBUG_ERROR("sync_agent_write_whole_file() - CP header data failed !!");
480         } else {
481                 _DEBUG_VERBOSE("sync_agent_write_whole_file() - CP header data success !!");
482         }
483
484         _DEBUG_VERBOSE("logging PushBody >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
485         file_ret = sync_agent_write_whole_file(CP_BODY_DATA_PATH, push_body, push_body_len, 1);
486
487         if (file_ret != 1) {
488                 _DEBUG_ERROR("sync_agent_write_whole_file() - CP body data failed !!");
489         } else {
490                 _DEBUG_VERBOSE("sync_agent_write_whole_file() - CP body data success !!");
491         }
492
493         /* FIXME : for recoding log data - End */
494
495         if ((msg_type == CP_WBXML) || (msg_type == CP_XML)) {   /* CP case : merging header & body messages */
496                 if ((push_body_len > 0) && (wsp_header_len > 0)) {
497                         int msg_len = push_body_len + wsp_header_len + 1;
498
499                         san_incoming->msg_body = (char *)calloc(msg_len, sizeof(char));
500                         if (san_incoming->msg_body == NULL) {
501                                 _DEBUG_ERROR("san_incoming->msg_body calloc error !!");
502                                 goto free_part;
503                         } else {
504                                 if (wsp_header != NULL) {
505                                         _DEBUG_VERBOSE("CP : add wsp_header data !!");
506                                         memcpy((void *)(san_incoming->msg_body), wsp_header, wsp_header_len + 1);
507                                 } else {
508                                         _DEBUG_ERROR("wrong message - wapHeader is NULL !!");
509                                         goto free_part;
510                                 }
511
512                                 if (push_body != NULL) {
513                                         _DEBUG_VERBOSE("CP : add push_body data !!");
514                                         memcpy((void *)((san_incoming->msg_body) + wsp_header_len), push_body, push_body_len + 1);
515                                 } else {
516                                         _DEBUG_ERROR("wrong message - push_body is NULL !!");
517                                         goto free_part;
518                                 }
519
520                                 san_incoming->msg_size = msg_len - 1;
521                         }
522                 } else {
523                         _DEBUG_ERROR("wrong message format !!");
524                         goto free_part;
525                 }
526         } else {
527                 if ((push_body_len > 0) && (push_body != NULL)) {
528                         san_incoming->msg_body = (char *)calloc(push_body_len + 1, sizeof(char));
529                         if (san_incoming->msg_body == NULL) {
530                                 _DEBUG_ERROR("san_incoming->msg_body calloc error !!");
531                                 goto free_part;
532                         } else {
533                                 _DEBUG_VERBOSE("OTHERS : set push_body data !!");
534                                 memcpy((void *)(san_incoming->msg_body), push_body, push_body_len + 1);
535                                 san_incoming->msg_size = push_body_len;
536                         }
537                 } else {
538                         _DEBUG_VERBOSE("PushBody message is NULL !!");
539                         san_incoming->msg_body = NULL;
540                         san_incoming->msg_size = 0;
541                 }
542         }
543
544         switch (msg_type) {
545         case DM_WBXML:
546                 {
547                         _DEBUG_VERBOSE("MsgNoti ( msg_type = 0, DM_WBXML ) detected.\n");
548                         san_incoming->version = SAN_DM_WBXML;
549                 }
550                 break;
551         case DM_XML:
552                 {
553                         _DEBUG_VERBOSE("MsgNoti ( msg_type = 1, DM_XML ) detected.\n");
554                         san_incoming->version = SAN_DM_XML;
555                 }
556                 break;
557         case DM_NOTIFICATION:
558                 {
559                         _DEBUG_VERBOSE("MsgNoti ( msg_type = 2, DM_NOTIFICATION ) detected.\n");
560                         san_incoming->version = SAN_DM_NOTI;
561                 }
562                 break;
563         case DS_NOTIFICATION:
564                 {
565                         _DEBUG_VERBOSE("MsgNoti ( msg_type = 3, DS_NOTIFICATION ) detected.\n");
566                         san_incoming->version = SAN_VERSION_12;
567                 }
568                 break;
569         case DS_WBXML:
570                 {
571                         _DEBUG_VERBOSE("MsgNoti ( msg_type = 4, DS_WBXML ) detected.\n");
572                         san_incoming->version = SAN_VERSION_11;
573                 }
574                 break;
575         case CP_XML:
576                 {
577                         _DEBUG_VERBOSE("MsgNoti ( msg_type = 5, CP_XML ) detected.\n");
578                         san_incoming->version = SAN_CP_XML;
579                 }
580                 break;
581         case CP_WBXML:
582                 {
583                         _DEBUG_VERBOSE("MsgNoti ( msg_type = 6, CP_WBXML ) detected.\n");
584                         san_incoming->version = SAN_CP_WBXML;
585                 }
586                 break;
587         case OTHERS:
588         default:
589                 _DEBUG_VERBOSE("Unknown MsgNoti ( %d ) detected.\n", msg_type);
590                 break;
591         }
592
593         if (registered_wap_push_incoming_cb != NULL) {
594                 registered_wap_push_incoming_cb(0, (void *)san_incoming);
595         } else {
596                 _DEBUG_ERROR("not registered registered_wap_push_incoming_cb !!");
597         }
598
599  free_part:
600         if (san_incoming != NULL) {
601                 if (san_incoming->msg_body != NULL)
602                         free((void *)(san_incoming->msg_body));
603
604                 free(san_incoming);
605         }
606
607         _INNER_FUNC_EXIT;
608 }
609
610 void ___operation_syncml_msg_cb(msg_handle_t handle, int msg_id, int ext_id, void *user_param)
611 {
612         _INNER_FUNC_ENTER;
613
614         pmci_san_operation_s *san_operation = (pmci_san_operation_s *) calloc(1, sizeof(pmci_san_operation_s));
615         if (san_operation == NULL) {
616                 _DEBUG_ERROR("pmci_san_operation_s calloc error !!");
617                 /* todo : exception handling */
618                 return;
619         }
620
621         san_operation->msg_id = msg_id;
622         _DEBUG_VERBOSE("msg_id : %d", msg_id);
623
624         san_operation->ext_id = ext_id;
625         _DEBUG_VERBOSE("ext_id : %d", ext_id);
626
627         san_operation->user_param = user_param;
628         /*memcpy(san_operation->user_param, user_param, sizeof(user_param)); */
629
630         if (registered_wap_push_operation_cb != NULL) {
631                 registered_wap_push_operation_cb(0, (void *)san_operation);
632         } else {
633                 _DEBUG_ERROR("not registered registered_wap_push_operation_cb !!");
634                 if(san_operation != NULL) {
635                         free(san_operation);
636                         san_operation = NULL;
637                 }
638         }
639
640         _INNER_FUNC_EXIT;
641 }